@nukleus-sports/ui-patterns 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,37 +24,24 @@ interface RowActionsDropdownProps {
24
24
  trigger?: ReactNode;
25
25
  /** Trigger button extra classes. */
26
26
  triggerClassName?: string;
27
- /**
28
- * Extra classes on the menu content. Mainly for stacking: the menu defaults
29
- * to `z-[60]`, which sits below overlays such as `Sheet` (`z-[120]`), so a
30
- * dropdown opened inside one needs a higher `z-` here to render above it.
31
- */
27
+ /** Extra classes on the menu content -- e.g. a higher `z-` than the default
28
+ * `z-[60]` when nesting inside an overlay like `Sheet` (`z-[120]`). */
32
29
  contentClassName?: string;
33
30
  /** `align` prop on the popover content. Default `"end"`. */
34
31
  align?: "start" | "center" | "end";
35
32
  /** Aria label on the trigger button. */
36
33
  ariaLabel?: string;
37
- /**
38
- * Radix `modal` on the menu. Default `true`.
39
- *
40
- * Pass `false` when the dropdown lives inside a modal Dialog/Sheet: two
41
- * nested modal layers each lock `pointer-events` on `document.body` and each
42
- * register a dismissable layer, so on touch the tap that opens the menu is
43
- * then read as an outside-press and closes it again — the trigger looks dead.
44
- */
34
+ /** Radix `modal` on the menu, default `true`. Pass `false` inside another modal
35
+ * Dialog/Sheet -- two nested modal layers otherwise make the trigger look dead on touch. */
45
36
  modal?: boolean;
46
37
  }
47
38
  /**
48
- * Canonical "row actions" dropdown — replaces the repeated
49
- * MoreIcon trigger + popover-styled content + Edit/Delete items pattern.
39
+ * Canonical row-actions dropdown (MoreIcon trigger + Edit/Delete items).
50
40
  *
51
41
  * @example
52
42
  * <RowActionsDropdown
53
43
  * ariaLabel={`Actions for ${row.name}`}
54
- * actions={[
55
- * { label: "Edit", onClick: () => onEdit(row) },
56
- * { label: "Delete", onClick: () => onDelete(row.id), destructive: true },
57
- * ]}
44
+ * actions={[{ label: "Edit", onClick: () => onEdit(row) }]}
58
45
  * />
59
46
  */
60
47
  declare function RowActionsDropdown({ actions, trigger, triggerClassName, contentClassName, align, ariaLabel, modal, }: RowActionsDropdownProps): react.JSX.Element | null;
@@ -67,42 +54,10 @@ interface DealEmptyStateProps {
67
54
  /** Optional override/extension for the message text's classes. */
68
55
  messageClassName?: string;
69
56
  }
70
- /**
71
- * Empty-state placeholder for a deals list (marketing deals tab/page).
72
- *
73
- * Extracted from two independent, non-exported local components:
74
- * - nukleus-app's `MarketingDealsTab.tsx` (`text-[14px] text-text-primary`)
75
- * - nukleus-clientapp's `Marketing.tsx` (`body-text text-text-secondary`)
76
- *
77
- * Both apps already agree on the `{ message: string }` shape and layout; the text
78
- * styling genuinely diverged. This uses clientapp's version as the default — it
79
- * reaches for the shared `body-text` typography primitive instead of a magic
80
- * `text-[14px]`, and dims the copy with `text-secondary`, which reads better for
81
- * empty-state messaging than the higher-emphasis `text-primary` nukleus-app used.
82
- * `messageClassName` is exposed so either app can override back to its prior look
83
- * if that divergence turns out to matter at the call site.
84
- */
57
+ /** Empty-state placeholder for a deals list (marketing deals tab/page).
58
+ * Reconciled from both apps -- see RECONCILIATION.md#deal-empty-statetsx */
85
59
  declare function DealEmptyState({ message, className, messageClassName }: DealEmptyStateProps): react.JSX.Element;
86
60
 
87
- /**
88
- * Reconciled from two near-identical implementations (clientapp's own file
89
- * comment already said "Mirrors nukleus-app's ContractDetailsCard"):
90
- * - nukleus-app's version had optional `title`/`caption` props (defaulting
91
- * to "Contract Details", no caption) -- kept as a strict superset,
92
- * clientapp's callers simply never pass them.
93
- * - clientapp's due-date formatting was a local `date-fns`-based helper
94
- * producing "MMM dd, yyyy" (zero-padded day); this uses `@nukleus-sports/
95
- * core`'s existing `formatDealDate` ("MMM d, yyyy", no zero-padding)
96
- * instead of introducing a second date formatter for one field -- the
97
- * day-padding difference is cosmetic.
98
- *
99
- * Found missing from this package entirely while wiring the Marketing Deals
100
- * Layer 5 retrofit into both apps: both apps' real `MarketingDealMetadata`
101
- * already has an identical `contract_details` shape (read from an uploaded
102
- * contract via each app's own AI extraction flow), and both apps' local
103
- * `ManualDealPreviewDialog`s already rendered this card -- a genuine
104
- * duplicate that simply hadn't been ported yet, not a single-app feature.
105
- */
106
61
  interface ContractDetailsCardDeliverable {
107
62
  description: string;
108
63
  due_date: string | null;
@@ -132,80 +87,11 @@ interface ContractDetailsCardProps {
132
87
  caption?: string;
133
88
  className?: string;
134
89
  }
135
- /**
136
- * Contract terms the deal form has no field for (territory, exclusivity,
137
- * payment terms, usage rights, deliverables, warnings), read from the
138
- * uploaded contract. Read-only; rows without a value are left out.
139
- */
90
+ /** Contract terms read from the uploaded contract. Read-only; empty rows are left out. */
140
91
  declare function ContractDetailsCard({ details, title, caption, className, }: ContractDetailsCardProps): react.JSX.Element;
141
92
 
142
- /**
143
- * Reconciled from two independent implementations:
144
- * - nukleus-app's `ManualDealCard.tsx` — superset: has Edit/Delete, a raw
145
- * `DropdownMenu` + `MoreIcon` trigger, an explicit "Preview Doc" quick-open
146
- * affordance next to the brand name, and an entirely separate collapsible
147
- * mobile layout (chevron + brand/amount summary row, expanding to a "View
148
- * Details"/"Preview Doc" footer).
149
- * - nukleus-clientapp's `ManualDealCard.tsx` — read-only subset: no Edit/Delete,
150
- * already uses a shared `RowActionsDropdown` (single "Preview Deal" action),
151
- * no "Preview Doc" affordance on the card at all, and no distinct mobile
152
- * layout (always renders the "desktop" row).
153
- *
154
- * Union, not intersection:
155
- * - `onEdit`/`onDelete` are optional — omitting either simply drops that row
156
- * action, which is exactly how clientapp's read-only usage degrades.
157
- * - The "Preview Doc" quick-open link is kept (additive from nukleus-app) and
158
- * gated on both a resolved document *and* `onOpenDocument` being supplied.
159
- * - The collapsible mobile layout is kept (additive from nukleus-app, and not
160
- * actually mentioned by the rollout-plan doc — found by reading the source).
161
- * It's implemented with Tailwind `sm:` responsive classes (both layouts are
162
- * in the DOM, toggled by `hidden`/`sm:hidden`) rather than a JS viewport
163
- * hook, so this stays free of any store/router dependency.
164
- *
165
- * Genuine conflicts resolved (not just formatting):
166
- * - Lead-agent avatar `entityType`: nukleus-app used `"agency"` while passing
167
- * only a flattened `name` string (no `firstName`/`lastName`). `EntityAvatar`'s
168
- * `"agency"` initials fallback reads `firstName`/`lastName`, not `name` — so
169
- * nukleus-app's original call site would always fall back to "?" for any
170
- * lead agent without a profile photo. clientapp used `"initials"`, which
171
- * correctly derives initials from a plain `name` string. This component uses
172
- * `"initials"` (clientapp's choice), both to fix that latent bug and because
173
- * this component only ever receives a flattened `lead_agent_name` string.
174
- * - Lead-agent name formatting: nukleus-app abbreviated it via a local
175
- * `getInitialFullName(name, null, true)` helper to "J. Smith"; clientapp
176
- * rendered the full name as-is. That abbreviation helper isn't part of this
177
- * design system and is a display nicety, not core behavior, so this
178
- * component renders `lead_agent_name` verbatim (clientapp's behavior). An
179
- * adapter that wants the abbreviated form can format the string itself
180
- * before passing it in.
181
- * - Brand avatar size: nukleus-app hard-coded `w-[34px] h-[34px]` on top of
182
- * `size="sm"` (overriding the scale to a bespoke value); clientapp left the
183
- * standard `size="sm"` (24px) in place. Kept clientapp's behavior — fighting
184
- * a documented size step with a one-off pixel override is the smell here,
185
- * not the other way around. `className` is still exposed if 34px turns out
186
- * to be the intentional spec.
187
- *
188
- * Revisited after this component shipped: clientapp's real `ManualDealCard`
189
- * has since converged onto the same aside/tracking-row/payment-footer shape
190
- * `ProjectDealCard` already had (its `DealAside`/`DealDesktopCard` are shared
191
- * between both of its card types), independently of this package. Ported
192
- * into the desktop layout: a status pill (always literal "Complete" — a past
193
- * deal has no Active/Upcoming state, so this isn't `ProjectDealCard`'s own
194
- * `statusLabel()`), a Client/Agency/Third-Party-paid tracking row (always
195
- * `done` — a past deal is definitionally fully settled, same as clientapp's
196
- * `getPastDealPaymentProgress`'s synthetic fully-paid values), and a payment
197
- * progress footer (always 100%, "Fully Paid"). `asideFooter` is the same
198
- * generic slot `ProjectDealCard` has, for clientapp's per-deal commission
199
- * line ("$X to you · Y% agency commission") — this package has no opinion on
200
- * what goes there. Desktop only for now; the mobile layout's structure
201
- * doesn't share clientapp's `DealMobileCard`/`DealCollectedSummary`
202
- * abstraction the way the desktop one does, a separate, bigger gap left for
203
- * its own decision later.
204
- */
205
93
  interface ManualDealDocumentRef {
206
- /** Resolved, directly-fetchable URL for the attached document — a signed/serve
207
- * URL (nukleus-app) or a public URL (clientapp), whatever the host app's
208
- * adapter resolves it to. */
94
+ /** Resolved, directly-fetchable URL; the adapter decides how to get there. */
209
95
  url: string;
210
96
  /** Display name for the document, when known. */
211
97
  name?: string | null;
@@ -230,17 +116,12 @@ interface ManualDealMetadata {
230
116
  notes?: string | null;
231
117
  document_name?: string | null;
232
118
  document_url?: string | null;
233
- /** nukleus-app-only shape for an internally-uploaded document; clientapp
234
- * never populates this and relies solely on the flattened `document_*` pair. */
235
119
  uploaded_document?: {
236
120
  name: string;
237
121
  url: string;
238
122
  } | null;
239
- /** The current field for the preview dialog's "Contract Summary" section.
240
- * `notes` is the legacy key for rows written before this field existed. */
123
+ /** Current "Contract Summary" field; `notes` is the legacy key it replaced. */
241
124
  summary?: string | null;
242
- /** Terms read from the uploaded contract via each app's own AI extraction
243
- * flow. Both apps' real data already has this identical shape. */
244
125
  contract_details?: MarketingDealContractDetails | null;
245
126
  }
246
127
  interface ManualDeal {
@@ -248,38 +129,23 @@ interface ManualDeal {
248
129
  metadata: ManualDealMetadata;
249
130
  company_name?: string | null;
250
131
  company_avatar_url?: string | null;
251
- /** Pre-resolved display name for the deal's lead agent. nukleus-app derives
252
- * this from `lead_agent_profile ?? created_by_profile`; clientapp already
253
- * has it flattened. Resolving which profile wins is adapter work, not this
254
- * component's — it only ever renders the final string. */
132
+ /** Pre-resolved by the adapter -- this component only ever renders the string. */
255
133
  lead_agent_name?: string | null;
256
134
  lead_agent_avatar_url?: string | null;
257
135
  }
258
- /** Resolves the one attached document, whichever of the two historical shapes
259
- * it was stored under. Returns `null` when the deal has no document, in which
260
- * case neither this card nor `ManualDealPreviewDialog` render a document
261
- * affordance. */
136
+ /** Resolves the attached document from either historical shape. Returns `null` if none. */
262
137
  declare function resolveDealDocument(meta: ManualDealMetadata): ManualDealDocumentRef | null;
263
138
  interface ManualDealCardProps {
264
139
  deal: ManualDeal;
265
140
  onPreview: (deal: ManualDeal) => void;
266
- /** Omit to hide the "Edit" row action entirely (clientapp's read-only usage). */
141
+ /** Omit to hide the "Edit" row action entirely. */
267
142
  onEdit?: (deal: ManualDeal) => void;
268
- /** Omit to hide the "Delete" row action entirely (clientapp's read-only usage). */
143
+ /** Omit to hide the "Delete" row action entirely. */
269
144
  onDelete?: (deal: ManualDeal) => void;
270
- /** Required only insofar as a document is actually attached — the "Preview
271
- * Doc" link only renders when both a document resolves (see
272
- * `resolveDealDocument`) and this is supplied. Never call `window.open()` or
273
- * a document-fetch service directly from this package. */
145
+ /** Renders the "Preview Doc" link only once a document resolves and this is supplied. */
274
146
  onOpenDocument?: (doc: ManualDealDocumentRef) => void;
275
- /** Passed straight through to this card's `EntityAvatar` instances. See
276
- * `EntityImageResolver` for why this package can't resolve storage paths
277
- * itself. */
278
147
  resolveImageUrl?: EntityImageResolver;
279
- /** Rendered at the end of the desktop layout's amount/status column,
280
- * after the status pill -- e.g. a commission breakdown. Same slot as
281
- * `ProjectDealCard`'s `asideFooter`; this package has no opinion on what
282
- * goes here. Desktop only for now -- see module doc. */
148
+ /** Rendered at the end of the desktop amount/status column, e.g. a commission breakdown. */
283
149
  asideFooter?: ReactNode;
284
150
  className?: string;
285
151
  }
@@ -289,147 +155,16 @@ interface ManualDealPreviewDialogProps {
289
155
  deal: ManualDeal | null;
290
156
  open: boolean;
291
157
  onOpenChange: (open: boolean) => void;
292
- /** Omit to hide the "Edit Deal" footer button entirely (clientapp's
293
- * read-only usage). */
158
+ /** Omit to hide the "Edit Deal" footer button entirely. */
294
159
  onEdit?: (deal: ManualDeal) => void;
295
- /** Never call `window.open()` or a document-fetch service directly from
296
- * this package — see the file-level comment for why the two source apps'
297
- * behavior couldn't be unified here. */
160
+ /** Required: document-opening behavior differs per host app, so it's always adapter-supplied. */
298
161
  onOpenDocument: (doc: ManualDealDocumentRef) => void;
299
- /** Photo of the client whose page this deal is viewed from, shown beside
300
- * "Client Name". Omit to show just the name (no avatar). */
162
+ /** Photo of the client whose page this deal is viewed from. Omit to show just the name. */
301
163
  clientImageUrl?: string | null;
302
- /** Passed straight through to this dialog's `EntityAvatar` instances. */
303
164
  resolveImageUrl?: EntityImageResolver;
304
165
  }
305
166
  declare function ManualDealPreviewDialog({ deal, open, onOpenChange, onEdit, onOpenDocument, clientImageUrl, resolveImageUrl, }: ManualDealPreviewDialogProps): react.JSX.Element | null;
306
167
 
307
- /**
308
- * Reconciled from two independent implementations:
309
- * - nukleus-app's `ProjectDealCard.tsx` — superset: gates the "Collab"
310
- * link/badge on project membership, has a demo-mode fallback (non-member
311
- * -of-org "explorable" projects swap the link for a toast-triggering
312
- * button), shows a "N of M payments" line, and has an entirely separate
313
- * collapsible mobile layout (chevron + brand/amount summary row, expanding
314
- * to stats/progress/footer).
315
- * - nukleus-clientapp's `ProjectDealCard.tsx` — no membership gate at all (see
316
- * bug below), no demo-mode concept, no payments-count line, and a single
317
- * layout used at every viewport width, with its own more defensive
318
- * responsive wrapping for the tracking row.
319
- *
320
- * ## Confirmed bug: unconditional "Collab" link (fixed here)
321
- * nukleus-app calls `useGetProjectMembersQuery` and only renders the "Collab"
322
- * footer link when the current user `isProjectMember`; clientapp's card has
323
- * **no membership gate at all** — the link renders unconditionally. A
324
- * clientapp user linked to the org but not individually added as a
325
- * `project_members` row can click through to a project detail page that then
326
- * immediately bounces them for failing its own membership check. Confirmed by
327
- * reading both files in full; this is not a reconciliation artifact.
328
- *
329
- * This package can't import RTK Query (no data-fetching in a shared
330
- * presentational component), so the membership check itself has to live in
331
- * each app's adapter/hook. To stop a call site from ever *forgetting* that
332
- * check — or from treating "still loading" as "show the link", which is the
333
- * exact shape of bug clientapp shipped — `collabMembership` is a **required,
334
- * explicit tri-state** (`"loading" | "member" | "not-member"`) rather than an
335
- * optional boolean:
336
- * - Required means omitting it is a type error, not a silent default.
337
- * - Tri-state means there is no boolean "both missing and false look the
338
- * same" ambiguity — "loading" is its own named state, and this component
339
- * treats it identically to "not-member" (hidden), which is also exactly
340
- * nukleus-app's original runtime behavior (`!!members?.find(...)` is
341
- * `false` while `members` is still `undefined`). The link can only ever
342
- * render when the caller has explicitly resolved and supplied `"member"`.
343
- * A plain `isProjectMember?: boolean` was considered and rejected — making
344
- * it required-but-boolean still lets a lazy adapter write
345
- * `isProjectMember={someQuery.data?.find(...) !== undefined}` without ever
346
- * having had to name the loading state, whereas the tri-state forces that
347
- * decision into the open at the call site.
348
- *
349
- * ## Mobile accordion
350
- * Verified nukleus-app's collapsed/expanded mobile behavior is real
351
- * open/closed state (a chevron button toggles `isExpanded`), not just a
352
- * responsive layout swap — but that's exactly what `ManualDealCard` (this
353
- * same directory) already does: Tailwind `sm:hidden`/`hidden sm:flex` decides
354
- * *which* layout is in the DOM, and a local `useState` drives the
355
- * expand/collapse *within* the mobile one. Ported faithfully using that same
356
- * established convention, so this stays store/router-free. The mobile
357
- * layout's own card chrome (bordered, rounded, standalone) and the desktop
358
- * layout's chrome (flush list row, `border-b`) are genuinely different
359
- * between the two apps' originals and are kept as-is rather than forced
360
- * under one shared wrapper style.
361
- *
362
- * ## Other genuine conflicts resolved (not formatting)
363
- * - Tracking row on tablet widths: nukleus-app hides the whole
364
- * deliverables/paid-status row between `sm` and `xl` (`hidden xl:flex`) —
365
- * real content just disappears at tablet widths. clientapp solves the same
366
- * "N items don't fit in a row" problem by reflowing into a responsive grid
367
- * instead (`grid grid-cols-2 md:grid-cols-3 lg:flex`), never hiding it.
368
- * Kept clientapp's grid — it's strictly better (no hidden content) and
369
- * doesn't conflict with keeping the mobile accordion, since the accordion
370
- * only applies below `sm` and this row only applies at `sm` and up.
371
- * - Lead/owner avatar `entityType`: same latent bug as `ManualDealCard` —
372
- * nukleus-app used `"agency"` while only ever passing a flattened `name`
373
- * (not `firstName`/`lastName`, which is what `"agency"` initials read), so
374
- * it always fell back to "?" for an owner with no photo. clientapp used
375
- * `"initials"`, which correctly derives initials from `name`. Kept
376
- * `"initials"`, same reasoning as `ManualDealCard`.
377
- * - Owner name abbreviation: originally reconciled as "render verbatim"
378
- * (clientapp's behavior when this file was first built). Revisited when
379
- * clientapp's `ProjectDealCard.tsx` was found to have since grown its own
380
- * `getInitialFullName(name, null, true)` abbreviation ("J. Smith") --
381
- * matching what nukleus-app's (by-then-retired) local component already
382
- * did. Both apps' real current behavior agrees, so this renders abbreviated
383
- * via `@nukleus-sports/core`'s `abbreviatePersonName` (the `EntityAvatar`
384
- * still gets the raw `owner_name` for initials -- only the visible text
385
- * span is abbreviated, same split as both apps' originals).
386
- * - Owner-name empty fallback: nukleus-app used a literal `"--"`; clientapp
387
- * used `"—"` (em dash). `formatDealDate` (from `@nukleus-sports/core`)
388
- * already established "—" as this design system's missing-value sentinel,
389
- * so that's what's used here instead of introducing a second glyph.
390
- * - Brand avatar size: nukleus-app hard-coded `w-[34px] h-[34px]` on top of
391
- * `size="sm"`; clientapp left the standard `size="sm"` (24px) in place.
392
- * Kept clientapp's behavior, same reasoning as `ManualDealCard`.
393
- * - Owner avatar size: nukleus-app used `size="sm"` for the owner's
394
- * `EntityAvatar`; clientapp used `size="xs"`. Kept `"sm"` — it's what
395
- * `ManualDealCard`'s own lead-agent avatar (the equivalent "who owns this"
396
- * row in this same package) already established, and consistency across
397
- * this package's cards outweighs either single original's choice.
398
- * - "Complete" vs "Completed" status label: nukleus-app relabels the
399
- * `"Complete"` status to "Completed" in its badge text (both its layouts);
400
- * clientapp renders the raw status value. Kept nukleus-app's relabel (it's
401
- * the grammatically correct one) and, since "Completed" is longer than
402
- * clientapp's fixed `w-[104px]` badge was sized for, dropped that fixed
403
- * width in favor of nukleus-app's auto-sized badge so the longer label
404
- * never clips.
405
- * - Collected-amount trailing space: nukleus-app's template literal leaves a
406
- * trailing space when `total_collected` is 0 (`` `${fmtUSD(...)} ` ``
407
- * with an empty suffix); clientapp's has no such gap. Kept clientapp's.
408
- * - First footer span's flex sizing: clientapp adds `min-w-0` alongside
409
- * `flex-1` so `truncate`/wrapping actually engages instead of overflowing
410
- * the card; nukleus-app's omits it. Kept clientapp's (a strict fix, same
411
- * `min-w-0` reasoning already documented in `ManualDealCard`/`TrackingItem`).
412
- * - "N of M payments" line: only nukleus-app's RPC/type returns
413
- * `payments_total`/`payments_paid` — clientapp's doesn't have these fields
414
- * and never rendered the line. Kept as an *additive* capability gated on
415
- * both fields being supplied, rather than dropped or forced to be required.
416
- * - Demo-mode link/button swap: nukleus-app swaps the "Collab" link for a
417
- * plain button that triggers a demo-limit toast when a project isn't
418
- * "explorable" in demo mode. `isDemoMode`/`showDemoLimitToast` are
419
- * app-internal concepts this package can't import. Generalized into
420
- * `onCollabClick`: when supplied, the "Collab" affordance renders as a
421
- * `<button>` calling it instead of an `<a href>` — nukleus-app's adapter
422
- * can wire its demo-mode toast through this; clientapp simply never passes
423
- * it and always gets a real link.
424
- * - Commission line: clientapp renders a per-deal commission breakdown
425
- * ("$X to you · Y% agency commission") in the aside column, after the
426
- * status pill; nukleus-app has no equivalent at all. Rather than teach
427
- * this package the concept of a commission, `asideFooter` is a generic
428
- * slot rendered in that exact spot — nukleus-app simply never passes it.
429
- *
430
- * No icon needed inlining — `ArrowDownFormIcon`, `CheckRingRoundIcon`, and
431
- * `XsViewInvoiceIcon` are all already in `@nukleus-sports/icons`.
432
- */
433
168
  interface ProjectDeal {
434
169
  project_id: string;
435
170
  project_title: string;
@@ -448,8 +183,8 @@ interface ProjectDeal {
448
183
  total_equity_shares: number;
449
184
  deliverables_total: number;
450
185
  deliverables_met: number;
451
- /** Only present in nukleus-app's RPC today — clientapp's doesn't return
452
- * these. The "N of M payments" line only renders when both are supplied. */
186
+ /** Only one app's RPC returns these; the "N of M payments" line only
187
+ * renders when both are supplied. */
453
188
  payments_total?: number;
454
189
  payments_paid?: number;
455
190
  client_paid: boolean;
@@ -458,33 +193,24 @@ interface ProjectDeal {
458
193
  third_party_paid: boolean;
459
194
  }
460
195
  /**
461
- * Tri-state result of the caller's own project-membership check (see the
462
- * module doc above for why this is required and not an optional boolean).
463
- * `"loading"` and `"not-member"` are both treated as "hide the Collab
464
- * affordance" — only `"member"` ever shows it.
196
+ * Required tri-state, not an optional boolean, so a caller must name "loading"
197
+ * explicitly instead of treating it the same as "not a member" by default.
465
198
  */
466
199
  type ProjectCollabMembership = "loading" | "member" | "not-member";
467
200
  interface ProjectDealCardProps {
468
201
  deal: ProjectDeal;
469
202
  isCompleted: boolean;
470
- /** Required — see module doc. Gates every "Collab"/"Collab Hub" affordance
471
- * on this card. */
203
+ /** Gates every "Collab"/"Collab Hub" affordance; see `ProjectCollabMembership`. */
472
204
  collabMembership: ProjectCollabMembership;
473
- /** Destination for the "Collab"/"Collab Hub" link, e.g.
474
- * `/projects/${deal.project_id}?tab=overview`. Rendered as a plain
475
- * `<a href>` — never a `react-router` `Link` — so this package carries no
476
- * router dependency. */
205
+ /** Rendered as a plain `<a href>`, never a router `Link` -- this package
206
+ * carries no router dependency. */
477
207
  collabHref: string;
478
- /** Supply to replace the `<a href={collabHref}>` with a `<button>` that
479
- * calls this instead (e.g. nukleus-app's demo-mode upsell toast for a
480
- * non-"explorable" project). Omit for a normal link. */
208
+ /** Swaps the Collab affordance from a link to a `<button>` calling this
209
+ * (e.g. a demo-mode upsell toast). Omit for a normal link. */
481
210
  onCollabClick?: (e: MouseEvent<HTMLButtonElement>) => void;
482
- /** Passed straight through to this card's `EntityAvatar` instances. */
483
211
  resolveImageUrl?: EntityImageResolver;
484
- /** Rendered at the end of the amount/status column, after the status pill
485
- * -- e.g. a commission breakdown. This package has no opinion on what
486
- * goes here (clientapp's real cards render a commission line nukleus-app
487
- * has no equivalent for at all); omit for nothing extra. */
212
+ /** Generic slot after the status pill (e.g. a commission breakdown); this
213
+ * package has no opinion on its content. */
488
214
  asideFooter?: ReactNode;
489
215
  className?: string;
490
216
  }