@nukleus-sports/page-shells 0.3.1 → 0.5.0
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/marketing.cjs +21 -20
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.d.cts +11 -2
- package/dist/marketing.d.ts +11 -2
- package/dist/marketing.js +21 -20
- package/dist/marketing.js.map +1 -1
- package/package.json +2 -2
package/dist/marketing.cjs
CHANGED
|
@@ -38,8 +38,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
38
38
|
activeTab,
|
|
39
39
|
onTabChange,
|
|
40
40
|
currentProjectDeals,
|
|
41
|
-
|
|
42
|
-
manualDeals,
|
|
41
|
+
completedDeals,
|
|
43
42
|
currentEmptyMessage,
|
|
44
43
|
completedEmptyMessage,
|
|
45
44
|
gatedEmptyState,
|
|
@@ -53,11 +52,12 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
53
52
|
clientImageUrl,
|
|
54
53
|
resolveImageUrl,
|
|
55
54
|
getProjectDealAsideFooter,
|
|
56
|
-
getManualDealAsideFooter
|
|
55
|
+
getManualDealAsideFooter,
|
|
56
|
+
getProjectDealStatusPill
|
|
57
57
|
} = adapter;
|
|
58
58
|
const [previewDeal, setPreviewDeal] = (0, import_react.useState)(null);
|
|
59
59
|
const resolvedCompletedEmptyMessage = typeof completedEmptyMessage === "function" ? completedEmptyMessage(currentProjectDeals.length > 0) : completedEmptyMessage;
|
|
60
|
-
const hasCompletedContent =
|
|
60
|
+
const hasCompletedContent = completedDeals.length > 0;
|
|
61
61
|
if (isLoading) {
|
|
62
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_ui_web.cn)("flex flex-col gap-3", className), children: [
|
|
63
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.Skeleton, { className: "h-9 w-full rounded-[10px]" }),
|
|
@@ -116,38 +116,39 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
116
116
|
collabHref: getCollabHref(deal.project_id),
|
|
117
117
|
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
118
118
|
resolveImageUrl,
|
|
119
|
-
asideFooter: getProjectDealAsideFooter?.(deal)
|
|
119
|
+
asideFooter: getProjectDealAsideFooter?.(deal),
|
|
120
|
+
statusPill: getProjectDealStatusPill?.(deal)
|
|
120
121
|
},
|
|
121
122
|
deal.project_id
|
|
122
123
|
)) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: currentEmptyMessage }) }),
|
|
123
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime.
|
|
124
|
-
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col gap-3 sm:gap-0", children: completedDeals.map(
|
|
125
|
+
(item) => item.kind === "project" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
126
|
import_marketing.ProjectDealCard,
|
|
126
127
|
{
|
|
127
|
-
deal,
|
|
128
|
+
deal: item.deal,
|
|
128
129
|
isCompleted: true,
|
|
129
|
-
collabMembership: getCollabMembership(deal.project_id),
|
|
130
|
-
collabHref: getCollabHref(deal.project_id),
|
|
131
|
-
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
130
|
+
collabMembership: getCollabMembership(item.deal.project_id),
|
|
131
|
+
collabHref: getCollabHref(item.deal.project_id),
|
|
132
|
+
onCollabClick: getOnCollabClick?.(item.deal.project_id),
|
|
132
133
|
resolveImageUrl,
|
|
133
|
-
asideFooter: getProjectDealAsideFooter?.(deal)
|
|
134
|
+
asideFooter: getProjectDealAsideFooter?.(item.deal),
|
|
135
|
+
statusPill: getProjectDealStatusPill?.(item.deal)
|
|
134
136
|
},
|
|
135
|
-
deal.project_id
|
|
136
|
-
))
|
|
137
|
-
manualDeals.map((deal) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
`project-${item.deal.project_id}`
|
|
138
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
139
|
import_marketing.ManualDealCard,
|
|
139
140
|
{
|
|
140
|
-
deal,
|
|
141
|
+
deal: item.deal,
|
|
141
142
|
onPreview: setPreviewDeal,
|
|
142
143
|
onEdit: onEditDeal,
|
|
143
144
|
onDelete: onDeleteDeal,
|
|
144
145
|
onOpenDocument,
|
|
145
146
|
resolveImageUrl,
|
|
146
|
-
asideFooter: getManualDealAsideFooter?.(deal)
|
|
147
|
+
asideFooter: getManualDealAsideFooter?.(item.deal)
|
|
147
148
|
},
|
|
148
|
-
deal.id
|
|
149
|
-
)
|
|
150
|
-
|
|
149
|
+
`manual-${item.deal.id}`
|
|
150
|
+
)
|
|
151
|
+
) }) })
|
|
151
152
|
] })
|
|
152
153
|
]
|
|
153
154
|
}
|
package/dist/marketing.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marketing/index.ts","../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["export {\n MarketingDealsPanel,\n type MarketingDealsAdapter,\n type MarketingDealsPanelProps,\n} from \"./marketing-deals-panel\";\n","import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n completedProjectDeals: ProjectDeal[];\n manualDeals: ManualDeal[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedProjectDeals,\n manualDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedProjectDeals.length > 0 || manualDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={true}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n />\n ))}\n {manualDeals.map((deal) => (\n <ManualDealCard\n key={deal.id}\n deal={deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0D;AAE1D,oBAaO;AAEP,uBASO;AAiGD;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA4B,IAAI;AAEtE,QAAM,gCACJ,OAAO,0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AAM;AAAA,QACN,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AACtB,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAChC;AAAA,QACA,QACE,aACI,CAAC,SAAS;AAER,yBAAe,IAAI;AACnB,qBAAW,IAAI;AAAA,QACjB,IACA;AAAA,QAEN;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/marketing/index.ts","../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["export {\n MarketingDealsPanel,\n type MarketingDealsAdapter,\n type MarketingDealsPanelProps,\n} from \"./marketing-deals-panel\";\n","import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n /** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */\n completedDeals: ({ kind: \"project\"; deal: ProjectDeal } | { kind: \"manual\"; deal: ManualDeal })[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedDeals.map((item) =>\n item.kind === \"project\" ? (\n <ProjectDealCard\n key={`project-${item.deal.project_id}`}\n deal={item.deal}\n isCompleted={true}\n collabMembership={getCollabMembership(item.deal.project_id)}\n collabHref={getCollabHref(item.deal.project_id)}\n onCollabClick={getOnCollabClick?.(item.deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(item.deal)}\n statusPill={getProjectDealStatusPill?.(item.deal)}\n />\n ) : (\n <ManualDealCard\n key={`manual-${item.deal.id}`}\n deal={item.deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(item.deal)}\n />\n ),\n )}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0D;AAE1D,oBAaO;AAEP,uBASO;AAqGD;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA4B,IAAI;AAEtE,QAAM,gCACJ,OAAO,0BAA0B,aAC7B,sBAAsB,oBAAoB,SAAS,CAAC,IACpD;AACN,QAAM,sBAAsB,eAAe,SAAS;AAEpD,MAAI,WAAW;AACb,WACE,6CAAC,SAAI,eAAW,kBAAG,uBAAuB,SAAS,GACjD;AAAA,kDAAC,0BAAS,WAAU,6BAA4B;AAAA,MAChD,4CAAC,0BAAS,WAAU,mCAAkC;AAAA,OACxD;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WACH;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,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N;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/marketing.d.cts
CHANGED
|
@@ -11,8 +11,14 @@ interface MarketingDealsAdapter {
|
|
|
11
11
|
activeTab: "current" | "completed";
|
|
12
12
|
onTabChange: (tab: "current" | "completed") => void;
|
|
13
13
|
currentProjectDeals: ProjectDeal[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */
|
|
15
|
+
completedDeals: ({
|
|
16
|
+
kind: "project";
|
|
17
|
+
deal: ProjectDeal;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "manual";
|
|
20
|
+
deal: ManualDeal;
|
|
21
|
+
})[];
|
|
16
22
|
currentEmptyMessage: string;
|
|
17
23
|
/** Accepts a function because nukleus-app's wording depends on whether current deals exist. */
|
|
18
24
|
completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);
|
|
@@ -44,6 +50,9 @@ interface MarketingDealsAdapter {
|
|
|
44
50
|
/** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */
|
|
45
51
|
getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;
|
|
46
52
|
getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;
|
|
53
|
+
/** Overrides the computed Active/Upcoming/Complete status pill -- for a
|
|
54
|
+
* caller whose own saved status has more states dates alone can't express. */
|
|
55
|
+
getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;
|
|
47
56
|
}
|
|
48
57
|
interface MarketingDealsPanelProps {
|
|
49
58
|
adapter: MarketingDealsAdapter;
|
package/dist/marketing.d.ts
CHANGED
|
@@ -11,8 +11,14 @@ interface MarketingDealsAdapter {
|
|
|
11
11
|
activeTab: "current" | "completed";
|
|
12
12
|
onTabChange: (tab: "current" | "completed") => void;
|
|
13
13
|
currentProjectDeals: ProjectDeal[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */
|
|
15
|
+
completedDeals: ({
|
|
16
|
+
kind: "project";
|
|
17
|
+
deal: ProjectDeal;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "manual";
|
|
20
|
+
deal: ManualDeal;
|
|
21
|
+
})[];
|
|
16
22
|
currentEmptyMessage: string;
|
|
17
23
|
/** Accepts a function because nukleus-app's wording depends on whether current deals exist. */
|
|
18
24
|
completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);
|
|
@@ -44,6 +50,9 @@ interface MarketingDealsAdapter {
|
|
|
44
50
|
/** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */
|
|
45
51
|
getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;
|
|
46
52
|
getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;
|
|
53
|
+
/** Overrides the computed Active/Upcoming/Complete status pill -- for a
|
|
54
|
+
* caller whose own saved status has more states dates alone can't express. */
|
|
55
|
+
getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;
|
|
47
56
|
}
|
|
48
57
|
interface MarketingDealsPanelProps {
|
|
49
58
|
adapter: MarketingDealsAdapter;
|
package/dist/marketing.js
CHANGED
|
@@ -30,8 +30,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
30
30
|
activeTab,
|
|
31
31
|
onTabChange,
|
|
32
32
|
currentProjectDeals,
|
|
33
|
-
|
|
34
|
-
manualDeals,
|
|
33
|
+
completedDeals,
|
|
35
34
|
currentEmptyMessage,
|
|
36
35
|
completedEmptyMessage,
|
|
37
36
|
gatedEmptyState,
|
|
@@ -45,11 +44,12 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
45
44
|
clientImageUrl,
|
|
46
45
|
resolveImageUrl,
|
|
47
46
|
getProjectDealAsideFooter,
|
|
48
|
-
getManualDealAsideFooter
|
|
47
|
+
getManualDealAsideFooter,
|
|
48
|
+
getProjectDealStatusPill
|
|
49
49
|
} = adapter;
|
|
50
50
|
const [previewDeal, setPreviewDeal] = useState(null);
|
|
51
51
|
const resolvedCompletedEmptyMessage = typeof completedEmptyMessage === "function" ? completedEmptyMessage(currentProjectDeals.length > 0) : completedEmptyMessage;
|
|
52
|
-
const hasCompletedContent =
|
|
52
|
+
const hasCompletedContent = completedDeals.length > 0;
|
|
53
53
|
if (isLoading) {
|
|
54
54
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
55
55
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-full rounded-[10px]" }),
|
|
@@ -108,38 +108,39 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
108
108
|
collabHref: getCollabHref(deal.project_id),
|
|
109
109
|
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
110
110
|
resolveImageUrl,
|
|
111
|
-
asideFooter: getProjectDealAsideFooter?.(deal)
|
|
111
|
+
asideFooter: getProjectDealAsideFooter?.(deal),
|
|
112
|
+
statusPill: getProjectDealStatusPill?.(deal)
|
|
112
113
|
},
|
|
113
114
|
deal.project_id
|
|
114
115
|
)) }) : /* @__PURE__ */ jsx(DealEmptyState, { message: currentEmptyMessage }) }),
|
|
115
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ jsx(DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */
|
|
116
|
-
|
|
116
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ jsx(DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 sm:gap-0", children: completedDeals.map(
|
|
117
|
+
(item) => item.kind === "project" ? /* @__PURE__ */ jsx(
|
|
117
118
|
ProjectDealCard,
|
|
118
119
|
{
|
|
119
|
-
deal,
|
|
120
|
+
deal: item.deal,
|
|
120
121
|
isCompleted: true,
|
|
121
|
-
collabMembership: getCollabMembership(deal.project_id),
|
|
122
|
-
collabHref: getCollabHref(deal.project_id),
|
|
123
|
-
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
122
|
+
collabMembership: getCollabMembership(item.deal.project_id),
|
|
123
|
+
collabHref: getCollabHref(item.deal.project_id),
|
|
124
|
+
onCollabClick: getOnCollabClick?.(item.deal.project_id),
|
|
124
125
|
resolveImageUrl,
|
|
125
|
-
asideFooter: getProjectDealAsideFooter?.(deal)
|
|
126
|
+
asideFooter: getProjectDealAsideFooter?.(item.deal),
|
|
127
|
+
statusPill: getProjectDealStatusPill?.(item.deal)
|
|
126
128
|
},
|
|
127
|
-
deal.project_id
|
|
128
|
-
)
|
|
129
|
-
manualDeals.map((deal) => /* @__PURE__ */ jsx(
|
|
129
|
+
`project-${item.deal.project_id}`
|
|
130
|
+
) : /* @__PURE__ */ jsx(
|
|
130
131
|
ManualDealCard,
|
|
131
132
|
{
|
|
132
|
-
deal,
|
|
133
|
+
deal: item.deal,
|
|
133
134
|
onPreview: setPreviewDeal,
|
|
134
135
|
onEdit: onEditDeal,
|
|
135
136
|
onDelete: onDeleteDeal,
|
|
136
137
|
onOpenDocument,
|
|
137
138
|
resolveImageUrl,
|
|
138
|
-
asideFooter: getManualDealAsideFooter?.(deal)
|
|
139
|
+
asideFooter: getManualDealAsideFooter?.(item.deal)
|
|
139
140
|
},
|
|
140
|
-
deal.id
|
|
141
|
-
)
|
|
142
|
-
|
|
141
|
+
`manual-${item.deal.id}`
|
|
142
|
+
)
|
|
143
|
+
) }) })
|
|
143
144
|
] })
|
|
144
145
|
]
|
|
145
146
|
}
|
package/dist/marketing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n completedProjectDeals: ProjectDeal[];\n manualDeals: ManualDeal[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedProjectDeals,\n manualDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedProjectDeals.length > 0 || manualDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={true}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n />\n ))}\n {manualDeals.map((deal) => (\n <ManualDealCard\n key={deal.id}\n deal={deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,gBAAiD;AAE1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAiGD,SAwCI,UAvCF,KADF;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA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AQ;AAAA,kBACR,UAAU;AAAA,kBACV;AAAA,kBACA;AAAA,kBACA,aAAa,2BAA2B,IAAI;AAAA;AAAA,gBAPvC,KAAK;AAAA,cAQZ,CACD;AAAA,eACH,GAEJ;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AACtB,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAChC;AAAA,QACA,QACE,aACI,CAAC,SAAS;AAER,yBAAe,IAAI;AACnB,qBAAW,IAAI;AAAA,QACjB,IACA;AAAA,QAEN;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n /** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */\n completedDeals: ({ kind: \"project\"; deal: ProjectDeal } | { kind: \"manual\"; deal: ManualDeal })[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedDeals.map((item) =>\n item.kind === \"project\" ? (\n <ProjectDealCard\n key={`project-${item.deal.project_id}`}\n deal={item.deal}\n isCompleted={true}\n collabMembership={getCollabMembership(item.deal.project_id)}\n collabHref={getCollabHref(item.deal.project_id)}\n onCollabClick={getOnCollabClick?.(item.deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(item.deal)}\n statusPill={getProjectDealStatusPill?.(item.deal)}\n />\n ) : (\n <ManualDealCard\n key={`manual-${item.deal.id}`}\n deal={item.deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(item.deal)}\n />\n ),\n )}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,gBAAiD;AAE1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAqGD,SAwCI,UAvCF,KADF;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,aAAa,cAAc,IAAI,SAA4B,IAAI;AAEtE,QAAM,gCACJ,OAAO,0BAA0B,aAC7B,sBAAsB,oBAAoB,SAAS,CAAC,IACpD;AACN,QAAM,s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A;AAAA,IAEJ;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AACtB,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAChC;AAAA,QACA,QACE,aACI,CAAC,SAAS;AAER,yBAAe,IAAI;AACnB,qBAAW,IAAI;AAAA,QACjB,IACA;AAAA,QAEN;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nukleus-sports/page-shells",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": "^18 || ^19"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@nukleus-sports/ui-patterns": "^0.
|
|
43
|
+
"@nukleus-sports/ui-patterns": "^0.4.0",
|
|
44
44
|
"@nukleus-sports/ui-web": "^0.1.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|