@burdenoff/microfe-coolandlovely 2026.1024.4 → 2026.1027.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.
Files changed (40) hide show
  1. package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -1
  2. package/dist/coolandlovely/CoolAndLovelyRoutes.js +20 -12
  3. package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
  4. package/dist/coolandlovely/components/FulfilmentTimeline.d.ts +7 -0
  5. package/dist/coolandlovely/components/FulfilmentTimeline.d.ts.map +1 -0
  6. package/dist/coolandlovely/components/FulfilmentTimeline.js +77 -0
  7. package/dist/coolandlovely/components/FulfilmentTimeline.js.map +1 -0
  8. package/dist/coolandlovely/components/RefundPanel.d.ts +8 -0
  9. package/dist/coolandlovely/components/RefundPanel.d.ts.map +1 -0
  10. package/dist/coolandlovely/components/RefundPanel.js +113 -0
  11. package/dist/coolandlovely/components/RefundPanel.js.map +1 -0
  12. package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -1
  13. package/dist/coolandlovely/components/StatusBadge.js +17 -1
  14. package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
  15. package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts +12 -0
  16. package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts.map +1 -0
  17. package/dist/coolandlovely/hooks/useBrandOrdersApi.js +124 -0
  18. package/dist/coolandlovely/hooks/useBrandOrdersApi.js.map +1 -0
  19. package/dist/coolandlovely/hooks/useCommerceApi.d.ts +4 -0
  20. package/dist/coolandlovely/hooks/useCommerceApi.d.ts.map +1 -1
  21. package/dist/coolandlovely/hooks/useCommerceApi.js +28 -23
  22. package/dist/coolandlovely/hooks/useCommerceApi.js.map +1 -1
  23. package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts.map +1 -1
  24. package/dist/coolandlovely/pages/brands/BrandDetailPage.js +157 -148
  25. package/dist/coolandlovely/pages/brands/BrandDetailPage.js.map +1 -1
  26. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts +14 -0
  27. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts.map +1 -0
  28. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js +362 -0
  29. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js.map +1 -0
  30. package/dist/coolandlovely/pages/commerce/CartPage.js +4 -4
  31. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts.map +1 -1
  32. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js +108 -106
  33. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js.map +1 -1
  34. package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts +2 -1
  35. package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts.map +1 -1
  36. package/dist/coolandlovely/pages/commerce/OrdersPage.js +206 -123
  37. package/dist/coolandlovely/pages/commerce/OrdersPage.js.map +1 -1
  38. package/dist/coolandlovely/types/commerce.d.ts +98 -1
  39. package/dist/coolandlovely/types/commerce.d.ts.map +1 -1
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CoolAndLovelyRoutes.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAwIhD,eAAO,MAAM,mBAAmB,EAAE,EAsFjC,CAAC"}
1
+ {"version":3,"file":"CoolAndLovelyRoutes.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA8IhD,eAAO,MAAM,mBAAmB,EAAE,EA0FjC,CAAC"}
@@ -4,15 +4,15 @@ import { Suspense as n, lazy as r } from "react";
4
4
  import { Navigate as i, Route as a, Routes as o, useLocation as s } from "react-router";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  //#region src/coolandlovely/CoolAndLovelyRoutes.tsx
7
- var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), m = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), h = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), g = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), _ = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), v = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), y = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), b = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), x = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), S = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), C = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), w = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), T = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), E = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), D = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), O = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), k = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), A = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), j = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), M = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), N = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))), P = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), F = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), I = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), L = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), R = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), z = () => /* @__PURE__ */ c("div", {
7
+ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), m = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), h = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), g = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), _ = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), v = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), y = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), b = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), x = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), S = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), C = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), w = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), T = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), E = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), D = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), O = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), k = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), A = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), j = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), M = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), N = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrdersPage }))), P = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrderDetailPage }))), F = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))), I = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), L = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), R = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), z = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), B = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), V = () => /* @__PURE__ */ c("div", {
8
8
  className: "flex min-h-[400px] items-center justify-center",
9
9
  children: /* @__PURE__ */ c("div", { className: "h-8 w-8 animate-spin rounded-full border-b-2 border-primary" })
10
- }), B = () => {
11
- let { basePath: r, isStandalone: B } = e(), V = s(), H = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
12
- return H && !B && !(V.pathname === H || V.pathname.startsWith(H + "/")) ? null : /* @__PURE__ */ c("div", {
10
+ }), H = () => {
11
+ let { basePath: r, isStandalone: H } = e(), U = s(), W = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
12
+ return W && !H && !(U.pathname === W || U.pathname.startsWith(W + "/")) ? null : /* @__PURE__ */ c("div", {
13
13
  className: "flex min-h-full flex-col",
14
14
  children: /* @__PURE__ */ c(n, {
15
- fallback: /* @__PURE__ */ c(z, {}),
15
+ fallback: /* @__PURE__ */ c(V, {}),
16
16
  children: /* @__PURE__ */ l(o, { children: [
17
17
  /* @__PURE__ */ c(a, {
18
18
  index: !0,
@@ -132,15 +132,23 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
132
132
  }),
133
133
  /* @__PURE__ */ c(a, {
134
134
  path: "orders",
135
- element: /* @__PURE__ */ c(N, {})
135
+ element: /* @__PURE__ */ c(F, {})
136
136
  }),
137
137
  /* @__PURE__ */ c(a, {
138
138
  path: "orders/:orderId",
139
- element: /* @__PURE__ */ c(P, {})
139
+ element: /* @__PURE__ */ c(I, {})
140
140
  }),
141
141
  /* @__PURE__ */ c(a, {
142
142
  path: "earnings",
143
- element: /* @__PURE__ */ c(F, {})
143
+ element: /* @__PURE__ */ c(L, {})
144
+ }),
145
+ /* @__PURE__ */ c(a, {
146
+ path: "brand-orders",
147
+ element: /* @__PURE__ */ c(N, {})
148
+ }),
149
+ /* @__PURE__ */ c(a, {
150
+ path: "brand-orders/:brandId/:orderId",
151
+ element: /* @__PURE__ */ c(P, {})
144
152
  }),
145
153
  /* @__PURE__ */ c(a, {
146
154
  path: "admin",
@@ -151,15 +159,15 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
151
159
  }),
152
160
  /* @__PURE__ */ c(a, {
153
161
  path: "admin/brands",
154
- element: /* @__PURE__ */ c(I, {})
162
+ element: /* @__PURE__ */ c(R, {})
155
163
  }),
156
164
  /* @__PURE__ */ c(a, {
157
165
  path: "admin/collaborations",
158
- element: /* @__PURE__ */ c(L, {})
166
+ element: /* @__PURE__ */ c(z, {})
159
167
  }),
160
168
  /* @__PURE__ */ c(a, {
161
169
  path: "admin/featured-items",
162
- element: /* @__PURE__ */ c(R, {})
170
+ element: /* @__PURE__ */ c(B, {})
163
171
  }),
164
172
  /* @__PURE__ */ c(a, {
165
173
  path: "*",
@@ -173,6 +181,6 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
173
181
  });
174
182
  };
175
183
  //#endregion
176
- export { B as CoolAndLovelyRoutes };
184
+ export { H as CoolAndLovelyRoutes };
177
185
 
178
186
  //# sourceMappingURL=CoolAndLovelyRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CoolAndLovelyRoutes.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"sourcesContent":["/**\n * CoolAndLovely Routes\n * @module coolandlovely\n *\n * Real fashion-domain routes wired to the live `wspace-coolandlovely-svc`\n * GraphQL contract: overview, brands, collections, style items, looks,\n * collaborations, wardrobe, lookbooks and the shopper's style profile.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useCoolAndLovely } from './context/CoolAndLovelyContext';\n\n// Eager-loaded overview (primary landing page)\nimport { HomePage } from './pages/HomePage';\n\n// Brands\nconst BrandsListPage = lazy(() =>\n import('./pages/brands/BrandsListPage').then((m) => ({ default: m.BrandsListPage }))\n);\nconst BrandDetailPage = lazy(() =>\n import('./pages/brands/BrandDetailPage').then((m) => ({ default: m.BrandDetailPage }))\n);\nconst BrandFormPage = lazy(() =>\n import('./pages/brands/BrandFormPage').then((m) => ({ default: m.BrandFormPage }))\n);\n\n// Collections\nconst CollectionsListPage = lazy(() =>\n import('./pages/collections/CollectionsListPage').then((m) => ({\n default: m.CollectionsListPage,\n }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/collections/CollectionDetailPage').then((m) => ({\n default: m.CollectionDetailPage,\n }))\n);\nconst CollectionFormPage = lazy(() =>\n import('./pages/collections/CollectionFormPage').then((m) => ({ default: m.CollectionFormPage }))\n);\n\n// Style items\nconst StyleItemsListPage = lazy(() =>\n import('./pages/items/StyleItemsListPage').then((m) => ({ default: m.StyleItemsListPage }))\n);\nconst StyleItemDetailPage = lazy(() =>\n import('./pages/items/StyleItemDetailPage').then((m) => ({ default: m.StyleItemDetailPage }))\n);\nconst StyleItemFormPage = lazy(() =>\n import('./pages/items/StyleItemFormPage').then((m) => ({ default: m.StyleItemFormPage }))\n);\n\n// Looks\nconst LooksListPage = lazy(() =>\n import('./pages/looks/LooksListPage').then((m) => ({ default: m.LooksListPage }))\n);\nconst LookDetailPage = lazy(() =>\n import('./pages/looks/LookDetailPage').then((m) => ({ default: m.LookDetailPage }))\n);\nconst LookFormPage = lazy(() =>\n import('./pages/looks/LookFormPage').then((m) => ({ default: m.LookFormPage }))\n);\n\n// Collaborations\nconst CollaborationsListPage = lazy(() =>\n import('./pages/collaborations/CollaborationsListPage').then((m) => ({\n default: m.CollaborationsListPage,\n }))\n);\nconst CollaborationDetailPage = lazy(() =>\n import('./pages/collaborations/CollaborationDetailPage').then((m) => ({\n default: m.CollaborationDetailPage,\n }))\n);\nconst CollaborationFormPage = lazy(() =>\n import('./pages/collaborations/CollaborationFormPage').then((m) => ({\n default: m.CollaborationFormPage,\n }))\n);\n\n// Wardrobe (self-scoped)\nconst WardrobeListPage = lazy(() =>\n import('./pages/wardrobe/WardrobeListPage').then((m) => ({ default: m.WardrobeListPage }))\n);\nconst WardrobeFormPage = lazy(() =>\n import('./pages/wardrobe/WardrobeFormPage').then((m) => ({ default: m.WardrobeFormPage }))\n);\n\n// Lookbooks\nconst LookbooksListPage = lazy(() =>\n import('./pages/lookbooks/LookbooksListPage').then((m) => ({ default: m.LookbooksListPage }))\n);\nconst LookbookDetailPage = lazy(() =>\n import('./pages/lookbooks/LookbookDetailPage').then((m) => ({ default: m.LookbookDetailPage }))\n);\n\n// Style profile (self-scoped)\nconst StyleProfilePage = lazy(() =>\n import('./pages/profile/StyleProfilePage').then((m) => ({ default: m.StyleProfilePage }))\n);\n\n// Discovery + trends (client-side analytics over the real catalogue/social lists)\nconst DiscoverPage = lazy(() =>\n import('./pages/discover/DiscoverPage').then((m) => ({ default: m.DiscoverPage }))\n);\nconst TrendsPage = lazy(() =>\n import('./pages/trends/TrendsPage').then((m) => ({ default: m.TrendsPage }))\n);\n\n// Commerce (BOFF-3370): cart, orders, creator earnings\nconst CartPage = lazy(() =>\n import('./pages/commerce/CartPage').then((m) => ({ default: m.CartPage }))\n);\nconst OrdersPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrdersPage }))\n);\nconst OrderDetailPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrderDetailPage }))\n);\nconst CreatorEarningsPage = lazy(() =>\n import('./pages/commerce/CreatorEarningsPage').then((m) => ({ default: m.CreatorEarningsPage }))\n);\n\n// Admin curation (gated by the `coolandlovely.admin.curation` feature flag)\nconst AdminBrandsPage = lazy(() =>\n import('./pages/admin/AdminBrandsPage').then((m) => ({ default: m.AdminBrandsPage }))\n);\nconst AdminCollaborationsPage = lazy(() =>\n import('./pages/admin/AdminCollaborationsPage').then((m) => ({\n default: m.AdminCollaborationsPage,\n }))\n);\nconst AdminFeaturedItemsPage = lazy(() =>\n import('./pages/admin/AdminFeaturedItemsPage').then((m) => ({\n default: m.AdminFeaturedItemsPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const CoolAndLovelyRoutes: FC = () => {\n const { basePath, isStandalone } = useCoolAndLovely();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the path matches the basePath (when integrated).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview */}\n <Route index element={<HomePage />} />\n\n {/* Brands */}\n <Route path=\"brands\" element={<BrandsListPage />} />\n <Route path=\"brands/new\" element={<BrandFormPage />} />\n <Route path=\"brands/:brandId\" element={<BrandDetailPage />} />\n <Route path=\"brands/:brandId/edit\" element={<BrandFormPage />} />\n\n {/* Collections */}\n <Route path=\"collections\" element={<CollectionsListPage />} />\n <Route path=\"collections/new\" element={<CollectionFormPage />} />\n <Route path=\"collections/:collectionId\" element={<CollectionDetailPage />} />\n <Route path=\"collections/:collectionId/edit\" element={<CollectionFormPage />} />\n\n {/* Style items */}\n <Route path=\"items\" element={<StyleItemsListPage />} />\n <Route path=\"items/new\" element={<StyleItemFormPage />} />\n <Route path=\"items/:itemId\" element={<StyleItemDetailPage />} />\n <Route path=\"items/:itemId/edit\" element={<StyleItemFormPage />} />\n\n {/* Looks */}\n <Route path=\"looks\" element={<LooksListPage />} />\n <Route path=\"looks/new\" element={<LookFormPage />} />\n <Route path=\"looks/:lookId\" element={<LookDetailPage />} />\n\n {/* Collaborations */}\n <Route path=\"collaborations\" element={<CollaborationsListPage />} />\n <Route path=\"collaborations/new\" element={<CollaborationFormPage />} />\n <Route path=\"collaborations/:collaborationId\" element={<CollaborationDetailPage />} />\n <Route path=\"collaborations/:collaborationId/edit\" element={<CollaborationFormPage />} />\n\n {/* Wardrobe (self-scoped) */}\n <Route path=\"wardrobe\" element={<WardrobeListPage />} />\n <Route path=\"wardrobe/new\" element={<WardrobeFormPage />} />\n\n {/* Lookbooks */}\n <Route path=\"lookbooks\" element={<LookbooksListPage />} />\n <Route path=\"lookbooks/:lookbookId\" element={<LookbookDetailPage />} />\n\n {/* Style profile (self-scoped) + public profiles */}\n <Route path=\"profile\" element={<StyleProfilePage />} />\n <Route path=\"profile/:userId\" element={<StyleProfilePage />} />\n\n {/* Discovery + trends */}\n <Route path=\"discover\" element={<DiscoverPage />} />\n <Route path=\"trends\" element={<TrendsPage />} />\n\n {/* Commerce */}\n <Route path=\"cart\" element={<CartPage />} />\n <Route path=\"orders\" element={<OrdersPage />} />\n <Route path=\"orders/:orderId\" element={<OrderDetailPage />} />\n <Route path=\"earnings\" element={<CreatorEarningsPage />} />\n\n {/* Admin curation */}\n <Route path=\"admin\" element={<Navigate to=\"admin/brands\" replace />} />\n <Route path=\"admin/brands\" element={<AdminBrandsPage />} />\n <Route path=\"admin/collaborations\" element={<AdminCollaborationsPage />} />\n <Route path=\"admin/featured-items\" element={<AdminFeaturedItemsPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAM,IAAiB,QACrB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACrF,EACK,IAAkB,QACtB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACvF,EACK,IAAgB,QACpB,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CACnF,EAGK,IAAsB,QAC1B,OAAO,8CAA2C,MAAM,OAAO,EAC7D,SAAS,EAAE,qBACZ,EAAE,CACJ,EACK,IAAuB,QAC3B,OAAO,+CAA4C,MAAM,OAAO,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AS,kBAAC,GAAD,EAAc,CAAA;KAAI,CAAA;IAChD,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC9D,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAG3D,kBAAC,GAAD;KAAO,MAAK;KAAQ,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAe,SAAA;MAAU,CAAA;KAAI,CAAA;IACvE,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC3D,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA2B,CAAA;KAAI,CAAA;IAC3E,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA0B,CAAA;KAAI,CAAA;IAG1E,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
1
+ {"version":3,"file":"CoolAndLovelyRoutes.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"sourcesContent":["/**\n * CoolAndLovely Routes\n * @module coolandlovely\n *\n * Real fashion-domain routes wired to the live `wspace-coolandlovely-svc`\n * GraphQL contract: overview, brands, collections, style items, looks,\n * collaborations, wardrobe, lookbooks and the shopper's style profile.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useCoolAndLovely } from './context/CoolAndLovelyContext';\n\n// Eager-loaded overview (primary landing page)\nimport { HomePage } from './pages/HomePage';\n\n// Brands\nconst BrandsListPage = lazy(() =>\n import('./pages/brands/BrandsListPage').then((m) => ({ default: m.BrandsListPage }))\n);\nconst BrandDetailPage = lazy(() =>\n import('./pages/brands/BrandDetailPage').then((m) => ({ default: m.BrandDetailPage }))\n);\nconst BrandFormPage = lazy(() =>\n import('./pages/brands/BrandFormPage').then((m) => ({ default: m.BrandFormPage }))\n);\n\n// Collections\nconst CollectionsListPage = lazy(() =>\n import('./pages/collections/CollectionsListPage').then((m) => ({\n default: m.CollectionsListPage,\n }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/collections/CollectionDetailPage').then((m) => ({\n default: m.CollectionDetailPage,\n }))\n);\nconst CollectionFormPage = lazy(() =>\n import('./pages/collections/CollectionFormPage').then((m) => ({ default: m.CollectionFormPage }))\n);\n\n// Style items\nconst StyleItemsListPage = lazy(() =>\n import('./pages/items/StyleItemsListPage').then((m) => ({ default: m.StyleItemsListPage }))\n);\nconst StyleItemDetailPage = lazy(() =>\n import('./pages/items/StyleItemDetailPage').then((m) => ({ default: m.StyleItemDetailPage }))\n);\nconst StyleItemFormPage = lazy(() =>\n import('./pages/items/StyleItemFormPage').then((m) => ({ default: m.StyleItemFormPage }))\n);\n\n// Looks\nconst LooksListPage = lazy(() =>\n import('./pages/looks/LooksListPage').then((m) => ({ default: m.LooksListPage }))\n);\nconst LookDetailPage = lazy(() =>\n import('./pages/looks/LookDetailPage').then((m) => ({ default: m.LookDetailPage }))\n);\nconst LookFormPage = lazy(() =>\n import('./pages/looks/LookFormPage').then((m) => ({ default: m.LookFormPage }))\n);\n\n// Collaborations\nconst CollaborationsListPage = lazy(() =>\n import('./pages/collaborations/CollaborationsListPage').then((m) => ({\n default: m.CollaborationsListPage,\n }))\n);\nconst CollaborationDetailPage = lazy(() =>\n import('./pages/collaborations/CollaborationDetailPage').then((m) => ({\n default: m.CollaborationDetailPage,\n }))\n);\nconst CollaborationFormPage = lazy(() =>\n import('./pages/collaborations/CollaborationFormPage').then((m) => ({\n default: m.CollaborationFormPage,\n }))\n);\n\n// Wardrobe (self-scoped)\nconst WardrobeListPage = lazy(() =>\n import('./pages/wardrobe/WardrobeListPage').then((m) => ({ default: m.WardrobeListPage }))\n);\nconst WardrobeFormPage = lazy(() =>\n import('./pages/wardrobe/WardrobeFormPage').then((m) => ({ default: m.WardrobeFormPage }))\n);\n\n// Lookbooks\nconst LookbooksListPage = lazy(() =>\n import('./pages/lookbooks/LookbooksListPage').then((m) => ({ default: m.LookbooksListPage }))\n);\nconst LookbookDetailPage = lazy(() =>\n import('./pages/lookbooks/LookbookDetailPage').then((m) => ({ default: m.LookbookDetailPage }))\n);\n\n// Style profile (self-scoped)\nconst StyleProfilePage = lazy(() =>\n import('./pages/profile/StyleProfilePage').then((m) => ({ default: m.StyleProfilePage }))\n);\n\n// Discovery + trends (client-side analytics over the real catalogue/social lists)\nconst DiscoverPage = lazy(() =>\n import('./pages/discover/DiscoverPage').then((m) => ({ default: m.DiscoverPage }))\n);\nconst TrendsPage = lazy(() =>\n import('./pages/trends/TrendsPage').then((m) => ({ default: m.TrendsPage }))\n);\n\n// Commerce (BOFF-3370): cart, orders, creator earnings\nconst CartPage = lazy(() =>\n import('./pages/commerce/CartPage').then((m) => ({ default: m.CartPage }))\n);\nconst BrandOrdersPage = lazy(() =>\n import('./pages/commerce/BrandOrdersPage').then((m) => ({ default: m.BrandOrdersPage }))\n);\nconst BrandOrderDetailPage = lazy(() =>\n import('./pages/commerce/BrandOrdersPage').then((m) => ({ default: m.BrandOrderDetailPage }))\n);\nconst OrdersPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrdersPage }))\n);\nconst OrderDetailPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrderDetailPage }))\n);\nconst CreatorEarningsPage = lazy(() =>\n import('./pages/commerce/CreatorEarningsPage').then((m) => ({ default: m.CreatorEarningsPage }))\n);\n\n// Admin curation (gated by the `coolandlovely.admin.curation` feature flag)\nconst AdminBrandsPage = lazy(() =>\n import('./pages/admin/AdminBrandsPage').then((m) => ({ default: m.AdminBrandsPage }))\n);\nconst AdminCollaborationsPage = lazy(() =>\n import('./pages/admin/AdminCollaborationsPage').then((m) => ({\n default: m.AdminCollaborationsPage,\n }))\n);\nconst AdminFeaturedItemsPage = lazy(() =>\n import('./pages/admin/AdminFeaturedItemsPage').then((m) => ({\n default: m.AdminFeaturedItemsPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const CoolAndLovelyRoutes: FC = () => {\n const { basePath, isStandalone } = useCoolAndLovely();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the path matches the basePath (when integrated).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview */}\n <Route index element={<HomePage />} />\n\n {/* Brands */}\n <Route path=\"brands\" element={<BrandsListPage />} />\n <Route path=\"brands/new\" element={<BrandFormPage />} />\n <Route path=\"brands/:brandId\" element={<BrandDetailPage />} />\n <Route path=\"brands/:brandId/edit\" element={<BrandFormPage />} />\n\n {/* Collections */}\n <Route path=\"collections\" element={<CollectionsListPage />} />\n <Route path=\"collections/new\" element={<CollectionFormPage />} />\n <Route path=\"collections/:collectionId\" element={<CollectionDetailPage />} />\n <Route path=\"collections/:collectionId/edit\" element={<CollectionFormPage />} />\n\n {/* Style items */}\n <Route path=\"items\" element={<StyleItemsListPage />} />\n <Route path=\"items/new\" element={<StyleItemFormPage />} />\n <Route path=\"items/:itemId\" element={<StyleItemDetailPage />} />\n <Route path=\"items/:itemId/edit\" element={<StyleItemFormPage />} />\n\n {/* Looks */}\n <Route path=\"looks\" element={<LooksListPage />} />\n <Route path=\"looks/new\" element={<LookFormPage />} />\n <Route path=\"looks/:lookId\" element={<LookDetailPage />} />\n\n {/* Collaborations */}\n <Route path=\"collaborations\" element={<CollaborationsListPage />} />\n <Route path=\"collaborations/new\" element={<CollaborationFormPage />} />\n <Route path=\"collaborations/:collaborationId\" element={<CollaborationDetailPage />} />\n <Route path=\"collaborations/:collaborationId/edit\" element={<CollaborationFormPage />} />\n\n {/* Wardrobe (self-scoped) */}\n <Route path=\"wardrobe\" element={<WardrobeListPage />} />\n <Route path=\"wardrobe/new\" element={<WardrobeFormPage />} />\n\n {/* Lookbooks */}\n <Route path=\"lookbooks\" element={<LookbooksListPage />} />\n <Route path=\"lookbooks/:lookbookId\" element={<LookbookDetailPage />} />\n\n {/* Style profile (self-scoped) + public profiles */}\n <Route path=\"profile\" element={<StyleProfilePage />} />\n <Route path=\"profile/:userId\" element={<StyleProfilePage />} />\n\n {/* Discovery + trends */}\n <Route path=\"discover\" element={<DiscoverPage />} />\n <Route path=\"trends\" element={<TrendsPage />} />\n\n {/* Commerce */}\n <Route path=\"cart\" element={<CartPage />} />\n <Route path=\"orders\" element={<OrdersPage />} />\n <Route path=\"orders/:orderId\" element={<OrderDetailPage />} />\n <Route path=\"earnings\" element={<CreatorEarningsPage />} />\n\n {/* Brand-side orders and fulfilment (BOFF-9636) */}\n <Route path=\"brand-orders\" element={<BrandOrdersPage />} />\n <Route path=\"brand-orders/:brandId/:orderId\" element={<BrandOrderDetailPage />} />\n\n {/* Admin curation */}\n <Route path=\"admin\" element={<Navigate to=\"admin/brands\" replace />} />\n <Route path=\"admin/brands\" element={<AdminBrandsPage />} />\n <Route path=\"admin/collaborations\" element={<AdminCollaborationsPage />} />\n <Route path=\"admin/featured-items\" element={<AdminFeaturedItemsPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAM,IAAiB,QACrB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACrF,EACK,IAAkB,QACtB,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D;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { CooOrderFulfilment } from '../types';
2
+
3
+ /** Timeline of one brand's fulfilment, shared with the shopper's order detail. */
4
+ export declare function FulfilmentTimeline({ fulfilment }: {
5
+ fulfilment: CooOrderFulfilment;
6
+ }): import("react").JSX.Element;
7
+ //# sourceMappingURL=FulfilmentTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FulfilmentTimeline.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/FulfilmentTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,kBAAkB,CAAA;CAAE,+BA+DpF"}
@@ -0,0 +1,77 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { useTr as t } from "../hooks/useTr.js";
3
+ import "../hooks/index.js";
4
+ import { formatDate as n } from "../utils/formatters.js";
5
+ import { CheckCircle2 as r, ExternalLink as i, PackageCheck as a, Truck as o } from "lucide-react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ //#region src/coolandlovely/components/FulfilmentTimeline.tsx
8
+ function l({ fulfilment: l }) {
9
+ let u = t();
10
+ return /* @__PURE__ */ c("div", {
11
+ className: "space-y-3",
12
+ "data-testid": "fulfilment-timeline",
13
+ children: [
14
+ /* @__PURE__ */ s("ol", {
15
+ className: "flex flex-wrap gap-4",
16
+ children: [
17
+ {
18
+ key: "coolandlovely.fulfilment.confirmed",
19
+ label: "Confirmed",
20
+ at: l.confirmedAt,
21
+ icon: r
22
+ },
23
+ {
24
+ key: "coolandlovely.fulfilment.shipped",
25
+ label: "Shipped",
26
+ at: l.shippedAt,
27
+ icon: o
28
+ },
29
+ {
30
+ key: "coolandlovely.fulfilment.delivered",
31
+ label: "Delivered",
32
+ at: l.deliveredAt,
33
+ icon: a
34
+ }
35
+ ].map(({ key: t, label: r, at: i, icon: a }) => /* @__PURE__ */ c("li", {
36
+ className: e("flex items-center gap-1.5 text-sm", i ? "text-text-primary" : "text-text-secondary opacity-60"),
37
+ children: [
38
+ /* @__PURE__ */ s(a, { className: e("h-4 w-4", i && "text-status-success-text") }),
39
+ /* @__PURE__ */ s("span", { children: u(t, r) }),
40
+ i && /* @__PURE__ */ s("span", {
41
+ className: "text-xs text-text-secondary",
42
+ children: n(i)
43
+ })
44
+ ]
45
+ }, t))
46
+ }),
47
+ l.trackingNumber && /* @__PURE__ */ c("p", {
48
+ className: "text-sm text-text-primary",
49
+ children: [
50
+ l.carrier,
51
+ " ·",
52
+ " ",
53
+ /* @__PURE__ */ s("span", {
54
+ className: "font-mono",
55
+ "data-testid": "fulfilment-tracking",
56
+ children: l.trackingNumber
57
+ }),
58
+ l.trackingUrl && /* @__PURE__ */ c("a", {
59
+ href: l.trackingUrl,
60
+ target: "_blank",
61
+ rel: "noopener noreferrer",
62
+ className: "ml-2 inline-flex items-center gap-1 text-accent-primary hover:underline",
63
+ children: [u("coolandlovely.fulfilment.track", "Track parcel"), /* @__PURE__ */ s(i, { className: "h-3 w-3" })]
64
+ })
65
+ ]
66
+ }),
67
+ l.note && /* @__PURE__ */ s("p", {
68
+ className: "whitespace-pre-line text-sm text-text-secondary",
69
+ children: l.note
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { l as FulfilmentTimeline };
76
+
77
+ //# sourceMappingURL=FulfilmentTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FulfilmentTimeline.js","names":[],"sources":["../../../src/coolandlovely/components/FulfilmentTimeline.tsx"],"sourcesContent":["/**\n * Fulfilment timeline (BOFF-9636)\n * @module coolandlovely/components\n *\n * One brand's progress on an order (confirmed, shipped, delivered) with its tracking details.\n * Shown to the brand on its order detail and to the shopper on theirs.\n */\n\nimport { CheckCircle2, ExternalLink, Package, PackageCheck, Truck } from 'lucide-react';\n\nimport { useTr } from '../hooks';\nimport type { CooOrderFulfilment } from '../types';\nimport { cn } from '../utils/cn';\nimport { formatDate } from '../utils/formatters';\n\n/** Timeline of one brand's fulfilment, shared with the shopper's order detail. */\nexport function FulfilmentTimeline({ fulfilment }: { fulfilment: CooOrderFulfilment }) {\n const tr = useTr();\n const steps: Array<{ key: string; label: string; at: string | null; icon: typeof Package }> = [\n {\n key: 'coolandlovely.fulfilment.confirmed',\n label: 'Confirmed',\n at: fulfilment.confirmedAt,\n icon: CheckCircle2,\n },\n {\n key: 'coolandlovely.fulfilment.shipped',\n label: 'Shipped',\n at: fulfilment.shippedAt,\n icon: Truck,\n },\n {\n key: 'coolandlovely.fulfilment.delivered',\n label: 'Delivered',\n at: fulfilment.deliveredAt,\n icon: PackageCheck,\n },\n ];\n return (\n <div className=\"space-y-3\" data-testid=\"fulfilment-timeline\">\n <ol className=\"flex flex-wrap gap-4\">\n {steps.map(({ key, label, at, icon: Icon }) => (\n <li\n key={key}\n className={cn(\n 'flex items-center gap-1.5 text-sm',\n at ? 'text-text-primary' : 'text-text-secondary opacity-60'\n )}\n >\n <Icon className={cn('h-4 w-4', at && 'text-status-success-text')} />\n <span>{tr(key, label)}</span>\n {at && <span className=\"text-xs text-text-secondary\">{formatDate(at)}</span>}\n </li>\n ))}\n </ol>\n {fulfilment.trackingNumber && (\n <p className=\"text-sm text-text-primary\">\n {fulfilment.carrier} ·{' '}\n <span className=\"font-mono\" data-testid=\"fulfilment-tracking\">\n {fulfilment.trackingNumber}\n </span>\n {fulfilment.trackingUrl && (\n <a\n href={fulfilment.trackingUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ml-2 inline-flex items-center gap-1 text-accent-primary hover:underline\"\n >\n {tr('coolandlovely.fulfilment.track', 'Track parcel')}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </p>\n )}\n {fulfilment.note && (\n <p className=\"whitespace-pre-line text-sm text-text-secondary\">{fulfilment.note}</p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,EAAmB,EAAE,iBAAkD;CACrF,IAAM,IAAK,GAAO;AAqBlB,QACE,kBAAC,OAAD;EAAK,WAAU;EAAY,eAAY;YAAvC;GACE,kBAAC,MAAD;IAAI,WAAU;cAtB4E;KAC5F;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACD;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACD;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACF,CAIY,KAAK,EAAE,QAAK,UAAO,OAAI,MAAM,QAClC,kBAAC,MAAD;KAEE,WAAW,EACT,qCACA,IAAK,sBAAsB,iCAC5B;eALH;MAOE,kBAAC,GAAD,EAAM,WAAW,EAAG,WAAW,KAAM,2BAA2B,EAAI,CAAA;MACpE,kBAAC,QAAD,EAAA,UAAO,EAAG,GAAK,EAAM,EAAQ,CAAA;MAC5B,KAAM,kBAAC,QAAD;OAAM,WAAU;iBAA+B,EAAW,EAAG;OAAQ,CAAA;MACzE;OATE,EASF,CACL;IACC,CAAA;GACJ,EAAW,kBACV,kBAAC,KAAD;IAAG,WAAU;cAAb;KACG,EAAW;KAAQ;KAAG;KACvB,kBAAC,QAAD;MAAM,WAAU;MAAY,eAAY;gBACrC,EAAW;MACP,CAAA;KACN,EAAW,eACV,kBAAC,KAAD;MACE,MAAM,EAAW;MACjB,QAAO;MACP,KAAI;MACJ,WAAU;gBAJZ,CAMG,EAAG,kCAAkC,eAAe,EACrD,kBAAC,GAAD,EAAc,WAAU,WAAY,CAAA,CAClC;;KAEJ;;GAEL,EAAW,QACV,kBAAC,KAAD;IAAG,WAAU;cAAmD,EAAW;IAAS,CAAA;GAElF"}
@@ -0,0 +1,8 @@
1
+ import { CooBrandOrder } from '../types';
2
+
3
+ /** Whether the brand can (still) start or retry a refund of this order. */
4
+ export declare function canRefund(order: CooBrandOrder): boolean;
5
+ export declare function RefundPanel({ order }: {
6
+ order: CooBrandOrder;
7
+ }): import("react").JSX.Element;
8
+ //# sourceMappingURL=RefundPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefundPanel.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/RefundPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAc9C,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAIvD;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,+BAwH9D"}
@@ -0,0 +1,113 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { useTr as t } from "../hooks/useTr.js";
3
+ import "../hooks/index.js";
4
+ import { StatusBadge as n } from "./StatusBadge.js";
5
+ import { formatDate as r, formatPrice as i } from "../utils/formatters.js";
6
+ import { TextAreaField as a } from "./Field.js";
7
+ import { useRefundBrandOrder as o } from "../hooks/useBrandOrdersApi.js";
8
+ import { useState as s } from "react";
9
+ import { Loader2 as c, RotateCcw as l } from "lucide-react";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ //#region src/coolandlovely/components/RefundPanel.tsx
12
+ var f = 3, p = 1e3, m = "inline-flex w-full items-center justify-center gap-2 rounded-lg border border-status-error-text px-4 py-2.5 text-sm font-semibold text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-50", h = "inline-flex w-full 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:opacity-50";
13
+ function g(e) {
14
+ let t = e.refund?.status;
15
+ return t === "COMPLETED" || t === "PENDING" ? !1 : e.status === "PAID" || e.status === "PARTIALLY_REFUNDED";
16
+ }
17
+ function _({ order: _ }) {
18
+ let v = t(), y = o(), [b, x] = s(!1), [S, C] = s(""), w = _.refund, T = S.trim(), E = T.length >= f && T.length <= p;
19
+ return /* @__PURE__ */ d("div", {
20
+ className: "space-y-3 border-t border-border-seam pt-4",
21
+ "data-testid": "brand-refund-panel",
22
+ children: [w && /* @__PURE__ */ d("div", {
23
+ className: "space-y-1 text-sm",
24
+ children: [
25
+ /* @__PURE__ */ d("div", {
26
+ className: "flex items-center justify-between",
27
+ children: [/* @__PURE__ */ u("span", {
28
+ className: "text-text-secondary",
29
+ children: v("coolandlovely.refund.label", "Refund")
30
+ }), /* @__PURE__ */ u("span", {
31
+ "data-testid": "brand-refund-status",
32
+ children: /* @__PURE__ */ u(n, { status: w.status })
33
+ })]
34
+ }),
35
+ /* @__PURE__ */ d("div", {
36
+ className: "flex justify-between",
37
+ children: [/* @__PURE__ */ u("span", {
38
+ className: "text-text-secondary",
39
+ children: v("coolandlovely.refund.amount", "Amount")
40
+ }), /* @__PURE__ */ u("span", {
41
+ className: "font-semibold tabular-nums text-text-primary",
42
+ children: i(w.amount, w.currency)
43
+ })]
44
+ }),
45
+ w.refundedAt && /* @__PURE__ */ u("p", {
46
+ className: "text-xs text-text-secondary",
47
+ children: v("coolandlovely.refund.refundedOn", "Refunded {{date}}", { date: r(w.refundedAt) })
48
+ }),
49
+ /* @__PURE__ */ u("p", {
50
+ className: "text-xs text-text-secondary",
51
+ children: v("coolandlovely.refund.reasonShown", "Reason: {{reason}}", { reason: w.reason })
52
+ }),
53
+ w.status === "PENDING" && /* @__PURE__ */ u("p", {
54
+ className: "text-xs text-status-warning-text",
55
+ children: v("coolandlovely.refund.pendingHint", "The refund is being processed with the payment provider. Refresh in a moment.")
56
+ }),
57
+ w.status === "FAILED" && w.failureReason && /* @__PURE__ */ u("p", {
58
+ className: "text-xs text-status-error-text",
59
+ children: w.failureReason
60
+ })
61
+ ]
62
+ }), g(_) && (b ? /* @__PURE__ */ d("div", {
63
+ className: "space-y-3",
64
+ children: [
65
+ /* @__PURE__ */ u("p", {
66
+ className: "text-sm text-text-secondary",
67
+ children: v("coolandlovely.refund.explain", "Refunds {{amount}} plus its share of tax to the shopper, for all of your pieces in this order. Creator commissions on them are reversed. This cannot be undone.", { amount: i(_.brandSubtotal, _.currency) })
68
+ }),
69
+ /* @__PURE__ */ u(a, {
70
+ id: "coo-refund-reason",
71
+ label: v("coolandlovely.refund.reason", "Reason (shown to the shopper)"),
72
+ value: S,
73
+ onChange: C,
74
+ rows: 3
75
+ }),
76
+ y.error && /* @__PURE__ */ u("p", {
77
+ className: "text-sm text-status-error-text",
78
+ role: "alert",
79
+ children: y.error.message
80
+ }),
81
+ /* @__PURE__ */ d("button", {
82
+ type: "button",
83
+ disabled: y.isPending || !E,
84
+ onClick: () => y.mutate({
85
+ brandId: _.brandId,
86
+ orderId: _.id,
87
+ reason: T
88
+ }, { onSuccess: () => x(!1) }),
89
+ className: m,
90
+ "data-testid": "brand-refund-confirm",
91
+ children: [y.isPending ? /* @__PURE__ */ u(c, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ u(l, { className: "h-4 w-4" }), v("coolandlovely.refund.confirm", "Refund my pieces")]
92
+ }),
93
+ /* @__PURE__ */ u("button", {
94
+ type: "button",
95
+ disabled: y.isPending,
96
+ onClick: () => x(!1),
97
+ className: h,
98
+ children: v("coolandlovely.common.cancel", "Cancel")
99
+ })
100
+ ]
101
+ }) : /* @__PURE__ */ d("button", {
102
+ type: "button",
103
+ onClick: () => x(!0),
104
+ className: e(h),
105
+ "data-testid": "brand-refund-open",
106
+ children: [/* @__PURE__ */ u(l, { className: "h-4 w-4" }), w?.status === "FAILED" ? v("coolandlovely.refund.retry", "Retry refund") : v("coolandlovely.refund.start", "Refund this order")]
107
+ }))]
108
+ });
109
+ }
110
+ //#endregion
111
+ export { _ as RefundPanel };
112
+
113
+ //# sourceMappingURL=RefundPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefundPanel.js","names":[],"sources":["../../../src/coolandlovely/components/RefundPanel.tsx"],"sourcesContent":["/**\n * Brand refund panel (BOFF-9702)\n * @module coolandlovely/components\n *\n * On the brand's order detail: refund all of the brand's pieces of the order to the shopper\n * (`cooRefundBrandOrder`), or see the refund once it exists. The money goes back through\n * global-billing to the shopper's original payment method, and the creator commissions on the\n * refunded pieces are reversed while they are still unpaid.\n */\n\nimport { useState } from 'react';\nimport { Loader2, RotateCcw } from 'lucide-react';\n\nimport { useTr } from '../hooks';\nimport { useRefundBrandOrder } from '../hooks/useBrandOrdersApi';\nimport type { CooBrandOrder } from '../types';\nimport { cn } from '../utils/cn';\nimport { formatDate, formatPrice } from '../utils/formatters';\nimport { TextAreaField } from './Field';\nimport { StatusBadge } from './StatusBadge';\n\nconst MIN_REASON = 3;\nconst MAX_REASON = 1000;\n\nconst dangerButton =\n 'inline-flex w-full items-center justify-center gap-2 rounded-lg border border-status-error-text px-4 py-2.5 text-sm font-semibold text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-50';\nconst secondaryButton =\n 'inline-flex w-full 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:opacity-50';\n\n/** Whether the brand can (still) start or retry a refund of this order. */\nexport function canRefund(order: CooBrandOrder): boolean {\n const status = order.refund?.status;\n if (status === 'COMPLETED' || status === 'PENDING') return false;\n return order.status === 'PAID' || order.status === 'PARTIALLY_REFUNDED';\n}\n\nexport function RefundPanel({ order }: { order: CooBrandOrder }) {\n const tr = useTr();\n const refund = useRefundBrandOrder();\n const [open, setOpen] = useState(false);\n const [reason, setReason] = useState('');\n const existing = order.refund;\n const trimmed = reason.trim();\n const reasonValid = trimmed.length >= MIN_REASON && trimmed.length <= MAX_REASON;\n\n return (\n <div className=\"space-y-3 border-t border-border-seam pt-4\" data-testid=\"brand-refund-panel\">\n {existing && (\n <div className=\"space-y-1 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">\n {tr('coolandlovely.refund.label', 'Refund')}\n </span>\n <span data-testid=\"brand-refund-status\">\n <StatusBadge status={existing.status} />\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">\n {tr('coolandlovely.refund.amount', 'Amount')}\n </span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {formatPrice(existing.amount, existing.currency)}\n </span>\n </div>\n {existing.refundedAt && (\n <p className=\"text-xs text-text-secondary\">\n {tr('coolandlovely.refund.refundedOn', 'Refunded {{date}}', {\n date: formatDate(existing.refundedAt),\n })}\n </p>\n )}\n <p className=\"text-xs text-text-secondary\">\n {tr('coolandlovely.refund.reasonShown', 'Reason: {{reason}}', {\n reason: existing.reason,\n })}\n </p>\n {existing.status === 'PENDING' && (\n <p className=\"text-xs text-status-warning-text\">\n {tr(\n 'coolandlovely.refund.pendingHint',\n 'The refund is being processed with the payment provider. Refresh in a moment.'\n )}\n </p>\n )}\n {existing.status === 'FAILED' && existing.failureReason && (\n <p className=\"text-xs text-status-error-text\">{existing.failureReason}</p>\n )}\n </div>\n )}\n\n {canRefund(order) &&\n (open ? (\n <div className=\"space-y-3\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'coolandlovely.refund.explain',\n 'Refunds {{amount}} plus its share of tax to the shopper, for all of your pieces in this order. Creator commissions on them are reversed. This cannot be undone.',\n { amount: formatPrice(order.brandSubtotal, order.currency) }\n )}\n </p>\n <TextAreaField\n id=\"coo-refund-reason\"\n label={tr('coolandlovely.refund.reason', 'Reason (shown to the shopper)')}\n value={reason}\n onChange={setReason}\n rows={3}\n />\n {refund.error && (\n <p className=\"text-sm text-status-error-text\" role=\"alert\">\n {refund.error.message}\n </p>\n )}\n <button\n type=\"button\"\n disabled={refund.isPending || !reasonValid}\n onClick={() =>\n refund.mutate(\n { brandId: order.brandId, orderId: order.id, reason: trimmed },\n { onSuccess: () => setOpen(false) }\n )\n }\n className={dangerButton}\n data-testid=\"brand-refund-confirm\"\n >\n {refund.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <RotateCcw className=\"h-4 w-4\" />\n )}\n {tr('coolandlovely.refund.confirm', 'Refund my pieces')}\n </button>\n <button\n type=\"button\"\n disabled={refund.isPending}\n onClick={() => setOpen(false)}\n className={secondaryButton}\n >\n {tr('coolandlovely.common.cancel', 'Cancel')}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n className={cn(secondaryButton)}\n data-testid=\"brand-refund-open\"\n >\n <RotateCcw className=\"h-4 w-4\" />\n {existing?.status === 'FAILED'\n ? tr('coolandlovely.refund.retry', 'Retry refund')\n : tr('coolandlovely.refund.start', 'Refund this order')}\n </button>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqBA,IAAM,IAAa,GACb,IAAa,KAEb,IACJ,kOACI,IACJ;AAGF,SAAgB,EAAU,GAA+B;CACvD,IAAM,IAAS,EAAM,QAAQ;AAE7B,QADI,MAAW,eAAe,MAAW,YAAkB,KACpD,EAAM,WAAW,UAAU,EAAM,WAAW;;AAGrD,SAAgB,EAAY,EAAE,YAAmC;CAC/D,IAAM,IAAK,GAAO,EACZ,IAAS,GAAqB,EAC9B,CAAC,GAAM,KAAW,EAAS,GAAM,EACjC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,IAAW,EAAM,QACjB,IAAU,EAAO,MAAM,EACvB,IAAc,EAAQ,UAAU,KAAc,EAAQ,UAAU;AAEtE,QACE,kBAAC,OAAD;EAAK,WAAU;EAA6C,eAAY;YAAxE,CACG,KACC,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAG,8BAA8B,SAAS;MACtC,CAAA,EACP,kBAAC,QAAD;MAAM,eAAY;gBAChB,kBAAC,GAAD,EAAa,QAAQ,EAAS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AAD,EAAS,WAAU,wBAAyB,CAAA,GAE5C,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA,EAElC,EAAG,gCAAgC,mBAAmB,CAChD;;IACT,kBAAC,UAAD;KACE,MAAK;KACL,UAAU,EAAO;KACjB,eAAe,EAAQ,GAAM;KAC7B,WAAW;eAEV,EAAG,+BAA+B,SAAS;KACrC,CAAA;IACL;OAEN,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,GAAK;GAC5B,WAAW,EAAG,EAAgB;GAC9B,eAAY;aAJd,CAME,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA,EAChC,GAAU,WAAW,WAClB,EAAG,8BAA8B,eAAe,GAChD,EAAG,8BAA8B,oBAAoB,CAClD;MAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4GD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2B5C,CAAC"}
1
+ {"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgID,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2B5C,CAAC"}
@@ -45,6 +45,14 @@ var i = {
45
45
  paid: "success",
46
46
  pending: "secondary",
47
47
  synced: "success",
48
+ unfulfilled: "warning",
49
+ confirmed: "info",
50
+ shipped: "info",
51
+ delivered: "success",
52
+ partially_refunded: "warning",
53
+ refunded: "outline",
54
+ reversed: "outline",
55
+ not_reversible: "warning",
48
56
  inactive: "secondary",
49
57
  error: "destructive",
50
58
  failed: "destructive",
@@ -81,7 +89,15 @@ var i = {
81
89
  inactive: "coolandlovely.status.inactive",
82
90
  error: "coolandlovely.status.error",
83
91
  failed: "coolandlovely.status.failed",
84
- completed: "coolandlovely.status.completed"
92
+ completed: "coolandlovely.status.completed",
93
+ unfulfilled: "coolandlovely.status.unfulfilled",
94
+ confirmed: "coolandlovely.status.confirmed",
95
+ shipped: "coolandlovely.status.shipped",
96
+ delivered: "coolandlovely.status.delivered",
97
+ partially_refunded: "coolandlovely.status.partiallyRefunded",
98
+ refunded: "coolandlovely.status.refunded",
99
+ reversed: "coolandlovely.status.reversed",
100
+ not_reversible: "coolandlovely.status.notReversible"
85
101
  };
86
102
  function l(e) {
87
103
  return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module coolandlovely/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-accent-blue-subtle text-accent-blue',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-accent-blue',\n outline: 'bg-text-secondary',\n};\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Brand lifecycle\n draft: 'secondary',\n pending_review: 'warning',\n published: 'success',\n suspended: 'destructive',\n archived: 'outline',\n\n // Collection lifecycle\n scheduled: 'info',\n live: 'success',\n ended: 'outline',\n\n // Style item status\n active: 'success',\n out_of_stock: 'warning',\n retired: 'outline',\n\n // Collaboration lifecycle\n proposed: 'secondary',\n accepted: 'info',\n in_progress: 'warning',\n declined: 'destructive',\n cancelled: 'destructive',\n\n // Visibility\n public: 'success',\n followers: 'info',\n private: 'secondary',\n\n // Wardrobe source\n owned: 'success',\n wishlist: 'info',\n purchased_on_platform: 'success',\n gifted: 'warning',\n\n // Orders + creator commissions (BOFF-3370)\n pending_payment: 'warning',\n paid: 'success',\n pending: 'secondary',\n synced: 'success',\n\n // Generic\n inactive: 'secondary',\n error: 'destructive',\n failed: 'destructive',\n completed: 'success',\n};\n\n/** Statuses that represent a live/active state get a calm opacity pulse on the dot. */\nconst liveStatuses = new Set(['live', 'published', 'active', 'in_progress']);\n\nconst STATUS_LABEL_KEYS: Record<string, string> = {\n draft: 'coolandlovely.status.draft',\n pending_review: 'coolandlovely.status.pendingReview',\n published: 'coolandlovely.status.published',\n suspended: 'coolandlovely.status.suspended',\n archived: 'coolandlovely.status.archived',\n scheduled: 'coolandlovely.status.scheduled',\n live: 'coolandlovely.status.live',\n ended: 'coolandlovely.status.ended',\n active: 'coolandlovely.status.active',\n out_of_stock: 'coolandlovely.status.outOfStock',\n retired: 'coolandlovely.status.retired',\n proposed: 'coolandlovely.status.proposed',\n accepted: 'coolandlovely.status.accepted',\n in_progress: 'coolandlovely.status.inProgress',\n declined: 'coolandlovely.status.declined',\n cancelled: 'coolandlovely.status.cancelled',\n public: 'coolandlovely.status.public',\n followers: 'coolandlovely.status.followers',\n private: 'coolandlovely.status.private',\n owned: 'coolandlovely.status.owned',\n wishlist: 'coolandlovely.status.wishlist',\n purchased_on_platform: 'coolandlovely.status.purchasedOnPlatform',\n gifted: 'coolandlovely.status.gifted',\n inactive: 'coolandlovely.status.inactive',\n error: 'coolandlovely.status.error',\n failed: 'coolandlovely.status.failed',\n completed: 'coolandlovely.status.completed',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const key = status.toLowerCase();\n const variant = statusVariantMap[key] || 'secondary';\n const isLive = liveStatuses.has(key);\n const labelKey = STATUS_LABEL_KEYS[key];\n const label = labelKey ? tr(labelKey, formatStatusLabel(status)) : formatStatusLabel(status);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full',\n dotStyles[variant],\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAmBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAA0C;CAC9C,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAAiD;CAErD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CAGV,WAAW;CACX,MAAM;CACN,OAAO;CAGP,QAAQ;CACR,cAAc;CACd,SAAS;CAGT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,WAAW;CACX,SAAS;CAGT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CAGR,iBAAiB;CACjB,MAAM;CACN,SAAS;CACT,QAAQ;CAGR,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACZ,EAGK,IAAe,IAAI,IAAI;CAAC;CAAQ;CAAa;CAAU;CAAc,CAAC,EAEtE,IAA4C;CAChD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,WAAW;CACX,MAAM;CACN,OAAO;CACP,QAAQ;CACR,cAAc;CACd,SAAS;CACT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CACX,QAAQ;CACR,WAAW;CACX,SAAS;CACT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CACR,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACZ;AAED,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAS,EAAK,aAAa,CAAC;;AAGjF,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAK,GAAO,EACZ,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI,EAC9B,IAAW,EAAkB,IAC7B,IAAQ,IAAW,EAAG,GAAU,EAAkB,EAAO,CAAC,GAAG,EAAkB,EAAO;AAE5F,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,4BACA,EAAU,IACV,KAAU,oCACX;GACD,CAAA,EACD,EACI"}
1
+ {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module coolandlovely/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-accent-blue-subtle text-accent-blue',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-accent-blue',\n outline: 'bg-text-secondary',\n};\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Brand lifecycle\n draft: 'secondary',\n pending_review: 'warning',\n published: 'success',\n suspended: 'destructive',\n archived: 'outline',\n\n // Collection lifecycle\n scheduled: 'info',\n live: 'success',\n ended: 'outline',\n\n // Style item status\n active: 'success',\n out_of_stock: 'warning',\n retired: 'outline',\n\n // Collaboration lifecycle\n proposed: 'secondary',\n accepted: 'info',\n in_progress: 'warning',\n declined: 'destructive',\n cancelled: 'destructive',\n\n // Visibility\n public: 'success',\n followers: 'info',\n private: 'secondary',\n\n // Wardrobe source\n owned: 'success',\n wishlist: 'info',\n purchased_on_platform: 'success',\n gifted: 'warning',\n\n // Orders + creator commissions (BOFF-3370)\n pending_payment: 'warning',\n paid: 'success',\n pending: 'secondary',\n synced: 'success',\n\n // Brand fulfilment (BOFF-9636)\n unfulfilled: 'warning',\n confirmed: 'info',\n shipped: 'info',\n delivered: 'success',\n\n // Refunds and commission reversal (BOFF-9702)\n partially_refunded: 'warning',\n refunded: 'outline',\n reversed: 'outline',\n not_reversible: 'warning',\n\n // Generic\n inactive: 'secondary',\n error: 'destructive',\n failed: 'destructive',\n completed: 'success',\n};\n\n/** Statuses that represent a live/active state get a calm opacity pulse on the dot. */\nconst liveStatuses = new Set(['live', 'published', 'active', 'in_progress']);\n\nconst STATUS_LABEL_KEYS: Record<string, string> = {\n draft: 'coolandlovely.status.draft',\n pending_review: 'coolandlovely.status.pendingReview',\n published: 'coolandlovely.status.published',\n suspended: 'coolandlovely.status.suspended',\n archived: 'coolandlovely.status.archived',\n scheduled: 'coolandlovely.status.scheduled',\n live: 'coolandlovely.status.live',\n ended: 'coolandlovely.status.ended',\n active: 'coolandlovely.status.active',\n out_of_stock: 'coolandlovely.status.outOfStock',\n retired: 'coolandlovely.status.retired',\n proposed: 'coolandlovely.status.proposed',\n accepted: 'coolandlovely.status.accepted',\n in_progress: 'coolandlovely.status.inProgress',\n declined: 'coolandlovely.status.declined',\n cancelled: 'coolandlovely.status.cancelled',\n public: 'coolandlovely.status.public',\n followers: 'coolandlovely.status.followers',\n private: 'coolandlovely.status.private',\n owned: 'coolandlovely.status.owned',\n wishlist: 'coolandlovely.status.wishlist',\n purchased_on_platform: 'coolandlovely.status.purchasedOnPlatform',\n gifted: 'coolandlovely.status.gifted',\n inactive: 'coolandlovely.status.inactive',\n error: 'coolandlovely.status.error',\n failed: 'coolandlovely.status.failed',\n completed: 'coolandlovely.status.completed',\n unfulfilled: 'coolandlovely.status.unfulfilled',\n confirmed: 'coolandlovely.status.confirmed',\n shipped: 'coolandlovely.status.shipped',\n delivered: 'coolandlovely.status.delivered',\n partially_refunded: 'coolandlovely.status.partiallyRefunded',\n refunded: 'coolandlovely.status.refunded',\n reversed: 'coolandlovely.status.reversed',\n not_reversible: 'coolandlovely.status.notReversible',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const key = status.toLowerCase();\n const variant = statusVariantMap[key] || 'secondary';\n const isLive = liveStatuses.has(key);\n const labelKey = STATUS_LABEL_KEYS[key];\n const label = labelKey ? tr(labelKey, formatStatusLabel(status)) : formatStatusLabel(status);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full',\n dotStyles[variant],\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAmBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAA0C;CAC9C,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAAiD;CAErD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CAGV,WAAW;CACX,MAAM;CACN,OAAO;CAGP,QAAQ;CACR,cAAc;CACd,SAAS;CAGT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,WAAW;CACX,SAAS;CAGT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CAGR,iBAAiB;CACjB,MAAM;CACN,SAAS;CACT,QAAQ;CAGR,aAAa;CACb,WAAW;CACX,SAAS;CACT,WAAW;CAGX,oBAAoB;CACpB,UAAU;CACV,UAAU;CACV,gBAAgB;CAGhB,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACZ,EAGK,IAAe,IAAI,IAAI;CAAC;CAAQ;CAAa;CAAU;CAAc,CAAC,EAEtE,IAA4C;CAChD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,WAAW;CACX,MAAM;CACN,OAAO;CACP,QAAQ;CACR,cAAc;CACd,SAAS;CACT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CACX,QAAQ;CACR,WAAW;CACX,SAAS;CACT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CACR,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACX,aAAa;CACb,WAAW;CACX,SAAS;CACT,WAAW;CACX,oBAAoB;CACpB,UAAU;CACV,UAAU;CACV,gBAAgB;CACjB;AAED,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAS,EAAK,aAAa,CAAC;;AAGjF,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAK,GAAO,EACZ,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI,EAC9B,IAAW,EAAkB,IAC7B,IAAQ,IAAW,EAAG,GAAU,EAAkB,EAAO,CAAC,GAAG,EAAkB,EAAO;AAE5F,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,4BACA,EAAU,IACV,KAAU,oCACX;GACD,CAAA,EACD,EACI"}
@@ -0,0 +1,12 @@
1
+ import { CooBrandOrder, CooBrandOrderConnection, CooBrandOrderSummary, CooFulfilmentStatus, CooRefundBrandOrderInput, CooUpdateOrderFulfilmentInput } from '../types';
2
+
3
+ export declare const useBrandOrders: (brandId: string | undefined, fulfilmentStatus?: CooFulfilmentStatus) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrderConnection>, Error>;
4
+ export declare const useBrandOrderSummary: (brandId: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrderSummary>, Error>;
5
+ export declare const useBrandOrder: (brandId: string | undefined, id: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrder | null>, Error>;
6
+ export declare const useUpdateOrderFulfilment: () => import('@tanstack/react-query').UseMutationResult<CooBrandOrder, Error, CooUpdateOrderFulfilmentInput, unknown>;
7
+ /**
8
+ * Refund the brand's pieces of an order (BOFF-9702). global-billing returns the money to the
9
+ * shopper, and the creator commissions on the refunded lines are reversed.
10
+ */
11
+ export declare const useRefundBrandOrder: () => import('@tanstack/react-query').UseMutationResult<CooBrandOrder, Error, CooRefundBrandOrderInput, unknown>;
12
+ //# sourceMappingURL=useBrandOrdersApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBrandOrdersApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useBrandOrdersApi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAiBlB,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,GAAG,SAAS,EAC3B,mBAAmB,mBAAmB,4FAoBvC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,GAAG,SAAS,yFAkB/D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,GAAG,SAAS,EAAE,IAAI,MAAM,GAAG,SAAS,yFAchF,CAAC;AAEF,eAAO,MAAM,wBAAwB,uHAoBpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,kHA0B/B,CAAC"}