@nukleus-sports/ui-patterns 0.1.1 → 0.2.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 +412 -245
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.d.cts +110 -9
- package/dist/marketing.d.ts +110 -9
- package/dist/marketing.js +401 -230
- package/dist/marketing.js.map +1 -1
- package/package.json +2 -2
package/dist/marketing.js
CHANGED
|
@@ -318,12 +318,154 @@ function DealEmptyState({ message, className, messageClassName }) {
|
|
|
318
318
|
) });
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
// src/marketing/contract-details-card.tsx
|
|
322
|
+
import { cn as cn4 } from "@nukleus-sports/ui-web";
|
|
323
|
+
import { formatDealDate } from "@nukleus-sports/core";
|
|
324
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
325
|
+
function Row({ label, children }) {
|
|
326
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
327
|
+
/* @__PURE__ */ jsx4("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: label }),
|
|
328
|
+
/* @__PURE__ */ jsx4("div", { className: "body-text text-text-primary whitespace-pre-wrap break-words font-ss02-ss05", children })
|
|
329
|
+
] });
|
|
330
|
+
}
|
|
331
|
+
function usageAfterTerm({
|
|
332
|
+
usage_after_term_days: days
|
|
333
|
+
}) {
|
|
334
|
+
if (days == null) return null;
|
|
335
|
+
return days === 1 ? "1 day after the term" : `${days} days after the term`;
|
|
336
|
+
}
|
|
337
|
+
function ContractDetailsCard({
|
|
338
|
+
details,
|
|
339
|
+
title = "Contract Details",
|
|
340
|
+
caption,
|
|
341
|
+
className
|
|
342
|
+
}) {
|
|
343
|
+
const usage = usageAfterTerm(details);
|
|
344
|
+
const exclusive = details.is_exclusive == null ? null : details.is_exclusive ? "Exclusive" : "Not exclusive";
|
|
345
|
+
return /* @__PURE__ */ jsxs3(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
className: cn4(
|
|
349
|
+
"flex w-full flex-col gap-4 rounded-[10px] border border-grey-strokes-tables bg-card px-4 py-3",
|
|
350
|
+
className
|
|
351
|
+
),
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
|
|
354
|
+
/* @__PURE__ */ jsx4("h3", { className: "header-xl-medium-card text-text-primary font-ss02-ss05", children: title }),
|
|
355
|
+
caption && /* @__PURE__ */ jsx4("p", { className: "label-xs-text text-text-secondary", children: caption })
|
|
356
|
+
] }),
|
|
357
|
+
details.warnings.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 rounded-[10px] bg-semantic-color-status-priority-in-progress-warm-fill px-3 py-2", children: [
|
|
358
|
+
/* @__PURE__ */ jsxs3("span", { className: "label-base-medium text-semantic-color-status-priority-in-progress-warm-copy", children: [
|
|
359
|
+
"Worth checking (",
|
|
360
|
+
details.warnings.length,
|
|
361
|
+
")"
|
|
362
|
+
] }),
|
|
363
|
+
details.warnings.map((warning, index) => /* @__PURE__ */ jsxs3(
|
|
364
|
+
"p",
|
|
365
|
+
{
|
|
366
|
+
className: "body-text text-semantic-color-status-priority-in-progress-warm-copy break-words",
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsx4("span", { className: "font-medium", children: warning.issue }),
|
|
369
|
+
warning.detail && /* @__PURE__ */ jsxs3("span", { children: [
|
|
370
|
+
": ",
|
|
371
|
+
warning.detail
|
|
372
|
+
] })
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
`${warning.issue}-${index}`
|
|
376
|
+
))
|
|
377
|
+
] }),
|
|
378
|
+
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
379
|
+
details.territory && /* @__PURE__ */ jsx4(Row, { label: "Territory", children: details.territory }),
|
|
380
|
+
details.contracting_entity && /* @__PURE__ */ jsx4(Row, { label: "Contracting Entity", children: details.contracting_entity }),
|
|
381
|
+
exclusive && /* @__PURE__ */ jsx4(Row, { label: "Exclusivity", children: exclusive }),
|
|
382
|
+
usage && /* @__PURE__ */ jsx4(Row, { label: "Usage After Term", children: usage })
|
|
383
|
+
] }),
|
|
384
|
+
details.exclusivity && /* @__PURE__ */ jsx4(Row, { label: "Exclusivity Terms", children: details.exclusivity }),
|
|
385
|
+
details.payment_terms && /* @__PURE__ */ jsx4(Row, { label: "Payment Terms", children: details.payment_terms }),
|
|
386
|
+
details.usage_after_term && /* @__PURE__ */ jsx4(Row, { label: "Usage Rights", children: details.usage_after_term }),
|
|
387
|
+
details.deliverables.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
|
|
388
|
+
/* @__PURE__ */ jsxs3("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: [
|
|
389
|
+
"Deliverables (",
|
|
390
|
+
details.deliverables.length,
|
|
391
|
+
")"
|
|
392
|
+
] }),
|
|
393
|
+
/* @__PURE__ */ jsx4("ul", { className: "flex flex-col divide-y divide-greys-grey-strokes-tables rounded-[10px] border border-greys-grey-strokes-tables", children: details.deliverables.map((deliverable, index) => /* @__PURE__ */ jsxs3(
|
|
394
|
+
"li",
|
|
395
|
+
{
|
|
396
|
+
className: "flex flex-col gap-1 px-3 py-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4",
|
|
397
|
+
children: [
|
|
398
|
+
/* @__PURE__ */ jsxs3("span", { className: "min-w-0 body-text text-text-primary break-words", children: [
|
|
399
|
+
deliverable.units != null && deliverable.units > 1 && /* @__PURE__ */ jsxs3("span", { className: "font-medium", children: [
|
|
400
|
+
deliverable.units,
|
|
401
|
+
" \xD7 "
|
|
402
|
+
] }),
|
|
403
|
+
deliverable.description
|
|
404
|
+
] }),
|
|
405
|
+
deliverable.due_date && /* @__PURE__ */ jsxs3("span", { className: "label-xs-text text-text-secondary whitespace-nowrap", children: [
|
|
406
|
+
"Due ",
|
|
407
|
+
formatDealDate(deliverable.due_date)
|
|
408
|
+
] })
|
|
409
|
+
]
|
|
410
|
+
},
|
|
411
|
+
`${deliverable.description}-${index}`
|
|
412
|
+
)) })
|
|
413
|
+
] })
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
|
|
321
419
|
// src/marketing/manual-deal-card.tsx
|
|
322
420
|
import { useState } from "react";
|
|
323
|
-
import { Button as Button2, cn as
|
|
421
|
+
import { Button as Button2, cn as cn6 } from "@nukleus-sports/ui-web";
|
|
324
422
|
import { ArrowDownFormIcon, XsViewInvoiceIcon } from "@nukleus-sports/icons";
|
|
325
|
-
import { fmtUSDWhole, formatDealDate } from "@nukleus-sports/core";
|
|
326
|
-
|
|
423
|
+
import { fmtUSD, fmtUSDWhole, formatDealDate as formatDealDate2 } from "@nukleus-sports/core";
|
|
424
|
+
|
|
425
|
+
// src/marketing/deal-card-parts.tsx
|
|
426
|
+
import { cn as cn5 } from "@nukleus-sports/ui-web";
|
|
427
|
+
import { CheckRingRoundIcon } from "@nukleus-sports/icons";
|
|
428
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
429
|
+
var STATUS_STYLES = {
|
|
430
|
+
Active: "bg-semantic-color-status-priority-cold-fill text-semantic-color-status-priority-cold-copy",
|
|
431
|
+
Upcoming: "bg-semantic-color-status-priority-in-progress-warm-fill text-semantic-color-status-priority-in-progress-warm-copy",
|
|
432
|
+
Complete: "bg-semantic-color-status-priority-completed-fill text-semantic-color-status-priority-completed-copy"
|
|
433
|
+
};
|
|
434
|
+
function TrackingItem({ label, done }) {
|
|
435
|
+
return (
|
|
436
|
+
// `min-w-0` lets `truncate` below actually engage instead of overflowing
|
|
437
|
+
// the card; `lg:flex-initial` + `max-lg:whitespace-normal` let a label
|
|
438
|
+
// like "Deliverables met - 0/4" wrap in the grid instead of being
|
|
439
|
+
// squeezed to an equal share. (clientapp's version — see ProjectDealCard's
|
|
440
|
+
// module doc.)
|
|
441
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 gap-2 items-center lg:flex-initial", children: [
|
|
442
|
+
/* @__PURE__ */ jsx5(
|
|
443
|
+
CheckRingRoundIcon,
|
|
444
|
+
{
|
|
445
|
+
width: 12,
|
|
446
|
+
height: 12,
|
|
447
|
+
className: cn5(
|
|
448
|
+
"shrink-0 transition-opacity",
|
|
449
|
+
done ? "text-primary-color-nuk-ui-elem" : "opacity-0"
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ jsx5(
|
|
454
|
+
"span",
|
|
455
|
+
{
|
|
456
|
+
className: cn5(
|
|
457
|
+
"label-xs-table truncate max-lg:whitespace-normal",
|
|
458
|
+
done ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
459
|
+
),
|
|
460
|
+
children: label
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] })
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// src/marketing/manual-deal-card.tsx
|
|
468
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
327
469
|
function resolveDealDocument(meta) {
|
|
328
470
|
const url = meta.uploaded_document?.url ?? meta.document_url ?? null;
|
|
329
471
|
if (!url) return null;
|
|
@@ -336,17 +478,18 @@ function ManualDealCard({
|
|
|
336
478
|
onDelete,
|
|
337
479
|
onOpenDocument,
|
|
338
480
|
resolveImageUrl,
|
|
481
|
+
asideFooter,
|
|
339
482
|
className
|
|
340
483
|
}) {
|
|
341
484
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
342
485
|
const meta = deal.metadata;
|
|
343
486
|
const brandName = meta.brand_name;
|
|
344
|
-
const startDate =
|
|
345
|
-
const endDate =
|
|
487
|
+
const startDate = formatDealDate2(meta.start_date);
|
|
488
|
+
const endDate = formatDealDate2(meta.end_date);
|
|
346
489
|
const dateRange = [startDate, endDate].filter((d) => Boolean(d) && d !== "\u2014").join(" - ");
|
|
347
490
|
const metaLine = [meta.deal_category, dateRange].filter(Boolean).join(" \u2022 ");
|
|
348
491
|
const doc = resolveDealDocument(meta);
|
|
349
|
-
const previewDocButton = doc && onOpenDocument && /* @__PURE__ */
|
|
492
|
+
const previewDocButton = doc && onOpenDocument && /* @__PURE__ */ jsxs5(
|
|
350
493
|
Button2,
|
|
351
494
|
{
|
|
352
495
|
variant: "unstyled",
|
|
@@ -359,7 +502,7 @@ function ManualDealCard({
|
|
|
359
502
|
},
|
|
360
503
|
children: [
|
|
361
504
|
"Preview Doc",
|
|
362
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ jsx6(XsViewInvoiceIcon, { className: "size-[18px] p-[1px] flex justify-center items-center" })
|
|
363
506
|
]
|
|
364
507
|
}
|
|
365
508
|
);
|
|
@@ -373,18 +516,18 @@ function ManualDealCard({
|
|
|
373
516
|
when: Boolean(onDelete)
|
|
374
517
|
}
|
|
375
518
|
];
|
|
376
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ jsxs5(
|
|
377
520
|
"div",
|
|
378
521
|
{
|
|
379
|
-
className:
|
|
522
|
+
className: cn6(
|
|
380
523
|
"bg-card border-b last:border-b-0 border-grey-strokes-tables w-full font-ss02",
|
|
381
524
|
className
|
|
382
525
|
),
|
|
383
526
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col sm:hidden", children: [
|
|
528
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start p-2 justify-between flex-[1_0_0]", children: [
|
|
529
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-1 items-start", children: [
|
|
530
|
+
/* @__PURE__ */ jsx6(
|
|
388
531
|
Button2,
|
|
389
532
|
{
|
|
390
533
|
variant: "unstyled",
|
|
@@ -393,12 +536,12 @@ function ManualDealCard({
|
|
|
393
536
|
onClick: () => setIsExpanded((v) => !v),
|
|
394
537
|
className: "flex p-[6px] items-center justify-center gap-[10px]",
|
|
395
538
|
"aria-label": isExpanded ? "Collapse deal details" : "Expand deal details",
|
|
396
|
-
children: /* @__PURE__ */
|
|
539
|
+
children: /* @__PURE__ */ jsx6(
|
|
397
540
|
ArrowDownFormIcon,
|
|
398
541
|
{
|
|
399
542
|
width: 12.004,
|
|
400
543
|
height: 5.999,
|
|
401
|
-
className:
|
|
544
|
+
className: cn6(
|
|
402
545
|
"text-greys-icons transition-transform duration-200",
|
|
403
546
|
isExpanded && "rotate-180"
|
|
404
547
|
)
|
|
@@ -406,14 +549,14 @@ function ManualDealCard({
|
|
|
406
549
|
)
|
|
407
550
|
}
|
|
408
551
|
),
|
|
409
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ jsx6("span", { className: "header-xl-medium-card text-text-primary", children: brandName })
|
|
410
553
|
] }),
|
|
411
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ jsx6("span", { className: "header-xl-medium-card text-text-primary whitespace-nowrap", children: fmtUSDWhole(meta.total_deal_amount) })
|
|
412
555
|
] }),
|
|
413
|
-
isExpanded && /* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
556
|
+
isExpanded && /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
557
|
+
/* @__PURE__ */ jsx6("div", { className: "w-full h-px bg-greys-grey-strokes-tables" }),
|
|
558
|
+
/* @__PURE__ */ jsxs5("div", { className: "p-2 flex items-start justify-between gap-1 bg-greys-table-hover rounded-[0_0_10px_10px]", children: [
|
|
559
|
+
/* @__PURE__ */ jsx6(
|
|
417
560
|
Button2,
|
|
418
561
|
{
|
|
419
562
|
variant: "unstyled",
|
|
@@ -428,46 +571,80 @@ function ManualDealCard({
|
|
|
428
571
|
] })
|
|
429
572
|
] })
|
|
430
573
|
] }),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ jsxs5("div", { className: "group hidden sm:flex flex-col gap-3 p-3", children: [
|
|
575
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-3 items-start w-full", children: [
|
|
576
|
+
/* @__PURE__ */ jsx6(
|
|
577
|
+
EntityAvatar,
|
|
578
|
+
{
|
|
579
|
+
entityType: "company",
|
|
580
|
+
imageUrl: deal.company_avatar_url,
|
|
581
|
+
name: deal.company_name ?? brandName,
|
|
582
|
+
resolveImageUrl,
|
|
583
|
+
size: "sm",
|
|
584
|
+
className: "shrink-0 rounded-[34px]"
|
|
585
|
+
}
|
|
586
|
+
),
|
|
587
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-1 flex-col gap-2 justify-center min-w-0", children: [
|
|
588
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-2 items-center min-w-0", children: [
|
|
589
|
+
/* @__PURE__ */ jsx6("span", { className: "text-text-primary header-xl-medium-card truncate", children: brandName }),
|
|
447
590
|
previewDocButton
|
|
448
591
|
] }),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
|
|
451
|
-
/* @__PURE__ */
|
|
592
|
+
metaLine && /* @__PURE__ */ jsx6("div", { className: "label-xs-text text-text-secondary break-words", children: metaLine }),
|
|
593
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-3 items-center min-w-0", children: [
|
|
594
|
+
/* @__PURE__ */ jsx6("span", { className: "label-xs-text text-text-secondary shrink-0", children: "Lead" }),
|
|
595
|
+
deal.lead_agent_name ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
596
|
+
/* @__PURE__ */ jsx6(
|
|
597
|
+
EntityAvatar,
|
|
598
|
+
{
|
|
599
|
+
entityType: "initials",
|
|
600
|
+
imageUrl: deal.lead_agent_avatar_url,
|
|
601
|
+
name: deal.lead_agent_name,
|
|
602
|
+
resolveImageUrl,
|
|
603
|
+
size: "sm",
|
|
604
|
+
className: "shrink-0"
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ jsx6("span", { className: "label-xs-text text-text-secondary truncate", children: deal.lead_agent_name })
|
|
608
|
+
] }) : /* @__PURE__ */ jsx6("span", { className: "label-xs-text text-text-secondary truncate", children: "--" })
|
|
452
609
|
] })
|
|
453
610
|
] }),
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
611
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1 items-end justify-center shrink-0", children: [
|
|
612
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2", children: [
|
|
613
|
+
/* @__PURE__ */ jsx6("span", { className: "team-stats-card text-text-primary whitespace-nowrap", children: fmtUSDWhole(meta.total_deal_amount) }),
|
|
614
|
+
/* @__PURE__ */ jsx6(RowActionsDropdown, { actions, ariaLabel: "Deal options" })
|
|
615
|
+
] }),
|
|
616
|
+
/* @__PURE__ */ jsx6(
|
|
617
|
+
"div",
|
|
618
|
+
{
|
|
619
|
+
className: cn6(
|
|
620
|
+
"h-[27px] px-3 py-1.5 rounded-[50px] flex items-center justify-center whitespace-nowrap",
|
|
621
|
+
STATUS_STYLES.Complete
|
|
622
|
+
),
|
|
623
|
+
children: /* @__PURE__ */ jsx6("span", { className: "label-xs-medium", children: "Complete" })
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
asideFooter
|
|
627
|
+
] })
|
|
628
|
+
] }),
|
|
629
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid w-full grid-cols-2 items-center gap-x-3 gap-y-2 md:grid-cols-3 lg:flex lg:justify-between lg:gap-0", children: [
|
|
630
|
+
/* @__PURE__ */ jsx6(TrackingItem, { label: "Client paid", done: true }),
|
|
631
|
+
/* @__PURE__ */ jsx6(TrackingItem, { label: "Agency paid", done: true }),
|
|
632
|
+
meta.has_third_party && /* @__PURE__ */ jsx6(TrackingItem, { label: "Third Party paid", done: true })
|
|
633
|
+
] }),
|
|
634
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
635
|
+
/* @__PURE__ */ jsx6("div", { className: "relative w-full h-2 bg-greys-nav-text rounded-[10px] overflow-hidden", children: /* @__PURE__ */ jsx6("div", { className: "absolute left-0 top-0 h-2 bg-primary-color-nuk-ui-elem rounded-[10px] w-full" }) }),
|
|
636
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-3 items-start text-[13px] font-medium w-full", children: [
|
|
637
|
+
/* @__PURE__ */ jsx6(
|
|
638
|
+
"span",
|
|
639
|
+
{
|
|
640
|
+
className: cn6(
|
|
641
|
+
"min-w-0 flex-1 label-xs-table",
|
|
642
|
+
meta.total_deal_amount > 0 ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
643
|
+
),
|
|
644
|
+
children: `${fmtUSD(meta.total_deal_amount)}${meta.total_deal_amount > 0 ? " collected" : ""}`
|
|
645
|
+
}
|
|
646
|
+
),
|
|
647
|
+
/* @__PURE__ */ jsx6("span", { className: "shrink-0 text-primary-color-nuk-text label-xs-table whitespace-nowrap", children: "Fully Paid" })
|
|
471
648
|
] })
|
|
472
649
|
] })
|
|
473
650
|
] })
|
|
@@ -480,7 +657,7 @@ function ManualDealCard({
|
|
|
480
657
|
import { useEffect, useState as useState2 } from "react";
|
|
481
658
|
import {
|
|
482
659
|
Button as Button3,
|
|
483
|
-
cn as
|
|
660
|
+
cn as cn7,
|
|
484
661
|
Dialog,
|
|
485
662
|
DialogContent,
|
|
486
663
|
DialogHeader,
|
|
@@ -489,7 +666,7 @@ import {
|
|
|
489
666
|
} from "@nukleus-sports/ui-web";
|
|
490
667
|
import { DownloadIcon } from "@nukleus-sports/icons";
|
|
491
668
|
import { fmt, fmtCurrency, fmtDate } from "@nukleus-sports/core";
|
|
492
|
-
import { jsx as
|
|
669
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
493
670
|
var DESKTOP_BREAKPOINT_QUERY = "(min-width: 640px)";
|
|
494
671
|
function useIsDesktopViewport() {
|
|
495
672
|
const [isDesktop, setIsDesktop] = useState2(
|
|
@@ -505,22 +682,22 @@ function useIsDesktopViewport() {
|
|
|
505
682
|
return isDesktop;
|
|
506
683
|
}
|
|
507
684
|
function ReadOnlyField({ label, value }) {
|
|
508
|
-
return /* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[2px] shrink-0", children: [
|
|
686
|
+
/* @__PURE__ */ jsx7("span", { className: "label-xs-medium text-text-secondary", children: label }),
|
|
687
|
+
/* @__PURE__ */ jsx7("div", { className: "flex items-center px-[0px] py-[6px]", children: /* @__PURE__ */ jsx7("span", { className: "body-text text-text-primary whitespace-nowrap", children: value || "--" }) })
|
|
511
688
|
] });
|
|
512
689
|
}
|
|
513
690
|
function ReadOnlyPartyCard({ title, children, className }) {
|
|
514
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsxs6(
|
|
515
692
|
"div",
|
|
516
693
|
{
|
|
517
|
-
className:
|
|
694
|
+
className: cn7(
|
|
518
695
|
"flex flex-col gap-4 rounded-[10px] border border-grey-strokes-tables bg-card px-6 py-4",
|
|
519
696
|
className
|
|
520
697
|
),
|
|
521
698
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ jsx7("h3", { className: "header-xl-medium-card text-text-primary whitespace-nowrap", children: title }),
|
|
700
|
+
/* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-4", children })
|
|
524
701
|
]
|
|
525
702
|
}
|
|
526
703
|
);
|
|
@@ -531,6 +708,7 @@ function ManualDealPreviewDialog({
|
|
|
531
708
|
onOpenChange,
|
|
532
709
|
onEdit,
|
|
533
710
|
onOpenDocument,
|
|
711
|
+
clientImageUrl,
|
|
534
712
|
resolveImageUrl
|
|
535
713
|
}) {
|
|
536
714
|
const isDesktop = useIsDesktopViewport();
|
|
@@ -538,31 +716,47 @@ function ManualDealPreviewDialog({
|
|
|
538
716
|
const meta = deal.metadata;
|
|
539
717
|
const doc = resolveDealDocument(meta);
|
|
540
718
|
const cardCls = isDesktop ? "flex-1 min-w-0 h-[479px]" : "w-full h-auto";
|
|
541
|
-
const cards = /* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
719
|
+
const cards = /* @__PURE__ */ jsxs6("div", { className: cn7("flex gap-4 sm:gap-[12px]", !isDesktop && "flex-col"), children: [
|
|
720
|
+
/* @__PURE__ */ jsxs6(ReadOnlyPartyCard, { title: "Brand", className: cardCls, children: [
|
|
721
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Brand Name", value: fmt(meta.brand_name) }),
|
|
722
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Deal Category", value: fmt(meta.deal_category) }),
|
|
723
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Total Deal Amount", value: fmtCurrency(meta.total_deal_amount) }),
|
|
724
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Payment Due Date", value: fmtDate(meta.brand_payment_due_date) }),
|
|
725
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Deal Start Date", value: fmtDate(meta.start_date) }),
|
|
726
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Deal End Date", value: fmtDate(meta.end_date) })
|
|
549
727
|
] }),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
|
|
728
|
+
/* @__PURE__ */ jsxs6(ReadOnlyPartyCard, { title: "Client", className: cardCls, children: [
|
|
729
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[2px] shrink-0", children: [
|
|
730
|
+
/* @__PURE__ */ jsx7("span", { className: "label-xs-medium text-text-secondary", children: "Client Name" }),
|
|
731
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex min-h-[32px] items-center gap-2 py-[6px]", children: [
|
|
732
|
+
meta.client_name?.trim() && clientImageUrl && /* @__PURE__ */ jsx7(
|
|
733
|
+
EntityAvatar,
|
|
734
|
+
{
|
|
735
|
+
entityType: "player",
|
|
736
|
+
imageUrl: clientImageUrl,
|
|
737
|
+
name: meta.client_name,
|
|
738
|
+
resolveImageUrl,
|
|
739
|
+
size: "sm",
|
|
740
|
+
className: "shrink-0"
|
|
741
|
+
}
|
|
742
|
+
),
|
|
743
|
+
/* @__PURE__ */ jsx7("span", { className: "body-text text-text-primary whitespace-nowrap", children: fmt(meta.client_name) })
|
|
744
|
+
] })
|
|
745
|
+
] }),
|
|
746
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Client's Invoice Name", value: fmt(meta.client_invoice_name) })
|
|
553
747
|
] }),
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ jsxs6(ReadOnlyPartyCard, { title: "Agency", className: cardCls, children: [
|
|
749
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Agency Name", value: fmt(meta.agency_name) }),
|
|
750
|
+
/* @__PURE__ */ jsx7(
|
|
557
751
|
ReadOnlyField,
|
|
558
752
|
{
|
|
559
753
|
label: "Commission %",
|
|
560
754
|
value: meta.agency_commission ? `${meta.agency_commission}%` : "--"
|
|
561
755
|
}
|
|
562
756
|
),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Payment Due Date", value: fmtDate(meta.agency_payment_due_date) }),
|
|
758
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[2px] shrink-0", children: [
|
|
759
|
+
/* @__PURE__ */ jsx7(
|
|
566
760
|
"span",
|
|
567
761
|
{
|
|
568
762
|
className: "text-[13px] font-medium leading-normal text-text-secondary",
|
|
@@ -570,8 +764,8 @@ function ManualDealPreviewDialog({
|
|
|
570
764
|
children: "Lead Agent"
|
|
571
765
|
}
|
|
572
766
|
),
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex min-h-[32px] items-center gap-2 py-[6px]", children: [
|
|
768
|
+
/* @__PURE__ */ jsx7(
|
|
575
769
|
EntityAvatar,
|
|
576
770
|
{
|
|
577
771
|
entityType: "initials",
|
|
@@ -582,7 +776,7 @@ function ManualDealPreviewDialog({
|
|
|
582
776
|
className: "shrink-0"
|
|
583
777
|
}
|
|
584
778
|
),
|
|
585
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ jsx7(
|
|
586
780
|
"span",
|
|
587
781
|
{
|
|
588
782
|
className: "overflow-hidden text-ellipsis text-[14px] leading-[15px] text-text-secondary whitespace-nowrap",
|
|
@@ -593,23 +787,23 @@ function ManualDealPreviewDialog({
|
|
|
593
787
|
] })
|
|
594
788
|
] })
|
|
595
789
|
] }),
|
|
596
|
-
meta.has_third_party && /* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
790
|
+
meta.has_third_party && /* @__PURE__ */ jsxs6(ReadOnlyPartyCard, { title: "Third Party", className: cardCls, children: [
|
|
791
|
+
/* @__PURE__ */ jsx7(ReadOnlyField, { label: "Third Party Name", value: fmt(meta.third_party_name) }),
|
|
792
|
+
/* @__PURE__ */ jsx7(
|
|
599
793
|
ReadOnlyField,
|
|
600
794
|
{
|
|
601
795
|
label: "Third Party Invoice Name",
|
|
602
796
|
value: fmt(meta.third_party_invoice_name)
|
|
603
797
|
}
|
|
604
798
|
),
|
|
605
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ jsx7(
|
|
606
800
|
ReadOnlyField,
|
|
607
801
|
{
|
|
608
802
|
label: "Commission %",
|
|
609
803
|
value: meta.third_party_commission ? `${meta.third_party_commission}%` : "--"
|
|
610
804
|
}
|
|
611
805
|
),
|
|
612
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ jsx7(
|
|
613
807
|
ReadOnlyField,
|
|
614
808
|
{
|
|
615
809
|
label: "Payment Due Date",
|
|
@@ -618,28 +812,30 @@ function ManualDealPreviewDialog({
|
|
|
618
812
|
)
|
|
619
813
|
] })
|
|
620
814
|
] });
|
|
621
|
-
const
|
|
622
|
-
|
|
815
|
+
const summary = meta.summary || meta.notes || null;
|
|
816
|
+
const notes = /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[12px] rounded-[10px] border border-grey-strokes-tables bg-card px-[16px] py-[12px] shrink-0 w-full", children: [
|
|
817
|
+
/* @__PURE__ */ jsx7(
|
|
623
818
|
"h3",
|
|
624
819
|
{
|
|
625
820
|
className: "header-xl-medium-card text-text-primary whitespace-nowrap",
|
|
626
821
|
style: { fontFeatureSettings: "'ss02', 'ss05'" },
|
|
627
|
-
children: "
|
|
822
|
+
children: "Contract Summary"
|
|
628
823
|
}
|
|
629
824
|
),
|
|
630
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ jsx7("div", { className: "flex min-h-[70px] items-start rounded-[5px] bg-greys-background-hover px-[12px] py-[6px]", children: /* @__PURE__ */ jsx7(
|
|
631
826
|
"p",
|
|
632
827
|
{
|
|
633
|
-
className:
|
|
634
|
-
"flex-1 body-text
|
|
635
|
-
|
|
828
|
+
className: cn7(
|
|
829
|
+
"flex-1 min-w-0 body-text whitespace-pre-wrap break-words",
|
|
830
|
+
summary ? "text-text-primary" : "text-text-secondary"
|
|
636
831
|
),
|
|
637
832
|
style: { fontFeatureSettings: "'ss02', 'ss05'" },
|
|
638
|
-
children:
|
|
833
|
+
children: summary || "--"
|
|
639
834
|
}
|
|
640
835
|
) })
|
|
641
836
|
] });
|
|
642
|
-
const
|
|
837
|
+
const contractDetailsCard = meta.contract_details ? /* @__PURE__ */ jsx7(ContractDetailsCard, { details: meta.contract_details }) : null;
|
|
838
|
+
const documentButton = doc && /* @__PURE__ */ jsxs6(
|
|
643
839
|
Button3,
|
|
644
840
|
{
|
|
645
841
|
variant: "ghost",
|
|
@@ -647,8 +843,8 @@ function ManualDealPreviewDialog({
|
|
|
647
843
|
className: "flex h-full p-0 bg-transparent hover:bg-transparent items-center gap-[12px] hover:opacity-80 transition-opacity",
|
|
648
844
|
onClick: () => onOpenDocument(doc),
|
|
649
845
|
children: [
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ jsx7(DownloadIcon, { className: "size-5 shrink-0 text-primary-color-nuk-ui-elem" }),
|
|
847
|
+
/* @__PURE__ */ jsx7(
|
|
652
848
|
"span",
|
|
653
849
|
{
|
|
654
850
|
className: "text-[14px] font-normal leading-[15px] text-primary-color-nuk-text overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",
|
|
@@ -659,8 +855,8 @@ function ManualDealPreviewDialog({
|
|
|
659
855
|
]
|
|
660
856
|
}
|
|
661
857
|
);
|
|
662
|
-
const footerButtons = /* @__PURE__ */
|
|
663
|
-
onEdit && /* @__PURE__ */
|
|
858
|
+
const footerButtons = /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-[12px]", children: [
|
|
859
|
+
onEdit && /* @__PURE__ */ jsx7(
|
|
664
860
|
Button3,
|
|
665
861
|
{
|
|
666
862
|
variant: "outline",
|
|
@@ -669,7 +865,7 @@ function ManualDealPreviewDialog({
|
|
|
669
865
|
children: "Edit Deal"
|
|
670
866
|
}
|
|
671
867
|
),
|
|
672
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ jsx7(
|
|
673
869
|
Button3,
|
|
674
870
|
{
|
|
675
871
|
onClick: () => onOpenChange(false),
|
|
@@ -679,19 +875,20 @@ function ManualDealPreviewDialog({
|
|
|
679
875
|
)
|
|
680
876
|
] });
|
|
681
877
|
if (isDesktop) {
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ jsx7(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs6(DialogContent, { className: "flex h-screen sm:h-[800px] flex-col gap-0 overflow-hidden rounded-none sm:rounded-[10px] bg-card p-0 max-w-[1140px] max-[1024px]:max-w-[940px]", children: [
|
|
879
|
+
/* @__PURE__ */ jsx7(DialogHeader, { className: "shrink-0 mt-4 pb-0 space-y-0 px-6", children: /* @__PURE__ */ jsx7(DialogTitle, { children: "Preview Details" }) }),
|
|
880
|
+
/* @__PURE__ */ jsx7("div", { className: "flex-1 overflow-y-auto px-6 pt-6 pb-4", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[12px]", children: [
|
|
685
881
|
cards,
|
|
686
|
-
notes
|
|
882
|
+
notes,
|
|
883
|
+
contractDetailsCard
|
|
687
884
|
] }) }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between bg-card pb-6 pt-3 px-9 shadow-[0px_0px_4px_0px_rgba(0,0,0,0.25)] shrink-0 rounded-bl-[10px] rounded-br-[10px]", children: [
|
|
886
|
+
/* @__PURE__ */ jsx7("div", { className: "flex h-[32px] items-center bg-card px-2", children: documentButton ?? /* @__PURE__ */ jsx7("div", {}) }),
|
|
690
887
|
footerButtons
|
|
691
888
|
] })
|
|
692
889
|
] }) });
|
|
693
890
|
}
|
|
694
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsx7(
|
|
695
892
|
MobileModalLayout,
|
|
696
893
|
{
|
|
697
894
|
onCancel: () => onOpenChange(false),
|
|
@@ -701,10 +898,11 @@ function ManualDealPreviewDialog({
|
|
|
701
898
|
cancelButtonName: "Cancel",
|
|
702
899
|
actionBottomContext: false,
|
|
703
900
|
childClassName: "max-h-[calc(100dvh-50px)]",
|
|
704
|
-
children: /* @__PURE__ */
|
|
705
|
-
doc && /* @__PURE__ */
|
|
901
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-4 px-4 pb-4", children: [
|
|
902
|
+
doc && /* @__PURE__ */ jsx7("div", { className: "flex h-[32px] justify-end items-center bg-card py-0 px-2", children: documentButton }),
|
|
706
903
|
cards,
|
|
707
|
-
notes
|
|
904
|
+
notes,
|
|
905
|
+
contractDetailsCard
|
|
708
906
|
] })
|
|
709
907
|
}
|
|
710
908
|
);
|
|
@@ -712,54 +910,23 @@ function ManualDealPreviewDialog({
|
|
|
712
910
|
|
|
713
911
|
// src/marketing/project-deal-card.tsx
|
|
714
912
|
import { useState as useState3 } from "react";
|
|
715
|
-
import { Button as Button4, cn as
|
|
716
|
-
import { ArrowDownFormIcon as ArrowDownFormIcon2,
|
|
717
|
-
import {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
// squeezed to an equal share. (clientapp's version — see module doc.)
|
|
725
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-1 gap-2 items-center lg:flex-initial", children: [
|
|
726
|
-
/* @__PURE__ */ jsx6(
|
|
727
|
-
CheckRingRoundIcon,
|
|
728
|
-
{
|
|
729
|
-
width: 12,
|
|
730
|
-
height: 12,
|
|
731
|
-
className: cn6(
|
|
732
|
-
"shrink-0 transition-opacity",
|
|
733
|
-
done ? "text-primary-color-nuk-ui-elem" : "opacity-0"
|
|
734
|
-
)
|
|
735
|
-
}
|
|
736
|
-
),
|
|
737
|
-
/* @__PURE__ */ jsx6(
|
|
738
|
-
"span",
|
|
739
|
-
{
|
|
740
|
-
className: cn6(
|
|
741
|
-
"label-xs-table truncate max-lg:whitespace-normal",
|
|
742
|
-
done ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
743
|
-
),
|
|
744
|
-
children: label
|
|
745
|
-
}
|
|
746
|
-
)
|
|
747
|
-
] })
|
|
748
|
-
);
|
|
749
|
-
}
|
|
750
|
-
var STATUS_STYLES = {
|
|
751
|
-
Active: "bg-semantic-color-status-priority-cold-fill text-semantic-color-status-priority-cold-copy",
|
|
752
|
-
Upcoming: "bg-semantic-color-status-priority-in-progress-warm-fill text-semantic-color-status-priority-in-progress-warm-copy",
|
|
753
|
-
Complete: "bg-semantic-color-status-priority-completed-fill text-semantic-color-status-priority-completed-copy"
|
|
754
|
-
};
|
|
913
|
+
import { Button as Button4, cn as cn8 } from "@nukleus-sports/ui-web";
|
|
914
|
+
import { ArrowDownFormIcon as ArrowDownFormIcon2, XsViewInvoiceIcon as XsViewInvoiceIcon2 } from "@nukleus-sports/icons";
|
|
915
|
+
import {
|
|
916
|
+
abbreviatePersonName,
|
|
917
|
+
getDealStatus,
|
|
918
|
+
formatDealDate as formatDealDate3,
|
|
919
|
+
fmtUSD as fmtUSD2
|
|
920
|
+
} from "@nukleus-sports/core";
|
|
921
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
755
922
|
function statusLabel(status) {
|
|
756
923
|
return status === "Complete" ? "Completed" : status;
|
|
757
924
|
}
|
|
758
925
|
function CollabAffordance({ href, onClick, className, children }) {
|
|
759
926
|
if (onClick) {
|
|
760
|
-
return /* @__PURE__ */
|
|
927
|
+
return /* @__PURE__ */ jsx8(Button4, { variant: "unstyled", size: "none", type: "button", onClick, className, children });
|
|
761
928
|
}
|
|
762
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ jsx8("a", { href, className, children });
|
|
763
930
|
}
|
|
764
931
|
function ProjectDealCard({
|
|
765
932
|
deal,
|
|
@@ -768,6 +935,7 @@ function ProjectDealCard({
|
|
|
768
935
|
collabHref,
|
|
769
936
|
onCollabClick,
|
|
770
937
|
resolveImageUrl,
|
|
938
|
+
asideFooter,
|
|
771
939
|
className
|
|
772
940
|
}) {
|
|
773
941
|
const [isExpanded, setIsExpanded] = useState3(false);
|
|
@@ -775,17 +943,17 @@ function ProjectDealCard({
|
|
|
775
943
|
const status = getDealStatus(deal, isCompleted);
|
|
776
944
|
const brandName = deal.brand_name ?? deal.company_name ?? deal.project_title;
|
|
777
945
|
const category = deal.deal_terms?.category;
|
|
778
|
-
const startDate =
|
|
779
|
-
const endDate =
|
|
946
|
+
const startDate = formatDealDate3(deal.deal_terms?.startDate);
|
|
947
|
+
const endDate = formatDealDate3(deal.deal_terms?.endDate);
|
|
780
948
|
const progressPct = deal.total_contracted > 0 ? Math.min(100, deal.total_collected / deal.total_contracted * 100) : 0;
|
|
781
949
|
const outstanding = Math.max(0, deal.total_contracted - deal.total_collected);
|
|
782
950
|
const isFullyPaid = deal.total_contracted > 0 && outstanding === 0;
|
|
783
951
|
const hasPaymentsCount = deal.payments_total !== void 0 && deal.payments_paid !== void 0;
|
|
784
|
-
return /* @__PURE__ */
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn8("w-full", className), children: [
|
|
953
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col sm:hidden overflow-hidden bg-card border border-greys-grey-strokes-tables rounded-[10px]", children: [
|
|
954
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-1 p-2", children: [
|
|
955
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 gap-1 items-start", children: [
|
|
956
|
+
/* @__PURE__ */ jsx8(
|
|
789
957
|
Button4,
|
|
790
958
|
{
|
|
791
959
|
variant: "unstyled",
|
|
@@ -794,12 +962,12 @@ function ProjectDealCard({
|
|
|
794
962
|
onClick: () => setIsExpanded((v) => !v),
|
|
795
963
|
className: "flex size-8 shrink-0 items-center justify-center p-1.5 rounded-[5px]",
|
|
796
964
|
"aria-label": isExpanded ? "Collapse deal details" : "Expand deal details",
|
|
797
|
-
children: /* @__PURE__ */
|
|
965
|
+
children: /* @__PURE__ */ jsx8(
|
|
798
966
|
ArrowDownFormIcon2,
|
|
799
967
|
{
|
|
800
968
|
width: 12.004,
|
|
801
969
|
height: 5.999,
|
|
802
|
-
className:
|
|
970
|
+
className: cn8(
|
|
803
971
|
"text-greys-icons transition-transform duration-200",
|
|
804
972
|
isExpanded && "rotate-180"
|
|
805
973
|
)
|
|
@@ -807,48 +975,49 @@ function ProjectDealCard({
|
|
|
807
975
|
)
|
|
808
976
|
}
|
|
809
977
|
),
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 flex-col gap-2 justify-center items-start", children: [
|
|
979
|
+
/* @__PURE__ */ jsx8("span", { className: "header-xl-medium-card text-text-primary", children: brandName }),
|
|
980
|
+
/* @__PURE__ */ jsxs7("span", { className: "label-xs-text text-text-secondary", children: [
|
|
813
981
|
startDate,
|
|
814
982
|
" - ",
|
|
815
983
|
endDate
|
|
816
984
|
] })
|
|
817
985
|
] })
|
|
818
986
|
] }),
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
deal.total_equity_shares > 0 && /* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col shrink-0 justify-center items-end gap-1", children: [
|
|
988
|
+
/* @__PURE__ */ jsx8("span", { className: "header-xl-medium-card text-text-primary whitespace-nowrap", children: fmtUSD2(deal.total_contracted) }),
|
|
989
|
+
deal.total_equity_shares > 0 && /* @__PURE__ */ jsxs7("span", { className: "label-xs-text text-text-secondary whitespace-nowrap", children: [
|
|
822
990
|
"+ ",
|
|
823
991
|
deal.total_equity_shares.toLocaleString(),
|
|
824
992
|
" shares"
|
|
825
993
|
] }),
|
|
826
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ jsx8(
|
|
827
995
|
"div",
|
|
828
996
|
{
|
|
829
|
-
className:
|
|
997
|
+
className: cn8(
|
|
830
998
|
"h-[27px] px-3 py-1.5 rounded-[50px] flex items-center justify-center label-xs-medium whitespace-nowrap",
|
|
831
999
|
STATUS_STYLES[status]
|
|
832
1000
|
),
|
|
833
1001
|
children: statusLabel(status)
|
|
834
1002
|
}
|
|
835
|
-
)
|
|
1003
|
+
),
|
|
1004
|
+
asideFooter
|
|
836
1005
|
] })
|
|
837
1006
|
] }),
|
|
838
|
-
isExpanded && /* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
1007
|
+
isExpanded && /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
1008
|
+
/* @__PURE__ */ jsx8("div", { className: "w-full h-px bg-greys-grey-strokes-tables" }),
|
|
1009
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-1 p-2 bg-greys-table-hover", children: [
|
|
1010
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 flex-col gap-2", children: [
|
|
1011
|
+
/* @__PURE__ */ jsx8("span", { className: "label-xs-text text-text-secondary", children: "Collected" }),
|
|
1012
|
+
/* @__PURE__ */ jsx8("span", { className: "body-text-semibold text-primary-color-nuk-text truncate", children: fmtUSD2(deal.total_collected) })
|
|
844
1013
|
] }),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 flex-col gap-2", children: [
|
|
1015
|
+
/* @__PURE__ */ jsx8("span", { className: "label-xs-text text-text-secondary", children: "Outstanding" }),
|
|
1016
|
+
/* @__PURE__ */ jsx8("span", { className: "body-text-semibold text-semantic-color-status-priority-priority-2 truncate", children: fmtUSD2(outstanding) })
|
|
848
1017
|
] }),
|
|
849
|
-
hasPaymentsCount && /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
1018
|
+
hasPaymentsCount && /* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 flex-col gap-2", children: [
|
|
1019
|
+
/* @__PURE__ */ jsx8("span", { className: "label-xs-text text-text-secondary", children: "Payments" }),
|
|
1020
|
+
/* @__PURE__ */ jsxs7("span", { className: "body-text-semibold text-text-primary truncate", children: [
|
|
852
1021
|
deal.payments_paid,
|
|
853
1022
|
" of ",
|
|
854
1023
|
deal.payments_total,
|
|
@@ -856,20 +1025,20 @@ function ProjectDealCard({
|
|
|
856
1025
|
] })
|
|
857
1026
|
] })
|
|
858
1027
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ jsx8("div", { className: "w-full h-px bg-greys-grey-strokes-tables" }),
|
|
1029
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2 min-w-0 p-2 bg-greys-table-hover", children: [
|
|
1030
|
+
/* @__PURE__ */ jsx8("span", { className: "w-[58px] shrink-0 text-[11px] leading-none text-text-secondary font-normal", children: "Payment" }),
|
|
1031
|
+
/* @__PURE__ */ jsx8("div", { className: "relative flex-1 min-w-0 h-1 bg-greys-nav-text rounded-full overflow-hidden", children: /* @__PURE__ */ jsx8(
|
|
863
1032
|
"div",
|
|
864
1033
|
{
|
|
865
1034
|
className: "absolute inset-y-0 left-0 bg-primary-color-nuk-ui-elem rounded-full",
|
|
866
1035
|
style: { width: `${progressPct}%` }
|
|
867
1036
|
}
|
|
868
1037
|
) }),
|
|
869
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ jsxs7(
|
|
870
1039
|
"span",
|
|
871
1040
|
{
|
|
872
|
-
className:
|
|
1041
|
+
className: cn8(
|
|
873
1042
|
"w-9 shrink-0 text-right text-[11px] leading-none font-normal",
|
|
874
1043
|
isFullyPaid ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
875
1044
|
),
|
|
@@ -880,8 +1049,8 @@ function ProjectDealCard({
|
|
|
880
1049
|
}
|
|
881
1050
|
)
|
|
882
1051
|
] }),
|
|
883
|
-
showCollab && /* @__PURE__ */
|
|
884
|
-
showCollab && /* @__PURE__ */
|
|
1052
|
+
showCollab && /* @__PURE__ */ jsx8("div", { className: "w-full h-px bg-greys-grey-strokes-tables" }),
|
|
1053
|
+
showCollab && /* @__PURE__ */ jsx8("div", { className: "flex gap-1 p-2 bg-greys-table-hover rounded-[0_0_10px_10px] justify-end", children: /* @__PURE__ */ jsxs7(
|
|
885
1054
|
CollabAffordance,
|
|
886
1055
|
{
|
|
887
1056
|
href: collabHref,
|
|
@@ -889,15 +1058,15 @@ function ProjectDealCard({
|
|
|
889
1058
|
className: "flex gap-2 items-center text-primary-color-nuk-text text-[11px] font-normal shrink-0",
|
|
890
1059
|
children: [
|
|
891
1060
|
"Collab",
|
|
892
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ jsx8(XsViewInvoiceIcon2, { className: "size-[18px] p-[1px] flex justify-center items-center" })
|
|
893
1062
|
]
|
|
894
1063
|
}
|
|
895
1064
|
) })
|
|
896
1065
|
] })
|
|
897
1066
|
] }),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
1067
|
+
/* @__PURE__ */ jsxs7("div", { className: "hidden sm:flex flex-col gap-3 p-3 bg-card border-b border-greys-grey-strokes-tables font-ss02", children: [
|
|
1068
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-3 items-start w-full", children: [
|
|
1069
|
+
/* @__PURE__ */ jsx8(
|
|
901
1070
|
EntityAvatar,
|
|
902
1071
|
{
|
|
903
1072
|
entityType: "company",
|
|
@@ -908,10 +1077,10 @@ function ProjectDealCard({
|
|
|
908
1077
|
className: "shrink-0 rounded-[34px]"
|
|
909
1078
|
}
|
|
910
1079
|
),
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
showCollab && /* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 min-w-0 flex-col gap-2 justify-center", children: [
|
|
1081
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-2 items-center", children: [
|
|
1082
|
+
/* @__PURE__ */ jsx8("span", { className: "header-xl-medium-card text-text-primary", children: brandName }),
|
|
1083
|
+
showCollab && /* @__PURE__ */ jsxs7(
|
|
915
1084
|
CollabAffordance,
|
|
916
1085
|
{
|
|
917
1086
|
href: collabHref,
|
|
@@ -919,15 +1088,15 @@ function ProjectDealCard({
|
|
|
919
1088
|
className: "flex gap-1.5 items-center text-primary-color-nuk-text label-xs-text shrink-0",
|
|
920
1089
|
children: [
|
|
921
1090
|
"Collab Hub",
|
|
922
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx8(XsViewInvoiceIcon2, { className: "size-[18px] p-[1px] flex justify-center items-center" })
|
|
923
1092
|
]
|
|
924
1093
|
}
|
|
925
1094
|
)
|
|
926
1095
|
] }),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx8("div", { className: "label-xs-text text-text-secondary break-words sm:whitespace-nowrap", children: [category, `${startDate} - ${endDate}`].filter(Boolean).join(" \u2022 ") }),
|
|
1097
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-3 items-center min-w-0", children: [
|
|
1098
|
+
/* @__PURE__ */ jsx8("span", { className: "label-xs-text text-text-secondary shrink-0", children: "Owner" }),
|
|
1099
|
+
/* @__PURE__ */ jsx8(
|
|
931
1100
|
EntityAvatar,
|
|
932
1101
|
{
|
|
933
1102
|
entityType: "initials",
|
|
@@ -938,60 +1107,61 @@ function ProjectDealCard({
|
|
|
938
1107
|
className: "shrink-0"
|
|
939
1108
|
}
|
|
940
1109
|
),
|
|
941
|
-
/* @__PURE__ */
|
|
1110
|
+
/* @__PURE__ */ jsx8("span", { className: "label-xs-text text-text-secondary truncate", children: abbreviatePersonName(deal.owner_name) ?? "\u2014" })
|
|
942
1111
|
] })
|
|
943
1112
|
] }),
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
deal.total_equity_shares > 0 && /* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1 items-end justify-center shrink-0", children: [
|
|
1114
|
+
/* @__PURE__ */ jsx8("span", { className: "team-stats-card text-text-primary whitespace-nowrap", children: fmtUSD2(deal.total_contracted) }),
|
|
1115
|
+
deal.total_equity_shares > 0 && /* @__PURE__ */ jsxs7("span", { className: "label-xs-text text-text-secondary whitespace-nowrap", children: [
|
|
947
1116
|
"+ ",
|
|
948
1117
|
deal.total_equity_shares.toLocaleString(),
|
|
949
1118
|
" shares"
|
|
950
1119
|
] }),
|
|
951
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx8(
|
|
952
1121
|
"div",
|
|
953
1122
|
{
|
|
954
|
-
className:
|
|
1123
|
+
className: cn8(
|
|
955
1124
|
"h-[27px] px-3 py-1.5 rounded-[50px] flex items-center justify-center whitespace-nowrap",
|
|
956
1125
|
STATUS_STYLES[status]
|
|
957
1126
|
),
|
|
958
|
-
children: /* @__PURE__ */
|
|
1127
|
+
children: /* @__PURE__ */ jsx8("span", { className: "label-xs-medium", children: statusLabel(status) })
|
|
959
1128
|
}
|
|
960
|
-
)
|
|
1129
|
+
),
|
|
1130
|
+
asideFooter
|
|
961
1131
|
] })
|
|
962
1132
|
] }),
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
1133
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid w-full grid-cols-2 items-center gap-x-3 gap-y-2 md:grid-cols-3 lg:flex lg:justify-between lg:gap-0", children: [
|
|
1134
|
+
/* @__PURE__ */ jsx8(
|
|
965
1135
|
TrackingItem,
|
|
966
1136
|
{
|
|
967
1137
|
label: `Deliverables met - ${deal.deliverables_met}/${deal.deliverables_total}`,
|
|
968
1138
|
done: deal.deliverables_total > 0 && deal.deliverables_met >= deal.deliverables_total
|
|
969
1139
|
}
|
|
970
1140
|
),
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
deal.has_third_party && /* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsx8(TrackingItem, { label: "Client paid", done: deal.client_paid && isFullyPaid }),
|
|
1142
|
+
/* @__PURE__ */ jsx8(TrackingItem, { label: "Agency paid", done: deal.agency_paid && isFullyPaid }),
|
|
1143
|
+
deal.has_third_party && /* @__PURE__ */ jsx8(TrackingItem, { label: "Third Party paid", done: deal.third_party_paid && isFullyPaid })
|
|
974
1144
|
] }),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
1146
|
+
/* @__PURE__ */ jsx8("div", { className: "relative w-full h-2 bg-greys-nav-text rounded-[10px] overflow-hidden", children: /* @__PURE__ */ jsx8(
|
|
977
1147
|
"div",
|
|
978
1148
|
{
|
|
979
1149
|
className: "absolute left-0 top-0 h-2 bg-primary-color-nuk-ui-elem rounded-[10px]",
|
|
980
1150
|
style: { width: `${progressPct}%` }
|
|
981
1151
|
}
|
|
982
1152
|
) }),
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-3 items-start text-[13px] font-medium w-full", children: [
|
|
1154
|
+
/* @__PURE__ */ jsx8(
|
|
985
1155
|
"span",
|
|
986
1156
|
{
|
|
987
|
-
className:
|
|
1157
|
+
className: cn8(
|
|
988
1158
|
"min-w-0 flex-1 label-xs-table",
|
|
989
1159
|
deal.total_collected > 0 ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
990
1160
|
),
|
|
991
|
-
children: `${
|
|
1161
|
+
children: `${fmtUSD2(deal.total_collected)}${deal.total_collected > 0 ? " collected" : ""}`
|
|
992
1162
|
}
|
|
993
1163
|
),
|
|
994
|
-
hasPaymentsCount && /* @__PURE__ */
|
|
1164
|
+
hasPaymentsCount && /* @__PURE__ */ jsxs7("span", { className: "flex-1 label-xs-table text-text-secondary", children: [
|
|
995
1165
|
deal.payments_paid,
|
|
996
1166
|
" of ",
|
|
997
1167
|
deal.payments_total,
|
|
@@ -999,8 +1169,8 @@ function ProjectDealCard({
|
|
|
999
1169
|
" ",
|
|
1000
1170
|
status === "Active" ? "collected" : "paid"
|
|
1001
1171
|
] }),
|
|
1002
|
-
isFullyPaid ? /* @__PURE__ */
|
|
1003
|
-
|
|
1172
|
+
isFullyPaid ? /* @__PURE__ */ jsx8("span", { className: "shrink-0 text-primary-color-nuk-text label-xs-table whitespace-nowrap", children: "Fully Paid" }) : /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-semantic-color-status-priority-priority-2 label-xs-table whitespace-nowrap", children: [
|
|
1173
|
+
fmtUSD2(outstanding),
|
|
1004
1174
|
" outstanding"
|
|
1005
1175
|
] })
|
|
1006
1176
|
] })
|
|
@@ -1009,6 +1179,7 @@ function ProjectDealCard({
|
|
|
1009
1179
|
] });
|
|
1010
1180
|
}
|
|
1011
1181
|
export {
|
|
1182
|
+
ContractDetailsCard,
|
|
1012
1183
|
DealEmptyState,
|
|
1013
1184
|
ENTITY_AVATAR_SIZE_PX,
|
|
1014
1185
|
EntityAvatar,
|