@burdenoff/microfe-coolandlovely 2026.1024.2 → 2026.1024.3
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/CoolAndLovelyRoot.d.ts +5 -0
- package/dist/coolandlovely/CoolAndLovelyRoot.d.ts.map +1 -0
- package/dist/coolandlovely/CoolAndLovelyRoot.js +92 -68
- package/dist/coolandlovely/CoolAndLovelyRoot.js.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts +4 -0
- package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -0
- package/dist/coolandlovely/CoolAndLovelyRoutes.js +25 -9
- package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
- package/dist/coolandlovely/components/ActivityTrail.d.ts +24 -0
- package/dist/coolandlovely/components/ActivityTrail.d.ts.map +1 -0
- package/dist/coolandlovely/components/ActorName.d.ts +14 -0
- package/dist/coolandlovely/components/ActorName.d.ts.map +1 -0
- package/dist/coolandlovely/components/AddToCartPanel.d.ts +10 -0
- package/dist/coolandlovely/components/AddToCartPanel.d.ts.map +1 -0
- package/dist/coolandlovely/components/AddToCartPanel.js +97 -0
- package/dist/coolandlovely/components/AddToCartPanel.js.map +1 -0
- package/dist/coolandlovely/components/AddToLookbookButton.d.ts +10 -0
- package/dist/coolandlovely/components/AddToLookbookButton.d.ts.map +1 -0
- package/dist/coolandlovely/components/BrandCard.d.ts +11 -0
- package/dist/coolandlovely/components/BrandCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/BrandCover.d.ts +17 -0
- package/dist/coolandlovely/components/BrandCover.d.ts.map +1 -0
- package/dist/coolandlovely/components/BrandCreatorAvatars.d.ts +14 -0
- package/dist/coolandlovely/components/BrandCreatorAvatars.d.ts.map +1 -0
- package/dist/coolandlovely/components/CollectionCard.d.ts +11 -0
- package/dist/coolandlovely/components/CollectionCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/ColourSwatchRow.d.ts +11 -0
- package/dist/coolandlovely/components/ColourSwatchRow.d.ts.map +1 -0
- package/dist/coolandlovely/components/Comments.d.ts +14 -0
- package/dist/coolandlovely/components/Comments.d.ts.map +1 -0
- package/dist/coolandlovely/components/EmptyState.d.ts +14 -0
- package/dist/coolandlovely/components/EmptyState.d.ts.map +1 -0
- package/dist/coolandlovely/components/FeedbackWidget.d.ts +4 -0
- package/dist/coolandlovely/components/FeedbackWidget.d.ts.map +1 -0
- package/dist/coolandlovely/components/Field.d.ts +71 -0
- package/dist/coolandlovely/components/Field.d.ts.map +1 -0
- package/dist/coolandlovely/components/FileImage.d.ts +10 -0
- package/dist/coolandlovely/components/FileImage.d.ts.map +1 -0
- package/dist/coolandlovely/components/FollowButton.d.ts +11 -0
- package/dist/coolandlovely/components/FollowButton.d.ts.map +1 -0
- package/dist/coolandlovely/components/ImageUploadField.d.ts +21 -0
- package/dist/coolandlovely/components/ImageUploadField.d.ts.map +1 -0
- package/dist/coolandlovely/components/LookCard.d.ts +19 -0
- package/dist/coolandlovely/components/LookCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/LookbookCard.d.ts +11 -0
- package/dist/coolandlovely/components/LookbookCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/MetricsCard.d.ts +23 -0
- package/dist/coolandlovely/components/MetricsCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/PageLayout.d.ts +17 -0
- package/dist/coolandlovely/components/PageLayout.d.ts.map +1 -0
- package/dist/coolandlovely/components/PayForOrder.d.ts +11 -0
- package/dist/coolandlovely/components/PayForOrder.d.ts.map +1 -0
- package/dist/coolandlovely/components/PayForOrder.js +118 -0
- package/dist/coolandlovely/components/PayForOrder.js.map +1 -0
- package/dist/coolandlovely/components/ShopItemCard.d.ts +15 -0
- package/dist/coolandlovely/components/ShopItemCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/StateViews.d.ts +16 -0
- package/dist/coolandlovely/components/StateViews.d.ts.map +1 -0
- package/dist/coolandlovely/components/StatusBadge.d.ts +9 -0
- package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -0
- package/dist/coolandlovely/components/StatusBadge.js +4 -0
- package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
- package/dist/coolandlovely/components/StepTracker.d.ts +12 -0
- package/dist/coolandlovely/components/StepTracker.d.ts.map +1 -0
- package/dist/coolandlovely/components/TagList.d.ts +12 -0
- package/dist/coolandlovely/components/TagList.d.ts.map +1 -0
- package/dist/coolandlovely/components/Thumbnail.d.ts +23 -0
- package/dist/coolandlovely/components/Thumbnail.d.ts.map +1 -0
- package/dist/coolandlovely/components/VisibilityChip.d.ts +10 -0
- package/dist/coolandlovely/components/VisibilityChip.d.ts.map +1 -0
- package/dist/coolandlovely/components/WardrobeItemCard.d.ts +14 -0
- package/dist/coolandlovely/components/WardrobeItemCard.d.ts.map +1 -0
- package/dist/coolandlovely/components/index.d.ts +32 -0
- package/dist/coolandlovely/components/index.d.ts.map +1 -0
- package/dist/coolandlovely/context/CoolAndLovelyContext.d.ts +16 -0
- package/dist/coolandlovely/context/CoolAndLovelyContext.d.ts.map +1 -0
- package/dist/coolandlovely/context/index.d.ts +6 -0
- package/dist/coolandlovely/context/index.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/index.d.ts +15 -0
- package/dist/coolandlovely/hooks/index.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useActivity.d.ts +39 -0
- package/dist/coolandlovely/hooks/useActivity.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useAssistantEntity.d.ts +24 -0
- package/dist/coolandlovely/hooks/useAssistantEntity.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useComments.d.ts +37 -0
- package/dist/coolandlovely/hooks/useComments.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts +27 -0
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useCommerceApi.js +121 -0
- package/dist/coolandlovely/hooks/useCommerceApi.js.map +1 -0
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts +178 -0
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js.map +1 -1
- package/dist/coolandlovely/hooks/useFiles.d.ts +62 -0
- package/dist/coolandlovely/hooks/useFiles.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useTr.d.ts +2 -0
- package/dist/coolandlovely/hooks/useTr.d.ts.map +1 -0
- package/dist/coolandlovely/index.d.ts +11 -0
- package/dist/coolandlovely/index.d.ts.map +1 -0
- package/dist/coolandlovely/pages/HomePage.d.ts +10 -0
- package/dist/coolandlovely/pages/HomePage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/admin/AdminBrandsPage.d.ts +9 -0
- package/dist/coolandlovely/pages/admin/AdminBrandsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.d.ts +9 -0
- package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.d.ts +9 -0
- package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/admin/index.d.ts +8 -0
- package/dist/coolandlovely/pages/admin/index.d.ts.map +1 -0
- package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts +9 -0
- package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/brands/BrandFormPage.d.ts +9 -0
- package/dist/coolandlovely/pages/brands/BrandFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts +9 -0
- package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.d.ts +9 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.d.ts +11 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts +9 -0
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collections/CollectionDetailPage.d.ts +9 -0
- package/dist/coolandlovely/pages/collections/CollectionDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collections/CollectionFormPage.d.ts +9 -0
- package/dist/coolandlovely/pages/collections/CollectionFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts +8 -0
- package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/CartPage.d.ts +10 -0
- package/dist/coolandlovely/pages/commerce/CartPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/CartPage.js +283 -0
- package/dist/coolandlovely/pages/commerce/CartPage.js.map +1 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts +11 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js +185 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js.map +1 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts +11 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.js +280 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.js.map +1 -0
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts +14 -0
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.d.ts +9 -0
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +114 -106
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemFormPage.d.ts +10 -0
- package/dist/coolandlovely/pages/items/StyleItemFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts +9 -0
- package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.d.ts +12 -0
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts +10 -0
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/looks/LookDetailPage.d.ts +11 -0
- package/dist/coolandlovely/pages/looks/LookDetailPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/looks/LookDetailPage.js +1 -1
- package/dist/coolandlovely/pages/looks/LookDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LookFormPage.d.ts +10 -0
- package/dist/coolandlovely/pages/looks/LookFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/looks/LooksListPage.d.ts +9 -0
- package/dist/coolandlovely/pages/looks/LooksListPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts +17 -0
- package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/trends/TrendsPage.d.ts +11 -0
- package/dist/coolandlovely/pages/trends/TrendsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.d.ts +10 -0
- package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts +12 -0
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts.map +1 -0
- package/dist/coolandlovely/store/coolandlovelyStore.d.ts +56 -0
- package/dist/coolandlovely/store/coolandlovelyStore.d.ts.map +1 -0
- package/dist/coolandlovely/store/index.d.ts +6 -0
- package/dist/coolandlovely/store/index.d.ts.map +1 -0
- package/dist/coolandlovely/types/commerce.d.ts +137 -0
- package/dist/coolandlovely/types/commerce.d.ts.map +1 -0
- package/dist/coolandlovely/types/index.d.ts +527 -0
- package/dist/coolandlovely/types/index.d.ts.map +1 -0
- package/dist/coolandlovely/utils/cn.d.ts +4 -0
- package/dist/coolandlovely/utils/cn.d.ts.map +1 -0
- package/dist/coolandlovely/utils/formatters.d.ts +101 -0
- package/dist/coolandlovely/utils/formatters.d.ts.map +1 -0
- package/dist/coolandlovely/utils/icons.d.ts +6 -0
- package/dist/coolandlovely/utils/icons.d.ts.map +1 -0
- package/dist/coolandlovely/utils/index.d.ts +10 -0
- package/dist/coolandlovely/utils/index.d.ts.map +1 -0
- package/dist/coolandlovely/utils/navigation.d.ts +20 -0
- package/dist/coolandlovely/utils/navigation.d.ts.map +1 -0
- package/dist/coolandlovely/utils/paymentProviders.d.ts +74 -0
- package/dist/coolandlovely/utils/paymentProviders.d.ts.map +1 -0
- package/dist/coolandlovely/utils/paymentProviders.js +42 -0
- package/dist/coolandlovely/utils/paymentProviders.js.map +1 -0
- package/dist/coolandlovely/utils/sparkline.d.ts +31 -0
- package/dist/coolandlovely/utils/sparkline.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +23527 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +57851 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/services/createSandboxAssistantTransport.d.ts +24 -0
- package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -0
- package/dist/stories/BrandCard.stories.d.ts +10 -0
- package/dist/stories/BrandCard.stories.d.ts.map +1 -0
- package/dist/stories/CollectionCard.stories.d.ts +10 -0
- package/dist/stories/CollectionCard.stories.d.ts.map +1 -0
- package/dist/stories/DiscoverPage.stories.d.ts +11 -0
- package/dist/stories/DiscoverPage.stories.d.ts.map +1 -0
- package/dist/stories/FeedbackWidget.stories.d.ts +9 -0
- package/dist/stories/FeedbackWidget.stories.d.ts.map +1 -0
- package/dist/stories/LookCard.stories.d.ts +10 -0
- package/dist/stories/LookCard.stories.d.ts.map +1 -0
- package/dist/stories/LookbookCard.stories.d.ts +10 -0
- package/dist/stories/LookbookCard.stories.d.ts.map +1 -0
- package/dist/stories/MetricsCard.stories.d.ts +10 -0
- package/dist/stories/MetricsCard.stories.d.ts.map +1 -0
- package/dist/stories/ShopItemCard.stories.d.ts +9 -0
- package/dist/stories/ShopItemCard.stories.d.ts.map +1 -0
- package/dist/stories/StatusBadge.stories.d.ts +11 -0
- package/dist/stories/StatusBadge.stories.d.ts.map +1 -0
- package/dist/stories/VisibilityChip.stories.d.ts +10 -0
- package/dist/stories/VisibilityChip.stories.d.ts.map +1 -0
- package/dist/stories/WardrobeItemCard.stories.d.ts +11 -0
- package/dist/stories/WardrobeItemCard.stories.d.ts.map +1 -0
- package/dist/stories/__fixtures__/coolandlovely.d.ts +15 -0
- package/dist/stories/__fixtures__/coolandlovely.d.ts.map +1 -0
- package/dist/utils/pageContext.d.ts +58 -0
- package/dist/utils/pageContext.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import "../hooks/index.js";
|
|
3
|
+
import { formatPrice as t } from "../utils/formatters.js";
|
|
4
|
+
import { loadStripe as n, openRazorpayCheckout as r } from "../utils/paymentProviders.js";
|
|
5
|
+
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { CreditCard as s, Loader2 as c, Lock as l } from "lucide-react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
//#region src/coolandlovely/components/PayForOrder.tsx
|
|
9
|
+
var f = "inline-flex items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50";
|
|
10
|
+
function p(e) {
|
|
11
|
+
return window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || void 0;
|
|
12
|
+
}
|
|
13
|
+
var m = ({ checkout: r, onSettle: s, publishableKey: m, clientSecret: h }) => {
|
|
14
|
+
let g = e(), _ = a(null), v = a(null), y = a(null), [b, x] = o(!1), [S, C] = o(!1), [w, T] = o(!1), [E, D] = o(null);
|
|
15
|
+
i(() => {
|
|
16
|
+
let e = !1;
|
|
17
|
+
return n(m).then((t) => {
|
|
18
|
+
if (e || !_.current) return;
|
|
19
|
+
v.current = t;
|
|
20
|
+
let n = t.elements().create("card", { style: {
|
|
21
|
+
base: {
|
|
22
|
+
fontSize: "16px",
|
|
23
|
+
color: p("--color-text-primary"),
|
|
24
|
+
iconColor: p("--color-text-secondary"),
|
|
25
|
+
"::placeholder": { color: p("--color-text-secondary") }
|
|
26
|
+
},
|
|
27
|
+
invalid: { color: p("--color-status-error-text") }
|
|
28
|
+
} });
|
|
29
|
+
n.on("change", (e) => {
|
|
30
|
+
C(e.complete), D(e.error?.message ?? null);
|
|
31
|
+
}), n.mount(_.current), y.current = n, x(!0);
|
|
32
|
+
}).catch((t) => {
|
|
33
|
+
e || D(t instanceof Error ? t.message : String(t));
|
|
34
|
+
}), () => {
|
|
35
|
+
e = !0, y.current?.destroy(), y.current = null;
|
|
36
|
+
};
|
|
37
|
+
}, [m]);
|
|
38
|
+
let O = async () => {
|
|
39
|
+
let e = v.current, t = y.current;
|
|
40
|
+
if (!(!e || !t)) {
|
|
41
|
+
T(!0), D(null);
|
|
42
|
+
try {
|
|
43
|
+
let n = await e.confirmCardPayment(h, { payment_method: { card: t } });
|
|
44
|
+
n.error && D(n.error.message ?? g("coolandlovely.checkout.payFailed", "The payment did not go through.")), await s();
|
|
45
|
+
} finally {
|
|
46
|
+
T(!1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ d("div", {
|
|
51
|
+
className: "space-y-3",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ u("div", {
|
|
54
|
+
ref: _,
|
|
55
|
+
"data-testid": "stripe-card-element",
|
|
56
|
+
className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-3"
|
|
57
|
+
}),
|
|
58
|
+
E && /* @__PURE__ */ u("p", {
|
|
59
|
+
className: "text-sm text-status-error-text",
|
|
60
|
+
children: E
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ d("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
className: f,
|
|
65
|
+
disabled: !b || !S || w,
|
|
66
|
+
onClick: () => void O(),
|
|
67
|
+
children: [w ? /* @__PURE__ */ u(c, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ u(l, { className: "h-4 w-4" }), g("coolandlovely.checkout.payAmount", "Pay {{amount}}", { amount: t(r.total, r.currency) })]
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}, h = ({ checkout: n, onSettle: i }) => {
|
|
72
|
+
let a = e(), [l, p] = o(!1), [h, g] = o(null);
|
|
73
|
+
if (n.clientSecret && n.stripePublishableKey) return /* @__PURE__ */ u(m, {
|
|
74
|
+
checkout: n,
|
|
75
|
+
onSettle: i,
|
|
76
|
+
publishableKey: n.stripePublishableKey,
|
|
77
|
+
clientSecret: n.clientSecret
|
|
78
|
+
});
|
|
79
|
+
if (n.providerOrderId && n.razorpayKeyId) {
|
|
80
|
+
let { providerOrderId: e, razorpayKeyId: o } = n, m = async () => {
|
|
81
|
+
p(!0), g(null);
|
|
82
|
+
try {
|
|
83
|
+
await r({
|
|
84
|
+
keyId: o,
|
|
85
|
+
providerOrderId: e,
|
|
86
|
+
total: n.total,
|
|
87
|
+
currency: n.currency,
|
|
88
|
+
description: a("coolandlovely.checkout.orderLabel", "Order {{number}}", { number: n.order.orderNumber })
|
|
89
|
+
}), await i();
|
|
90
|
+
} catch (e) {
|
|
91
|
+
g(e instanceof Error ? e.message : String(e));
|
|
92
|
+
} finally {
|
|
93
|
+
p(!1);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ d("div", {
|
|
97
|
+
className: "space-y-3",
|
|
98
|
+
children: [h && /* @__PURE__ */ u("p", {
|
|
99
|
+
className: "text-sm text-status-error-text",
|
|
100
|
+
children: h
|
|
101
|
+
}), /* @__PURE__ */ d("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
className: f,
|
|
104
|
+
disabled: l,
|
|
105
|
+
onClick: () => void m(),
|
|
106
|
+
children: [l ? /* @__PURE__ */ u(c, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ u(s, { className: "h-4 w-4" }), a("coolandlovely.checkout.payAmount", "Pay {{amount}}", { amount: t(n.total, n.currency) })]
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return /* @__PURE__ */ u("p", {
|
|
111
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken p-3 text-sm text-text-secondary",
|
|
112
|
+
children: a("coolandlovely.checkout.providerUnavailable", "Online payment is not available for this order right now. Your order is saved — try again from My Orders.")
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
//#endregion
|
|
116
|
+
export { h as PayForOrder };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=PayForOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayForOrder.js","names":[],"sources":["../../../src/coolandlovely/components/PayForOrder.tsx"],"sourcesContent":["/**\n * PayForOrder — collects the payment for an order through the provider global-billing chose.\n * @module coolandlovely/components\n *\n * Razorpay: opens Razorpay's checkout widget for the billing-created order.\n * Stripe: mounts a Stripe card element and confirms the billing-issued client secret.\n * Whatever the provider reports, the order is only marked paid by `onSettle`, which asks the\n * backend to re-read billing's payment record (BOFF-3370).\n */\n\nimport { type FC, useEffect, useRef, useState } from 'react';\nimport { CreditCard, Loader2, Lock } from 'lucide-react';\n\nimport type { CooOrderCheckout } from '../types';\nimport { formatPrice } from '../utils/formatters';\nimport {\n type StripeCardElement,\n type StripeInstance,\n loadStripe,\n openRazorpayCheckout,\n} from '../utils/paymentProviders';\nimport { useTr } from '../hooks';\n\ninterface PayForOrderProps {\n checkout: CooOrderCheckout;\n /** Ask the backend to settle the order against billing; called after every attempt. */\n onSettle: () => Promise<void>;\n}\n\nconst primaryButton =\n 'inline-flex items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50';\n\n/** Read a semantic colour token so the Stripe iframe matches the current theme. */\nfunction cssToken(name: string): string | undefined {\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || undefined;\n}\n\nconst StripeCardForm: FC<PayForOrderProps & { publishableKey: string; clientSecret: string }> = ({\n checkout,\n onSettle,\n publishableKey,\n clientSecret,\n}) => {\n const tr = useTr();\n const mountRef = useRef<HTMLDivElement | null>(null);\n const stripeRef = useRef<StripeInstance | null>(null);\n const cardRef = useRef<StripeCardElement | null>(null);\n const [ready, setReady] = useState(false);\n const [complete, setComplete] = useState(false);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n loadStripe(publishableKey)\n .then((stripe) => {\n if (cancelled || !mountRef.current) return;\n stripeRef.current = stripe;\n const card = stripe.elements().create('card', {\n style: {\n base: {\n fontSize: '16px',\n color: cssToken('--color-text-primary'),\n iconColor: cssToken('--color-text-secondary'),\n '::placeholder': { color: cssToken('--color-text-secondary') },\n },\n invalid: { color: cssToken('--color-status-error-text') },\n },\n });\n card.on('change', (event) => {\n setComplete(event.complete);\n setError(event.error?.message ?? null);\n });\n card.mount(mountRef.current);\n cardRef.current = card;\n setReady(true);\n })\n .catch((err: unknown) => {\n if (!cancelled) setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n cardRef.current?.destroy();\n cardRef.current = null;\n };\n }, [publishableKey]);\n\n const pay = async () => {\n const stripe = stripeRef.current;\n const card = cardRef.current;\n if (!stripe || !card) return;\n setBusy(true);\n setError(null);\n try {\n const result = await stripe.confirmCardPayment(clientSecret, { payment_method: { card } });\n if (result.error)\n setError(\n result.error.message ??\n tr('coolandlovely.checkout.payFailed', 'The payment did not go through.')\n );\n await onSettle();\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"space-y-3\">\n <div\n ref={mountRef}\n data-testid=\"stripe-card-element\"\n className=\"rounded-lg border border-border-seam bg-bg-surface px-3 py-3\"\n />\n {error && <p className=\"text-sm text-status-error-text\">{error}</p>}\n <button\n type=\"button\"\n className={primaryButton}\n disabled={!ready || !complete || busy}\n onClick={() => void pay()}\n >\n {busy ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <Lock className=\"h-4 w-4\" />}\n {tr('coolandlovely.checkout.payAmount', 'Pay {{amount}}', {\n amount: formatPrice(checkout.total, checkout.currency),\n })}\n </button>\n </div>\n );\n};\n\nexport const PayForOrder: FC<PayForOrderProps> = ({ checkout, onSettle }) => {\n const tr = useTr();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n if (checkout.clientSecret && checkout.stripePublishableKey) {\n return (\n <StripeCardForm\n checkout={checkout}\n onSettle={onSettle}\n publishableKey={checkout.stripePublishableKey}\n clientSecret={checkout.clientSecret}\n />\n );\n }\n\n if (checkout.providerOrderId && checkout.razorpayKeyId) {\n const { providerOrderId, razorpayKeyId } = checkout;\n const pay = async () => {\n setBusy(true);\n setError(null);\n try {\n await openRazorpayCheckout({\n keyId: razorpayKeyId,\n providerOrderId,\n total: checkout.total,\n currency: checkout.currency,\n description: tr('coolandlovely.checkout.orderLabel', 'Order {{number}}', {\n number: checkout.order.orderNumber,\n }),\n });\n await onSettle();\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err));\n } finally {\n setBusy(false);\n }\n };\n return (\n <div className=\"space-y-3\">\n {error && <p className=\"text-sm text-status-error-text\">{error}</p>}\n <button type=\"button\" className={primaryButton} disabled={busy} onClick={() => void pay()}>\n {busy ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <CreditCard className=\"h-4 w-4\" />}\n {tr('coolandlovely.checkout.payAmount', 'Pay {{amount}}', {\n amount: formatPrice(checkout.total, checkout.currency),\n })}\n </button>\n </div>\n );\n }\n\n return (\n <p className=\"rounded-lg border border-border-seam bg-bg-sunken p-3 text-sm text-text-secondary\">\n {tr(\n 'coolandlovely.checkout.providerUnavailable',\n 'Online payment is not available for this order right now. Your order is saved — try again from My Orders.'\n )}\n </p>\n );\n};\n"],"mappings":";;;;;;;;AA6BA,IAAM,IACJ;AAGF,SAAS,EAAS,GAAkC;AAElD,QADc,OAAO,iBAAiB,SAAS,gBAAgB,CAAC,iBAAiB,EAAK,CAAC,MAAM,IAC7E,KAAA;;AAGlB,IAAM,KAA2F,EAC/F,aACA,aACA,mBACA,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAW,EAA8B,KAAK,EAC9C,IAAY,EAA8B,KAAK,EAC/C,IAAU,EAAiC,KAAK,EAChD,CAAC,GAAO,KAAY,EAAS,GAAM,EACnC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAM,KAAW,EAAS,GAAM,EACjC,CAAC,GAAO,KAAY,EAAwB,KAAK;AAEvD,SAAgB;EACd,IAAI,IAAY;AA2BhB,SA1BA,EAAW,EAAe,CACvB,MAAM,MAAW;AAChB,OAAI,KAAa,CAAC,EAAS,QAAS;AACpC,KAAU,UAAU;GACpB,IAAM,IAAO,EAAO,UAAU,CAAC,OAAO,QAAQ,EAC5C,OAAO;IACL,MAAM;KACJ,UAAU;KACV,OAAO,EAAS,uBAAuB;KACvC,WAAW,EAAS,yBAAyB;KAC7C,iBAAiB,EAAE,OAAO,EAAS,yBAAyB,EAAE;KAC/D;IACD,SAAS,EAAE,OAAO,EAAS,4BAA4B,EAAE;IAC1D,EACF,CAAC;AAOF,GANA,EAAK,GAAG,WAAW,MAAU;AAE3B,IADA,EAAY,EAAM,SAAS,EAC3B,EAAS,EAAM,OAAO,WAAW,KAAK;KACtC,EACF,EAAK,MAAM,EAAS,QAAQ,EAC5B,EAAQ,UAAU,GAClB,EAAS,GAAK;IACd,CACD,OAAO,MAAiB;AACvB,GAAK,KAAW,EAAS,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;IAC1E,QACS;AAGX,GAFA,IAAY,IACZ,EAAQ,SAAS,SAAS,EAC1B,EAAQ,UAAU;;IAEnB,CAAC,EAAe,CAAC;CAEpB,IAAM,IAAM,YAAY;EACtB,IAAM,IAAS,EAAU,SACnB,IAAO,EAAQ;AACjB,SAAC,KAAU,CAAC,IAEhB;GADA,EAAQ,GAAK,EACb,EAAS,KAAK;AACd,OAAI;IACF,IAAM,IAAS,MAAM,EAAO,mBAAmB,GAAc,EAAE,gBAAgB,EAAE,SAAM,EAAE,CAAC;AAM1F,IALI,EAAO,SACT,EACE,EAAO,MAAM,WACX,EAAG,oCAAoC,kCAAkC,CAC5E,EACH,MAAM,GAAU;aACR;AACR,MAAQ,GAAM;;;;AAIlB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IACE,KAAK;IACL,eAAY;IACZ,WAAU;IACV,CAAA;GACD,KAAS,kBAAC,KAAD;IAAG,WAAU;cAAkC;IAAU,CAAA;GACnE,kBAAC,UAAD;IACE,MAAK;IACL,WAAW;IACX,UAAU,CAAC,KAAS,CAAC,KAAY;IACjC,eAAe,KAAK,GAAK;cAJ3B,CAMG,IAAO,kBAAC,GAAD,EAAS,WAAU,wBAAyB,CAAA,GAAG,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAClF,EAAG,oCAAoC,kBAAkB,EACxD,QAAQ,EAAY,EAAS,OAAO,EAAS,SAAS,EACvD,CAAC,CACK;;GACL;;GAIG,KAAqC,EAAE,aAAU,kBAAe;CAC3E,IAAM,IAAK,GAAO,EACZ,CAAC,GAAM,KAAW,EAAS,GAAM,EACjC,CAAC,GAAO,KAAY,EAAwB,KAAK;AAEvD,KAAI,EAAS,gBAAgB,EAAS,qBACpC,QACE,kBAAC,GAAD;EACY;EACA;EACV,gBAAgB,EAAS;EACzB,cAAc,EAAS;EACvB,CAAA;AAIN,KAAI,EAAS,mBAAmB,EAAS,eAAe;EACtD,IAAM,EAAE,oBAAiB,qBAAkB,GACrC,IAAM,YAAY;AAEtB,GADA,EAAQ,GAAK,EACb,EAAS,KAAK;AACd,OAAI;AAUF,IATA,MAAM,EAAqB;KACzB,OAAO;KACP;KACA,OAAO,EAAS;KAChB,UAAU,EAAS;KACnB,aAAa,EAAG,qCAAqC,oBAAoB,EACvE,QAAQ,EAAS,MAAM,aACxB,CAAC;KACH,CAAC,EACF,MAAM,GAAU;YACT,GAAK;AACZ,MAAS,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;aAClD;AACR,MAAQ,GAAM;;;AAGlB,SACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,KAAS,kBAAC,KAAD;IAAG,WAAU;cAAkC;IAAU,CAAA,EACnE,kBAAC,UAAD;IAAQ,MAAK;IAAS,WAAW;IAAe,UAAU;IAAM,eAAe,KAAK,GAAK;cAAzF,CACG,IAAO,kBAAC,GAAD,EAAS,WAAU,wBAAyB,CAAA,GAAG,kBAAC,GAAD,EAAY,WAAU,WAAY,CAAA,EACxF,EAAG,oCAAoC,kBAAkB,EACxD,QAAQ,EAAY,EAAS,OAAO,EAAS,SAAS,EACvD,CAAC,CACK;MACL;;;AAIV,QACE,kBAAC,KAAD;EAAG,WAAU;YACV,EACC,8CACA,4GACD;EACC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ShopItemCardProps {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
brandName?: string;
|
|
7
|
+
price: number;
|
|
8
|
+
currency: string;
|
|
9
|
+
imageFileId?: string | null;
|
|
10
|
+
onOpen: () => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ShopItemCard: FC<ShopItemCardProps>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=ShopItemCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShopItemCard.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/ShopItemCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,UAAU,iBAAiB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA0C9C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface LoadingViewProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const LoadingView: FC<LoadingViewProps>;
|
|
8
|
+
interface ErrorViewProps {
|
|
9
|
+
title?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ErrorView: FC<ErrorViewProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=StateViews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateViews.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StateViews.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAK5C,CAAC;AAEF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4BxC,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -41,6 +41,10 @@ var i = {
|
|
|
41
41
|
wishlist: "info",
|
|
42
42
|
purchased_on_platform: "success",
|
|
43
43
|
gifted: "warning",
|
|
44
|
+
pending_payment: "warning",
|
|
45
|
+
paid: "success",
|
|
46
|
+
pending: "secondary",
|
|
47
|
+
synced: "success",
|
|
44
48
|
inactive: "secondary",
|
|
45
49
|
error: "destructive",
|
|
46
50
|
failed: "destructive",
|
|
@@ -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 // 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,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 // 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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface StepTrackerProps {
|
|
4
|
+
/** Ordered step values (e.g. ['PROPOSED','ACCEPTED','IN_PROGRESS','PUBLISHED']). */
|
|
5
|
+
steps: string[];
|
|
6
|
+
/** The current step value — must be one of `steps`. */
|
|
7
|
+
current: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const StepTracker: FC<StepTrackerProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=StepTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepTracker.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StepTracker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,UAAU,gBAAgB;IACxB,oFAAoF;IACpF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6C5C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface TagListProps {
|
|
4
|
+
tags: string[];
|
|
5
|
+
/** Maximum chips to show before collapsing into a "+N" chip. */
|
|
6
|
+
max?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
tone?: 'default' | 'accent';
|
|
9
|
+
}
|
|
10
|
+
export declare const TagList: FC<TagListProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=TagList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagList.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/TagList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA2BpC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ThumbnailProps {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
/** Stable seed (e.g. entity id) used to pick a deterministic accent tint. */
|
|
6
|
+
seed?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Whether a File reference exists (shows a subtle "image attached" hint). */
|
|
9
|
+
hasImage?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
/** wspace-files File id — when it resolves, its image overlays the glyph. */
|
|
12
|
+
fileId?: string | null;
|
|
13
|
+
/** Alt text when a real image is shown. */
|
|
14
|
+
alt?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional content rendered absolutely over the image (e.g. a gradient scrim
|
|
17
|
+
* + overlaid caption). Positioned by the caller; sits above the FileImage.
|
|
18
|
+
*/
|
|
19
|
+
overlay?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const Thumbnail: FC<ThumbnailProps>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=Thumbnail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thumbnail.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/Thumbnail.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,cAAc;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAmBD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface VisibilityChipProps {
|
|
4
|
+
/** A `CooVisibility` value (PUBLIC / FOLLOWERS / PRIVATE) — case-insensitive. */
|
|
5
|
+
visibility: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const VisibilityChip: FC<VisibilityChipProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=VisibilityChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilityChip.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/VisibilityChip.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,UAAU,mBAAmB;IAC3B,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkBlD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CooWardrobeItem } from '../types';
|
|
3
|
+
|
|
4
|
+
interface WardrobeItemCardProps {
|
|
5
|
+
item: CooWardrobeItem;
|
|
6
|
+
onLogWear?: () => void;
|
|
7
|
+
onRemove?: () => void;
|
|
8
|
+
isLoggingWear?: boolean;
|
|
9
|
+
isRemoving?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const WardrobeItemCard: FC<WardrobeItemCardProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=WardrobeItemCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WardrobeItemCard.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/WardrobeItemCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAwGtD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Components Index
|
|
3
|
+
* @module coolandlovely/components
|
|
4
|
+
*/
|
|
5
|
+
export { PageLayout } from './PageLayout';
|
|
6
|
+
export { MetricsCard } from './MetricsCard';
|
|
7
|
+
export { StatusBadge } from './StatusBadge';
|
|
8
|
+
export { EmptyState } from './EmptyState';
|
|
9
|
+
export { Thumbnail } from './Thumbnail';
|
|
10
|
+
export { FileImage } from './FileImage';
|
|
11
|
+
export { ImageUploadField } from './ImageUploadField';
|
|
12
|
+
export { TagList } from './TagList';
|
|
13
|
+
export { LoadingView, ErrorView } from './StateViews';
|
|
14
|
+
export { FieldShell, TextField, TextAreaField, SelectField, ToggleField } from './Field';
|
|
15
|
+
export { ActorName } from './ActorName';
|
|
16
|
+
export { Comments } from './Comments';
|
|
17
|
+
export { ActivityTrail } from './ActivityTrail';
|
|
18
|
+
export { FollowButton } from './FollowButton';
|
|
19
|
+
export { AddToLookbookButton } from './AddToLookbookButton';
|
|
20
|
+
export { LookCard } from './LookCard';
|
|
21
|
+
export { BrandCard } from './BrandCard';
|
|
22
|
+
export { BrandCover } from './BrandCover';
|
|
23
|
+
export { CollectionCard } from './CollectionCard';
|
|
24
|
+
export { LookbookCard } from './LookbookCard';
|
|
25
|
+
export { WardrobeItemCard } from './WardrobeItemCard';
|
|
26
|
+
export { StepTracker } from './StepTracker';
|
|
27
|
+
export { BrandCreatorAvatars } from './BrandCreatorAvatars';
|
|
28
|
+
export { ShopItemCard } from './ShopItemCard';
|
|
29
|
+
export { ColourSwatchRow } from './ColourSwatchRow';
|
|
30
|
+
export { VisibilityChip } from './VisibilityChip';
|
|
31
|
+
export { FeedbackWidget } from './FeedbackWidget';
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { CoolAndLovelyRootProps } from '../types';
|
|
3
|
+
|
|
4
|
+
interface CoolAndLovelyContextValue extends Omit<CoolAndLovelyRootProps, 'registerNavItems' | 'registerFooterItems' | 'navigate'> {
|
|
5
|
+
isStandalone: boolean;
|
|
6
|
+
/** Shell's navigate function (only available in integrated mode) */
|
|
7
|
+
navigate?: (path: string) => void;
|
|
8
|
+
/** Navigate to a path relative to basePath */
|
|
9
|
+
navigateTo: (relativePath: string) => void;
|
|
10
|
+
/** Get the full path for a relative path */
|
|
11
|
+
getPath: (relativePath: string) => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function useCoolAndLovely(): CoolAndLovelyContextValue;
|
|
14
|
+
export declare const CoolAndLovelyProvider: FC<PropsWithChildren<CoolAndLovelyRootProps>>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=CoolAndLovelyContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoolAndLovelyContext.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/context/CoolAndLovelyContext.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAOvD,UAAU,yBAA0B,SAAQ,IAAI,CAC9C,sBAAsB,EACtB,kBAAkB,GAAG,qBAAqB,GAAG,UAAU,CACxD;IACC,YAAY,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,8CAA8C;IAC9C,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAQD,wBAAgB,gBAAgB,IAAI,yBAAyB,CAM5D;AAyID,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAqB/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/context/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks Index
|
|
3
|
+
* @module coolandlovely/hooks
|
|
4
|
+
*/
|
|
5
|
+
export { useBrands, useBrand, useCreateBrand, useUpdateBrand, useTransitionBrand, useArchiveBrand, useCollections, useCollection, useCreateCollection, useUpdateCollection, usePublishCollection, useArchiveCollection, useStyleItems, useStyleItem, useCreateStyleItem, useUpdateStyleItem, useArchiveStyleItem, useLooks, useLooksWithItems, useLook, useCreateLook, useUpdateLook, usePublishLook, useLikeLook, useUnlikeLook, useSaveLook, useUnsaveLook, useDeleteLook, useCollaborations, useCollaboration, useCreateCollaboration, useUpdateCollaboration, useTransitionCollaboration, useDeleteCollaboration, useWardrobeItems, useCreateWardrobeItem, useUpdateWardrobeItem, useLogWardrobeWear, useRemoveWardrobeItem, useMyStyleProfile, useStyleProfile, useStyleProfileByOwner, useUpsertStyleProfile, useLookbooks, useLookbook, useCreateLookbook, useAddLookbookEntry, useRemoveLookbookEntry, useDeleteLookbook, useIsFollowing, useFollow, useUnfollow, useMyFollowing, useMyFollowers, useSearchStyleItems, useSearchLooks, useApproveBrand, useRejectBrand, useReviewCollaboration, useFeatureStyleItem, useUnfeatureStyleItem, } from './useCoolAndLovelyApi';
|
|
6
|
+
export type { ListBrandsArgs, ListCollectionsArgs, ListStyleItemsArgs, ListLooksArgs, ListCollaborationsArgs, ListWardrobeArgs, SearchStyleItemsArgs, SearchLooksArgs, } from './useCoolAndLovelyApi';
|
|
7
|
+
export { uploadImageToFiles, useFileUrl, COO_FILE_FOLDERS } from './useFiles';
|
|
8
|
+
export type { UploadedImage, CooFileFolder } from './useFiles';
|
|
9
|
+
export { useEntityComments, useAddComment } from './useComments';
|
|
10
|
+
export type { EntityCommentView, EntityCommentsResult } from './useComments';
|
|
11
|
+
export { useEntityActivity } from './useActivity';
|
|
12
|
+
export type { CooActivityEntry } from './useActivity';
|
|
13
|
+
export { useAssistantEntityName } from './useAssistantEntity';
|
|
14
|
+
export { useTr } from './useTr';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,EAEf,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EAEpB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EAEnB,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EAEb,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EAEtB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EAErB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EAErB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EAEjB,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EAEd,mBAAmB,EACnB,cAAc,EAEd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit-trail hooks — activity via wspace-activity-svc (NO new table).
|
|
3
|
+
* @module coolandlovely/hooks
|
|
4
|
+
*
|
|
5
|
+
* CoolAndLovely does NOT own an audit table. Every `coo*` mutation is already
|
|
6
|
+
* recorded by the svc's mutation-audit plugin
|
|
7
|
+
* (`wspace-coolandlovely-svc/src/plugins/mutation-audit-plugin.ts`) through
|
|
8
|
+
* be-sdk `trackOperation`, which writes an `ActivityLog` row on
|
|
9
|
+
* wspace-activity-svc carrying:
|
|
10
|
+
*
|
|
11
|
+
* action — the plugin's `eventName`, e.g. `coolandlovely.brand_transitioned`
|
|
12
|
+
* description — `"<action> <resourceType>: <fieldName>"`
|
|
13
|
+
* resourceType — e.g. `coolandlovely-brand`
|
|
14
|
+
* resourceId — the affected record's id
|
|
15
|
+
* userId — the acting actor
|
|
16
|
+
*
|
|
17
|
+
* This hook is purely the read surface over those rows (`getActivities`,
|
|
18
|
+
* federated on the workspace supergraph). Nothing is synthesised: when the
|
|
19
|
+
* service has no rows for a record, callers render an empty state.
|
|
20
|
+
*/
|
|
21
|
+
/** A single audit entry as surfaced in the MFE (scalar-only projection). */
|
|
22
|
+
export interface CooActivityEntry {
|
|
23
|
+
id: string;
|
|
24
|
+
action: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
resourceType: string | null;
|
|
27
|
+
resourceId: string | null;
|
|
28
|
+
userId: string;
|
|
29
|
+
timestamp: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Audit entries for one record, newest first.
|
|
33
|
+
*
|
|
34
|
+
* `getActivities` is `@rbac(action: "read", resource: "activity-log",
|
|
35
|
+
* scopeType: "wspace")` — a member without that permission gets an error from
|
|
36
|
+
* the gateway, which callers surface honestly rather than hiding.
|
|
37
|
+
*/
|
|
38
|
+
export declare const useEntityActivity: (resourceType: string, resourceId: string | undefined, limit?: number) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooActivityEntry[]>, Error>;
|
|
39
|
+
//# sourceMappingURL=useActivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useActivity.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useActivity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAqCD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,YAAY,MAAM,GAAG,SAAS,EAC9B,cAAU,uFAiBX,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant screen-context hook.
|
|
3
|
+
* @module coolandlovely/hooks
|
|
4
|
+
*
|
|
5
|
+
* The floating assistant already receives `entityType` / `entityId`, both
|
|
6
|
+
* resolved from the URL. Neither tells the model WHAT the shopper is looking
|
|
7
|
+
* at, so "publish this storefront" or "what collections is this in" forces the
|
|
8
|
+
* assistant to echo a UUID back at a human.
|
|
9
|
+
*
|
|
10
|
+
* `entityName` is one of the agent's allowed context keys
|
|
11
|
+
* (`~/products/wspace/sandbox/ai-assistant/src/context-loader.ts`), but nothing
|
|
12
|
+
* in this product ever sent it. Detail pages call this hook with the name from
|
|
13
|
+
* their own loaded record — no extra request, no invented label — and it is
|
|
14
|
+
* withdrawn again on unmount.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Publish the current entity's display name to the assistant page context.
|
|
18
|
+
*
|
|
19
|
+
* Safe to call before the record has loaded: a missing id or name simply
|
|
20
|
+
* publishes nothing, so the assistant falls back to the id-only context it
|
|
21
|
+
* gets today rather than receiving a placeholder.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useAssistantEntityName(entityId: string | undefined, entityName: string | null | undefined): void;
|
|
24
|
+
//# sourceMappingURL=useAssistantEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAssistantEntity.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useAssistantEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,IAAI,CAMN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comments hooks — reviews / feedback via wspace-conversations-svc (NO new table).
|
|
3
|
+
* @module coolandlovely/hooks
|
|
4
|
+
*
|
|
5
|
+
* CoolAndLovely does NOT own a comment/review table. Reviews & feedback on a
|
|
6
|
+
* look or brand are polymorphic `EntityComment` records owned by
|
|
7
|
+
* wspace-conversations-svc, keyed by (entityType, entityId). Same graphqlFetch
|
|
8
|
+
* transport (workspace gateway + workspace token) as every other coo* call.
|
|
9
|
+
*
|
|
10
|
+
* Commenter display names must be resolved via fe-libs useActorProfiles
|
|
11
|
+
* (GLOBAL gateway) — the federated wspace `User` here exposes only ids, so
|
|
12
|
+
* NEVER select firstName/name on the comment author.
|
|
13
|
+
*/
|
|
14
|
+
/** A single review/comment as surfaced in the MFE (scalar-only projection). */
|
|
15
|
+
export interface EntityCommentView {
|
|
16
|
+
id: string;
|
|
17
|
+
authorId: string;
|
|
18
|
+
authorType: string;
|
|
19
|
+
text: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
edited: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface EntityCommentsResult {
|
|
24
|
+
total: number;
|
|
25
|
+
comments: EntityCommentView[];
|
|
26
|
+
}
|
|
27
|
+
/** List reviews/comments for a (entityType, entityId), newest first. */
|
|
28
|
+
export declare const useEntityComments: (entityType: string, entityId: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<EntityCommentsResult>, Error>;
|
|
29
|
+
/** Post a review/comment on a (entityType, entityId). */
|
|
30
|
+
export declare const useAddComment: () => import('@tanstack/react-query').UseMutationResult<{
|
|
31
|
+
id: string;
|
|
32
|
+
}, Error, {
|
|
33
|
+
entityType: string;
|
|
34
|
+
entityId: string;
|
|
35
|
+
text: string;
|
|
36
|
+
}, unknown>;
|
|
37
|
+
//# sourceMappingURL=useComments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComments.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useComments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AA2DD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,yFAmCjF,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,aAAa;QAayC,MAAM;;gBAJvD,MAAM;cACR,MAAM;UACV,MAAM;WAqBjB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CooAddToCartInput, CooCart, CooCheckoutInput, CooCreatorEarningConnection, CooCreatorEarningsSummary, CooCreatorPayout, CooOrder, CooOrderCheckout, CooOrderConnection, CooOrderStatus } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const useMyCart: () => import('@tanstack/react-query').UseQueryResult<NoInfer<CooCart>, Error>;
|
|
4
|
+
export declare const useAddToCart: () => import('@tanstack/react-query').UseMutationResult<CooCart, Error, {
|
|
5
|
+
input: CooAddToCartInput;
|
|
6
|
+
}, unknown>;
|
|
7
|
+
export declare const useUpdateCartItem: () => import('@tanstack/react-query').UseMutationResult<CooCart, Error, {
|
|
8
|
+
id: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
}, unknown>;
|
|
11
|
+
export declare const useRemoveCartItem: () => import('@tanstack/react-query').UseMutationResult<CooCart, Error, {
|
|
12
|
+
id: string;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
export declare const useMyOrders: (status?: CooOrderStatus) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooOrderConnection>, Error>;
|
|
15
|
+
export declare const useMyOrder: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooOrder | null>, Error>;
|
|
16
|
+
export declare const useCheckout: () => import('@tanstack/react-query').UseMutationResult<CooOrderCheckout, Error, CooCheckoutInput, unknown>;
|
|
17
|
+
export declare const useResumeOrderPayment: () => import('@tanstack/react-query').UseMutationResult<CooOrderCheckout, Error, string, unknown>;
|
|
18
|
+
export declare const useSyncOrderPayment: () => import('@tanstack/react-query').UseMutationResult<CooOrder, Error, string, unknown>;
|
|
19
|
+
export declare const useCancelOrder: () => import('@tanstack/react-query').UseMutationResult<CooOrder, Error, string, unknown>;
|
|
20
|
+
export declare const useMyCreatorEarnings: () => import('@tanstack/react-query').UseQueryResult<NoInfer<CooCreatorEarningConnection>, Error>;
|
|
21
|
+
export declare const useMyCreatorEarningsSummary: () => import('@tanstack/react-query').UseQueryResult<NoInfer<CooCreatorEarningsSummary>, Error>;
|
|
22
|
+
export declare const useRequestCreatorPayout: () => import('@tanstack/react-query').UseMutationResult<CooCreatorPayout, Error, {
|
|
23
|
+
amount: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
notes?: string | null;
|
|
26
|
+
}, unknown>;
|
|
27
|
+
//# sourceMappingURL=useCommerceApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommerceApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useCommerceApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAC;AA+BlB,eAAO,MAAM,SAAS,+EAarB,CAAC;AAuBF,eAAO,MAAM,YAAY;WACE,iBAAiB;WAGzC,CAAC;AAEJ,eAAO,MAAM,iBAAiB;QACN,MAAM;cAAY,MAAM;WAK7C,CAAC;AAEJ,eAAO,MAAM,iBAAiB;QACN,MAAM;WAG3B,CAAC;AAMJ,eAAO,MAAM,WAAW,GAAI,SAAS,cAAc,uFAkBlD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,GAAG,SAAS,oFAchD,CAAC;AAWF,eAAO,MAAM,WAAW,6GAcvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,mGAcjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,2FAc/B,CAAC;AAEF,eAAO,MAAM,cAAc,2FAc1B,CAAC;AAMF,eAAO,MAAM,oBAAoB,mGAqBhC,CAAC;AAEF,eAAO,MAAM,2BAA2B,iGAkBvC,CAAC;AAEF,eAAO,MAAM,uBAAuB;YAII,MAAM;cAAY,MAAM;YAAU,MAAM,GAAG,IAAI;WActF,CAAC"}
|