@nukleus-sports/ui-patterns 0.2.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.
- package/dist/chunk-JDVXTCUB.js +237 -0
- package/dist/chunk-JDVXTCUB.js.map +1 -0
- package/dist/client.cjs +376 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +45 -0
- package/dist/client.d.ts +45 -0
- package/dist/client.js +127 -0
- package/dist/client.js.map +1 -0
- package/dist/index.cjs +245 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +8 -0
- package/dist/marketing.cjs +244 -251
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.d.cts +33 -371
- package/dist/marketing.d.ts +33 -371
- package/dist/marketing.js +232 -457
- package/dist/marketing.js.map +1 -1
- package/package.json +12 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,48 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
type EntityType = "player" | "coach" | "team" | "contact" | "company" | "agency" | "initials";
|
|
4
|
+
type EntityAvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
5
|
+
interface BaseEntityData {
|
|
6
|
+
first_name?: string | null;
|
|
7
|
+
last_name?: string | null;
|
|
8
|
+
player_image_url?: string | null;
|
|
9
|
+
coach_image_url?: string | null;
|
|
10
|
+
profile_image_url?: string | null;
|
|
11
|
+
team?: string | null;
|
|
12
|
+
nickname?: string | null;
|
|
13
|
+
team_logo_url?: string | null;
|
|
14
|
+
name?: string | null;
|
|
15
|
+
avatar_url?: string | null;
|
|
16
|
+
}
|
|
17
|
+
/** Pixel size per step, mirroring the Tailwind classes below -- lets a
|
|
18
|
+
* `resolveImageUrl` adapter request an appropriately sized image. */
|
|
19
|
+
declare const ENTITY_AVATAR_SIZE_PX: Record<EntityAvatarSize, number>;
|
|
20
|
+
/** Turns a raw, possibly-relative stored image path into a renderable URL;
|
|
21
|
+
* return `null` to fall back to initials/the default placeholder. */
|
|
22
|
+
type EntityImageResolver = (rawUrl: string, context: {
|
|
23
|
+
entityType: EntityType;
|
|
24
|
+
size: EntityAvatarSize;
|
|
25
|
+
cacheBreaker?: string | number;
|
|
26
|
+
}) => string | null;
|
|
27
|
+
interface EntityAvatarProps {
|
|
28
|
+
/** Drives image resolution and the initials/placeholder shown without one.
|
|
29
|
+
* Defaults to `"initials"`. */
|
|
30
|
+
entityType?: EntityType;
|
|
31
|
+
entityData?: BaseEntityData | null;
|
|
32
|
+
firstName?: string | null;
|
|
33
|
+
lastName?: string | null;
|
|
34
|
+
name?: string | null;
|
|
35
|
+
imageUrl?: string | null;
|
|
36
|
+
/** Omit to only render already-absolute URLs (`http(s)://...`/`data:...`) as-is;
|
|
37
|
+
* anything else falls back to initials/placeholder. */
|
|
38
|
+
resolveImageUrl?: EntityImageResolver;
|
|
39
|
+
size?: EntityAvatarSize;
|
|
40
|
+
className?: string;
|
|
41
|
+
fallbackClassName?: string;
|
|
42
|
+
showInitials?: boolean;
|
|
43
|
+
/** Cache-busting for agency user profile images. */
|
|
44
|
+
cacheBreaker?: string | number;
|
|
45
|
+
}
|
|
46
|
+
declare function EntityAvatar({ entityType, entityData, firstName, lastName, name, imageUrl, resolveImageUrl, size, className, fallbackClassName, showInitials, cacheBreaker, }: EntityAvatarProps): react.JSX.Element;
|
|
47
|
+
|
|
48
|
+
export { ENTITY_AVATAR_SIZE_PX, EntityAvatar, type EntityAvatarProps, type EntityAvatarSize, type EntityImageResolver, type EntityType };
|
package/dist/index.js
CHANGED
package/dist/marketing.cjs
CHANGED
|
@@ -22,8 +22,6 @@ var marketing_exports = {};
|
|
|
22
22
|
__export(marketing_exports, {
|
|
23
23
|
ContractDetailsCard: () => ContractDetailsCard,
|
|
24
24
|
DealEmptyState: () => DealEmptyState,
|
|
25
|
-
ENTITY_AVATAR_SIZE_PX: () => ENTITY_AVATAR_SIZE_PX,
|
|
26
|
-
EntityAvatar: () => EntityAvatar,
|
|
27
25
|
ManualDealCard: () => ManualDealCard,
|
|
28
26
|
ManualDealPreviewDialog: () => ManualDealPreviewDialog,
|
|
29
27
|
ProjectDealCard: () => ProjectDealCard,
|
|
@@ -32,43 +30,268 @@ __export(marketing_exports, {
|
|
|
32
30
|
});
|
|
33
31
|
module.exports = __toCommonJS(marketing_exports);
|
|
34
32
|
|
|
35
|
-
// src/marketing/
|
|
33
|
+
// src/marketing/row-actions-dropdown.tsx
|
|
36
34
|
var import_ui_web = require("@nukleus-sports/ui-web");
|
|
35
|
+
var import_icons = require("@nukleus-sports/icons");
|
|
37
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
function RowActionsDropdown({
|
|
38
|
+
actions,
|
|
39
|
+
trigger,
|
|
40
|
+
triggerClassName,
|
|
41
|
+
contentClassName,
|
|
42
|
+
align = "end",
|
|
43
|
+
ariaLabel,
|
|
44
|
+
modal = true
|
|
45
|
+
}) {
|
|
46
|
+
const visibleActions = actions.filter((a) => a.when !== false);
|
|
47
|
+
if (visibleActions.length === 0) return null;
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui_web.DropdownMenu, { modal, children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.DropdownMenuTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_ui_web.Button,
|
|
51
|
+
{
|
|
52
|
+
variant: "text",
|
|
53
|
+
size: "sm",
|
|
54
|
+
"aria-label": ariaLabel ?? "Row actions",
|
|
55
|
+
onClick: (e) => e.stopPropagation(),
|
|
56
|
+
className: (0, import_ui_web.cn)("h-8 w-8 p-0 shrink-0", triggerClassName),
|
|
57
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MoreIcon, { className: "h-14 w-16 text-btn-primary", "aria-hidden": "true" })
|
|
58
|
+
}
|
|
59
|
+
) }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_ui_web.DropdownMenuContent,
|
|
62
|
+
{
|
|
63
|
+
align,
|
|
64
|
+
className: (0, import_ui_web.cn)(
|
|
65
|
+
"rounded-[10px] bg-table px-0 py-2 dark:border dark:border-text-secondary shadow-[0_4px_18px_-6px_rgba(0,0,0,0.12)]",
|
|
66
|
+
contentClassName
|
|
67
|
+
),
|
|
68
|
+
children: visibleActions.map((action, i) => {
|
|
69
|
+
const item = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
import_ui_web.DropdownMenuItem,
|
|
71
|
+
{
|
|
72
|
+
disabled: action.disabled,
|
|
73
|
+
onClick: (e) => {
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
if (action.disabled) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
action.onClick(e);
|
|
80
|
+
},
|
|
81
|
+
className: (0, import_ui_web.cn)(
|
|
82
|
+
action.destructive && "text-semantic-color-status-priority-blocked-hot-copy hover:!text-semantic-color-status-priority-blocked-hot-copy",
|
|
83
|
+
action.className
|
|
84
|
+
),
|
|
85
|
+
children: action.label
|
|
86
|
+
},
|
|
87
|
+
i
|
|
88
|
+
);
|
|
89
|
+
if (action.disabled && action.disabledTooltip) {
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui_web.Tooltip, { children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: item }) }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TooltipContent, { children: action.disabledTooltip })
|
|
93
|
+
] }) }, i);
|
|
94
|
+
}
|
|
95
|
+
return item;
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/marketing/deal-empty-state.tsx
|
|
103
|
+
var import_ui_web2 = require("@nukleus-sports/ui-web");
|
|
104
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
105
|
+
function DealEmptyState({ message, className, messageClassName }) {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_ui_web2.cn)("flex items-center justify-center py-10 px-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
107
|
+
"p",
|
|
108
|
+
{
|
|
109
|
+
className: (0, import_ui_web2.cn)("body-text text-text-secondary text-center max-w-[380px]", messageClassName),
|
|
110
|
+
children: message
|
|
111
|
+
}
|
|
112
|
+
) });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/marketing/contract-details-card.tsx
|
|
116
|
+
var import_ui_web3 = require("@nukleus-sports/ui-web");
|
|
117
|
+
var import_core = require("@nukleus-sports/core");
|
|
118
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
119
|
+
function Row({ label, children }) {
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: label }),
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "body-text text-text-primary whitespace-pre-wrap break-words font-ss02-ss05", children })
|
|
123
|
+
] });
|
|
124
|
+
}
|
|
125
|
+
function usageAfterTerm({
|
|
126
|
+
usage_after_term_days: days
|
|
127
|
+
}) {
|
|
128
|
+
if (days == null) return null;
|
|
129
|
+
return days === 1 ? "1 day after the term" : `${days} days after the term`;
|
|
130
|
+
}
|
|
131
|
+
function ContractDetailsCard({
|
|
132
|
+
details,
|
|
133
|
+
title = "Contract Details",
|
|
134
|
+
caption,
|
|
135
|
+
className
|
|
136
|
+
}) {
|
|
137
|
+
const usage = usageAfterTerm(details);
|
|
138
|
+
const exclusive = details.is_exclusive == null ? null : details.is_exclusive ? "Exclusive" : "Not exclusive";
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
className: (0, import_ui_web3.cn)(
|
|
143
|
+
"flex w-full flex-col gap-4 rounded-[10px] border border-grey-strokes-tables bg-card px-4 py-3",
|
|
144
|
+
className
|
|
145
|
+
),
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { className: "header-xl-medium-card text-text-primary font-ss02-ss05", children: title }),
|
|
149
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "label-xs-text text-text-secondary", children: caption })
|
|
150
|
+
] }),
|
|
151
|
+
details.warnings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col gap-2 rounded-[10px] bg-semantic-color-status-priority-in-progress-warm-fill px-3 py-2", children: [
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "label-base-medium text-semantic-color-status-priority-in-progress-warm-copy", children: [
|
|
153
|
+
"Worth checking (",
|
|
154
|
+
details.warnings.length,
|
|
155
|
+
")"
|
|
156
|
+
] }),
|
|
157
|
+
details.warnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
158
|
+
"p",
|
|
159
|
+
{
|
|
160
|
+
className: "body-text text-semantic-color-status-priority-in-progress-warm-copy break-words",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "font-medium", children: warning.issue }),
|
|
163
|
+
warning.detail && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
164
|
+
": ",
|
|
165
|
+
warning.detail
|
|
166
|
+
] })
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
`${warning.issue}-${index}`
|
|
170
|
+
))
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
173
|
+
details.territory && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Territory", children: details.territory }),
|
|
174
|
+
details.contracting_entity && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Contracting Entity", children: details.contracting_entity }),
|
|
175
|
+
exclusive && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Exclusivity", children: exclusive }),
|
|
176
|
+
usage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Usage After Term", children: usage })
|
|
177
|
+
] }),
|
|
178
|
+
details.exclusivity && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Exclusivity Terms", children: details.exclusivity }),
|
|
179
|
+
details.payment_terms && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Payment Terms", children: details.payment_terms }),
|
|
180
|
+
details.usage_after_term && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Row, { label: "Usage Rights", children: details.usage_after_term }),
|
|
181
|
+
details.deliverables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: [
|
|
183
|
+
"Deliverables (",
|
|
184
|
+
details.deliverables.length,
|
|
185
|
+
")"
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("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__ */ (0, import_jsx_runtime3.jsxs)(
|
|
188
|
+
"li",
|
|
189
|
+
{
|
|
190
|
+
className: "flex flex-col gap-1 px-3 py-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "min-w-0 body-text text-text-primary break-words", children: [
|
|
193
|
+
deliverable.units != null && deliverable.units > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "font-medium", children: [
|
|
194
|
+
deliverable.units,
|
|
195
|
+
" \xD7 "
|
|
196
|
+
] }),
|
|
197
|
+
deliverable.description
|
|
198
|
+
] }),
|
|
199
|
+
deliverable.due_date && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "label-xs-text text-text-secondary whitespace-nowrap", children: [
|
|
200
|
+
"Due ",
|
|
201
|
+
(0, import_core.formatDealDate)(deliverable.due_date)
|
|
202
|
+
] })
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
`${deliverable.description}-${index}`
|
|
206
|
+
)) })
|
|
207
|
+
] })
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// src/marketing/manual-deal-card.tsx
|
|
214
|
+
var import_react = require("react");
|
|
215
|
+
var import_ui_web6 = require("@nukleus-sports/ui-web");
|
|
216
|
+
var import_icons3 = require("@nukleus-sports/icons");
|
|
217
|
+
var import_core2 = require("@nukleus-sports/core");
|
|
218
|
+
|
|
219
|
+
// src/marketing/deal-card-parts.tsx
|
|
220
|
+
var import_ui_web4 = require("@nukleus-sports/ui-web");
|
|
221
|
+
var import_icons2 = require("@nukleus-sports/icons");
|
|
222
|
+
var import_jsx_runtime4 = (
|
|
223
|
+
// `min-w-0` lets `truncate` below actually engage instead of overflowing
|
|
224
|
+
// the card; `lg:flex-initial` + `max-lg:whitespace-normal` let a label
|
|
225
|
+
// like "Deliverables met - 0/4" wrap in the grid instead of being
|
|
226
|
+
// squeezed to an equal share. (clientapp's version — see ProjectDealCard's
|
|
227
|
+
// module doc.)
|
|
228
|
+
require("react/jsx-runtime")
|
|
229
|
+
);
|
|
230
|
+
var STATUS_STYLES = {
|
|
231
|
+
Active: "bg-semantic-color-status-priority-cold-fill text-semantic-color-status-priority-cold-copy",
|
|
232
|
+
Upcoming: "bg-semantic-color-status-priority-in-progress-warm-fill text-semantic-color-status-priority-in-progress-warm-copy",
|
|
233
|
+
Complete: "bg-semantic-color-status-priority-completed-fill text-semantic-color-status-priority-completed-copy"
|
|
44
234
|
};
|
|
235
|
+
function TrackingItem({ label, done }) {
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex min-w-0 flex-1 gap-2 items-center lg:flex-initial", children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
238
|
+
import_icons2.CheckRingRoundIcon,
|
|
239
|
+
{
|
|
240
|
+
width: 12,
|
|
241
|
+
height: 12,
|
|
242
|
+
className: (0, import_ui_web4.cn)(
|
|
243
|
+
"shrink-0 transition-opacity",
|
|
244
|
+
done ? "text-primary-color-nuk-ui-elem" : "opacity-0"
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
249
|
+
"span",
|
|
250
|
+
{
|
|
251
|
+
className: (0, import_ui_web4.cn)(
|
|
252
|
+
"label-xs-table truncate max-lg:whitespace-normal",
|
|
253
|
+
done ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
254
|
+
),
|
|
255
|
+
children: label
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// src/entity-avatar.tsx
|
|
262
|
+
var import_ui_web5 = require("@nukleus-sports/ui-web");
|
|
263
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
45
264
|
var sizeClasses = {
|
|
46
265
|
xs: "h-4 w-4",
|
|
47
266
|
sm: "h-6 w-6",
|
|
48
267
|
md: "h-8 w-8",
|
|
49
268
|
lg: "h-12 w-12",
|
|
50
|
-
xl: "h-16 w-16"
|
|
269
|
+
xl: "h-16 w-16",
|
|
270
|
+
"2xl": "h-[120px] w-[120px]"
|
|
51
271
|
};
|
|
52
272
|
var initialSizeClasses = {
|
|
53
273
|
xs: "text-[8px]",
|
|
54
274
|
sm: "text-xs",
|
|
55
275
|
md: "text-sm",
|
|
56
276
|
lg: "text-base",
|
|
57
|
-
xl: "text-lg"
|
|
277
|
+
xl: "text-lg",
|
|
278
|
+
"2xl": "text-2xl"
|
|
58
279
|
};
|
|
59
280
|
var contactSizeClasses = {
|
|
60
281
|
xs: "h-4 w-4",
|
|
61
282
|
sm: "h-6 w-6",
|
|
62
283
|
md: "h-8 w-8",
|
|
63
284
|
lg: "h-12 w-12",
|
|
64
|
-
xl: "h-16 w-16"
|
|
285
|
+
xl: "h-16 w-16",
|
|
286
|
+
"2xl": "h-[120px] w-[120px]"
|
|
65
287
|
};
|
|
66
288
|
var contactInitialSizeClasses = {
|
|
67
289
|
xs: "text-[8px]",
|
|
68
290
|
sm: "text-[10px]",
|
|
69
291
|
md: "text-sm",
|
|
70
292
|
lg: "text-base",
|
|
71
|
-
xl: "text-lg"
|
|
293
|
+
xl: "text-lg",
|
|
294
|
+
"2xl": "text-2xl"
|
|
72
295
|
};
|
|
73
296
|
function EntityAvatar({
|
|
74
297
|
entityType = "initials",
|
|
@@ -233,18 +456,18 @@ function EntityAvatar({
|
|
|
233
456
|
const hasValidImage = Boolean(
|
|
234
457
|
processedImageUrl && processedImageUrl !== "null" && processedImageUrl !== null && processedImageUrl.trim() !== ""
|
|
235
458
|
);
|
|
236
|
-
return /* @__PURE__ */ (0,
|
|
237
|
-
hasValidImage && /* @__PURE__ */ (0,
|
|
238
|
-
/* @__PURE__ */ (0,
|
|
239
|
-
|
|
459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_ui_web5.Avatar, { className: (0, import_ui_web5.cn)(avatarSizeClasses[effectiveSize], isSquared && "rounded-lg", className), children: [
|
|
460
|
+
hasValidImage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ui_web5.AvatarImage, { src: processedImageUrl, alt: altText }),
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
462
|
+
import_ui_web5.AvatarFallback,
|
|
240
463
|
{
|
|
241
|
-
className: (0,
|
|
464
|
+
className: (0, import_ui_web5.cn)(
|
|
242
465
|
initialsSizeClasses[effectiveSize],
|
|
243
466
|
isSquared && "rounded-lg bg-greys-grey-table-h",
|
|
244
467
|
fallbackClassName
|
|
245
468
|
),
|
|
246
|
-
children: entityType === "contact" || entityType === "initials" ? initials : /* @__PURE__ */ (0,
|
|
247
|
-
/* @__PURE__ */ (0,
|
|
469
|
+
children: entityType === "contact" || entityType === "initials" ? initials : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
470
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
248
471
|
"img",
|
|
249
472
|
{
|
|
250
473
|
src: defaultImageUrl,
|
|
@@ -252,241 +475,13 @@ function EntityAvatar({
|
|
|
252
475
|
className: "aspect-square h-full w-full object-cover"
|
|
253
476
|
}
|
|
254
477
|
),
|
|
255
|
-
/* @__PURE__ */ (0,
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sr-only", children: initials })
|
|
256
479
|
] })
|
|
257
480
|
}
|
|
258
481
|
)
|
|
259
482
|
] });
|
|
260
483
|
}
|
|
261
484
|
|
|
262
|
-
// src/marketing/row-actions-dropdown.tsx
|
|
263
|
-
var import_ui_web2 = require("@nukleus-sports/ui-web");
|
|
264
|
-
var import_icons = require("@nukleus-sports/icons");
|
|
265
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
266
|
-
function RowActionsDropdown({
|
|
267
|
-
actions,
|
|
268
|
-
trigger,
|
|
269
|
-
triggerClassName,
|
|
270
|
-
contentClassName,
|
|
271
|
-
align = "end",
|
|
272
|
-
ariaLabel,
|
|
273
|
-
modal = true
|
|
274
|
-
}) {
|
|
275
|
-
const visibleActions = actions.filter((a) => a.when !== false);
|
|
276
|
-
if (visibleActions.length === 0) return null;
|
|
277
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui_web2.DropdownMenu, { modal, children: [
|
|
278
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui_web2.DropdownMenuTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
279
|
-
import_ui_web2.Button,
|
|
280
|
-
{
|
|
281
|
-
variant: "text",
|
|
282
|
-
size: "sm",
|
|
283
|
-
"aria-label": ariaLabel ?? "Row actions",
|
|
284
|
-
onClick: (e) => e.stopPropagation(),
|
|
285
|
-
className: (0, import_ui_web2.cn)("h-8 w-8 p-0 shrink-0", triggerClassName),
|
|
286
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.MoreIcon, { className: "h-14 w-16 text-btn-primary", "aria-hidden": "true" })
|
|
287
|
-
}
|
|
288
|
-
) }),
|
|
289
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
290
|
-
import_ui_web2.DropdownMenuContent,
|
|
291
|
-
{
|
|
292
|
-
align,
|
|
293
|
-
className: (0, import_ui_web2.cn)(
|
|
294
|
-
"rounded-[10px] bg-table px-0 py-2 dark:border dark:border-text-secondary shadow-[0_4px_18px_-6px_rgba(0,0,0,0.12)]",
|
|
295
|
-
contentClassName
|
|
296
|
-
),
|
|
297
|
-
children: visibleActions.map((action, i) => {
|
|
298
|
-
const item = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
299
|
-
import_ui_web2.DropdownMenuItem,
|
|
300
|
-
{
|
|
301
|
-
disabled: action.disabled,
|
|
302
|
-
onClick: (e) => {
|
|
303
|
-
e.stopPropagation();
|
|
304
|
-
if (action.disabled) {
|
|
305
|
-
e.preventDefault();
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
action.onClick(e);
|
|
309
|
-
},
|
|
310
|
-
className: (0, import_ui_web2.cn)(
|
|
311
|
-
action.destructive && "text-semantic-color-status-priority-blocked-hot-copy hover:!text-semantic-color-status-priority-blocked-hot-copy",
|
|
312
|
-
action.className
|
|
313
|
-
),
|
|
314
|
-
children: action.label
|
|
315
|
-
},
|
|
316
|
-
i
|
|
317
|
-
);
|
|
318
|
-
if (action.disabled && action.disabledTooltip) {
|
|
319
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui_web2.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui_web2.Tooltip, { children: [
|
|
320
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui_web2.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: item }) }),
|
|
321
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui_web2.TooltipContent, { children: action.disabledTooltip })
|
|
322
|
-
] }) }, i);
|
|
323
|
-
}
|
|
324
|
-
return item;
|
|
325
|
-
})
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
] });
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// src/marketing/deal-empty-state.tsx
|
|
332
|
-
var import_ui_web3 = require("@nukleus-sports/ui-web");
|
|
333
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
334
|
-
function DealEmptyState({ message, className, messageClassName }) {
|
|
335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_ui_web3.cn)("flex items-center justify-center py-10 px-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
336
|
-
"p",
|
|
337
|
-
{
|
|
338
|
-
className: (0, import_ui_web3.cn)("body-text text-text-secondary text-center max-w-[380px]", messageClassName),
|
|
339
|
-
children: message
|
|
340
|
-
}
|
|
341
|
-
) });
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// src/marketing/contract-details-card.tsx
|
|
345
|
-
var import_ui_web4 = require("@nukleus-sports/ui-web");
|
|
346
|
-
var import_core = require("@nukleus-sports/core");
|
|
347
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
348
|
-
function Row({ label, children }) {
|
|
349
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
350
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: label }),
|
|
351
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "body-text text-text-primary whitespace-pre-wrap break-words font-ss02-ss05", children })
|
|
352
|
-
] });
|
|
353
|
-
}
|
|
354
|
-
function usageAfterTerm({
|
|
355
|
-
usage_after_term_days: days
|
|
356
|
-
}) {
|
|
357
|
-
if (days == null) return null;
|
|
358
|
-
return days === 1 ? "1 day after the term" : `${days} days after the term`;
|
|
359
|
-
}
|
|
360
|
-
function ContractDetailsCard({
|
|
361
|
-
details,
|
|
362
|
-
title = "Contract Details",
|
|
363
|
-
caption,
|
|
364
|
-
className
|
|
365
|
-
}) {
|
|
366
|
-
const usage = usageAfterTerm(details);
|
|
367
|
-
const exclusive = details.is_exclusive == null ? null : details.is_exclusive ? "Exclusive" : "Not exclusive";
|
|
368
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
369
|
-
"div",
|
|
370
|
-
{
|
|
371
|
-
className: (0, import_ui_web4.cn)(
|
|
372
|
-
"flex w-full flex-col gap-4 rounded-[10px] border border-grey-strokes-tables bg-card px-4 py-3",
|
|
373
|
-
className
|
|
374
|
-
),
|
|
375
|
-
children: [
|
|
376
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { className: "header-xl-medium-card text-text-primary font-ss02-ss05", children: title }),
|
|
378
|
-
caption && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "label-xs-text text-text-secondary", children: caption })
|
|
379
|
-
] }),
|
|
380
|
-
details.warnings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col gap-2 rounded-[10px] bg-semantic-color-status-priority-in-progress-warm-fill px-3 py-2", children: [
|
|
381
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "label-base-medium text-semantic-color-status-priority-in-progress-warm-copy", children: [
|
|
382
|
-
"Worth checking (",
|
|
383
|
-
details.warnings.length,
|
|
384
|
-
")"
|
|
385
|
-
] }),
|
|
386
|
-
details.warnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
387
|
-
"p",
|
|
388
|
-
{
|
|
389
|
-
className: "body-text text-semantic-color-status-priority-in-progress-warm-copy break-words",
|
|
390
|
-
children: [
|
|
391
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-medium", children: warning.issue }),
|
|
392
|
-
warning.detail && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
393
|
-
": ",
|
|
394
|
-
warning.detail
|
|
395
|
-
] })
|
|
396
|
-
]
|
|
397
|
-
},
|
|
398
|
-
`${warning.issue}-${index}`
|
|
399
|
-
))
|
|
400
|
-
] }),
|
|
401
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
402
|
-
details.territory && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Territory", children: details.territory }),
|
|
403
|
-
details.contracting_entity && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Contracting Entity", children: details.contracting_entity }),
|
|
404
|
-
exclusive && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Exclusivity", children: exclusive }),
|
|
405
|
-
usage && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Usage After Term", children: usage })
|
|
406
|
-
] }),
|
|
407
|
-
details.exclusivity && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Exclusivity Terms", children: details.exclusivity }),
|
|
408
|
-
details.payment_terms && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Payment Terms", children: details.payment_terms }),
|
|
409
|
-
details.usage_after_term && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { label: "Usage Rights", children: details.usage_after_term }),
|
|
410
|
-
details.deliverables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
411
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "label-base-medium text-text-secondary font-ss02-ss05", children: [
|
|
412
|
-
"Deliverables (",
|
|
413
|
-
details.deliverables.length,
|
|
414
|
-
")"
|
|
415
|
-
] }),
|
|
416
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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__ */ (0, import_jsx_runtime4.jsxs)(
|
|
417
|
-
"li",
|
|
418
|
-
{
|
|
419
|
-
className: "flex flex-col gap-1 px-3 py-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4",
|
|
420
|
-
children: [
|
|
421
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "min-w-0 body-text text-text-primary break-words", children: [
|
|
422
|
-
deliverable.units != null && deliverable.units > 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "font-medium", children: [
|
|
423
|
-
deliverable.units,
|
|
424
|
-
" \xD7 "
|
|
425
|
-
] }),
|
|
426
|
-
deliverable.description
|
|
427
|
-
] }),
|
|
428
|
-
deliverable.due_date && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "label-xs-text text-text-secondary whitespace-nowrap", children: [
|
|
429
|
-
"Due ",
|
|
430
|
-
(0, import_core.formatDealDate)(deliverable.due_date)
|
|
431
|
-
] })
|
|
432
|
-
]
|
|
433
|
-
},
|
|
434
|
-
`${deliverable.description}-${index}`
|
|
435
|
-
)) })
|
|
436
|
-
] })
|
|
437
|
-
]
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// src/marketing/manual-deal-card.tsx
|
|
443
|
-
var import_react = require("react");
|
|
444
|
-
var import_ui_web6 = require("@nukleus-sports/ui-web");
|
|
445
|
-
var import_icons3 = require("@nukleus-sports/icons");
|
|
446
|
-
var import_core2 = require("@nukleus-sports/core");
|
|
447
|
-
|
|
448
|
-
// src/marketing/deal-card-parts.tsx
|
|
449
|
-
var import_ui_web5 = require("@nukleus-sports/ui-web");
|
|
450
|
-
var import_icons2 = require("@nukleus-sports/icons");
|
|
451
|
-
var import_jsx_runtime5 = (
|
|
452
|
-
// `min-w-0` lets `truncate` below actually engage instead of overflowing
|
|
453
|
-
// the card; `lg:flex-initial` + `max-lg:whitespace-normal` let a label
|
|
454
|
-
// like "Deliverables met - 0/4" wrap in the grid instead of being
|
|
455
|
-
// squeezed to an equal share. (clientapp's version — see ProjectDealCard's
|
|
456
|
-
// module doc.)
|
|
457
|
-
require("react/jsx-runtime")
|
|
458
|
-
);
|
|
459
|
-
var STATUS_STYLES = {
|
|
460
|
-
Active: "bg-semantic-color-status-priority-cold-fill text-semantic-color-status-priority-cold-copy",
|
|
461
|
-
Upcoming: "bg-semantic-color-status-priority-in-progress-warm-fill text-semantic-color-status-priority-in-progress-warm-copy",
|
|
462
|
-
Complete: "bg-semantic-color-status-priority-completed-fill text-semantic-color-status-priority-completed-copy"
|
|
463
|
-
};
|
|
464
|
-
function TrackingItem({ label, done }) {
|
|
465
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex min-w-0 flex-1 gap-2 items-center lg:flex-initial", children: [
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
467
|
-
import_icons2.CheckRingRoundIcon,
|
|
468
|
-
{
|
|
469
|
-
width: 12,
|
|
470
|
-
height: 12,
|
|
471
|
-
className: (0, import_ui_web5.cn)(
|
|
472
|
-
"shrink-0 transition-opacity",
|
|
473
|
-
done ? "text-primary-color-nuk-ui-elem" : "opacity-0"
|
|
474
|
-
)
|
|
475
|
-
}
|
|
476
|
-
),
|
|
477
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
478
|
-
"span",
|
|
479
|
-
{
|
|
480
|
-
className: (0, import_ui_web5.cn)(
|
|
481
|
-
"label-xs-table truncate max-lg:whitespace-normal",
|
|
482
|
-
done ? "text-primary-color-nuk-text" : "text-text-secondary"
|
|
483
|
-
),
|
|
484
|
-
children: label
|
|
485
|
-
}
|
|
486
|
-
)
|
|
487
|
-
] });
|
|
488
|
-
}
|
|
489
|
-
|
|
490
485
|
// src/marketing/manual-deal-card.tsx
|
|
491
486
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
492
487
|
function resolveDealDocument(meta) {
|
|
@@ -1192,8 +1187,6 @@ function ProjectDealCard({
|
|
|
1192
1187
|
0 && (module.exports = {
|
|
1193
1188
|
ContractDetailsCard,
|
|
1194
1189
|
DealEmptyState,
|
|
1195
|
-
ENTITY_AVATAR_SIZE_PX,
|
|
1196
|
-
EntityAvatar,
|
|
1197
1190
|
ManualDealCard,
|
|
1198
1191
|
ManualDealPreviewDialog,
|
|
1199
1192
|
ProjectDealCard,
|