@nukleus-sports/ui-patterns 0.3.0 → 0.4.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/{chunk-WXPCAG5Z.js → chunk-JDVXTCUB.js} +1 -1
- package/dist/chunk-JDVXTCUB.js.map +1 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -60
- package/dist/client.d.ts +3 -60
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -34
- package/dist/index.d.ts +9 -34
- package/dist/index.js +1 -1
- package/dist/marketing.cjs +3 -2
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.d.cts +36 -306
- package/dist/marketing.d.ts +36 -306
- package/dist/marketing.js +4 -3
- package/dist/marketing.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-WXPCAG5Z.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
type EntityType = "player" | "coach" | "team" | "contact" | "company" | "agency" | "initials";
|
|
4
|
-
/** `2xl` (120px) added for `EntityBioCard`'s large profile avatar -- without
|
|
5
|
-
* it, that card had no size step close to its actual rendered size and
|
|
6
|
-
* fell back to `xl` (64px), which a real `resolveImageUrl` would've taken
|
|
7
|
-
* literally and requested a thumbnail roughly half the size it's displayed
|
|
8
|
-
* at. */
|
|
9
4
|
type EntityAvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
10
5
|
interface BaseEntityData {
|
|
11
6
|
first_name?: string | null;
|
|
@@ -19,53 +14,33 @@ interface BaseEntityData {
|
|
|
19
14
|
name?: string | null;
|
|
20
15
|
avatar_url?: string | null;
|
|
21
16
|
}
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* Exported so a consuming app's `resolveImageUrl` adapter can request an appropriately
|
|
25
|
-
* sized render (e.g. nukleus-clientapp's `sizedStorageImage(rawUrl, ENTITY_AVATAR_SIZE_PX[size], "cover")`)
|
|
26
|
-
* without this package needing to know about that CDN's resize API.
|
|
27
|
-
*/
|
|
17
|
+
/** Pixel size per step, mirroring the Tailwind classes below -- lets a
|
|
18
|
+
* `resolveImageUrl` adapter request an appropriately sized image. */
|
|
28
19
|
declare const ENTITY_AVATAR_SIZE_PX: Record<EntityAvatarSize, number>;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* Both source apps resolved this inline by calling Supabase-storage-specific helpers
|
|
33
|
-
* (`getStoragePublicUrl`, `sizedStorageImage`, cache-busting query params) straight out of
|
|
34
|
-
* `@/lib/image-utils`. This package has no legitimate reason to talk to Supabase or know
|
|
35
|
-
* about a particular CDN's URL shape, so that resolution step is lifted out to this
|
|
36
|
-
* injectable adapter instead of being baked into the shared component — the same
|
|
37
|
-
* data-arrives-through-props principle this repo already applies to page-shells.
|
|
38
|
-
*
|
|
39
|
-
* Return `null` to fall back to initials/the default placeholder image.
|
|
40
|
-
*/
|
|
20
|
+
/** Turns a raw, possibly-relative stored image path into a renderable URL;
|
|
21
|
+
* return `null` to fall back to initials/the default placeholder. */
|
|
41
22
|
type EntityImageResolver = (rawUrl: string, context: {
|
|
42
23
|
entityType: EntityType;
|
|
43
24
|
size: EntityAvatarSize;
|
|
44
25
|
cacheBreaker?: string | number;
|
|
45
26
|
}) => string | null;
|
|
46
27
|
interface EntityAvatarProps {
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* Defaults to "initials" — image when one is supplied, initials otherwise —
|
|
50
|
-
* which is the behaviour every plain `name` + `imageUrl` call site expects.
|
|
51
|
-
*/
|
|
28
|
+
/** Drives image resolution and the initials/placeholder shown without one.
|
|
29
|
+
* Defaults to `"initials"`. */
|
|
52
30
|
entityType?: EntityType;
|
|
53
31
|
entityData?: BaseEntityData | null;
|
|
54
32
|
firstName?: string | null;
|
|
55
33
|
lastName?: string | null;
|
|
56
34
|
name?: string | null;
|
|
57
35
|
imageUrl?: string | null;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* render already-absolute URLs (`http(s)://...` or `data:...`) as-is — anything else
|
|
61
|
-
* (a bare storage path) falls back to initials/the default placeholder, since this
|
|
62
|
-
* package can't resolve it itself. See `EntityImageResolver` for why.
|
|
63
|
-
*/
|
|
36
|
+
/** Omit to only render already-absolute URLs (`http(s)://...`/`data:...`) as-is;
|
|
37
|
+
* anything else falls back to initials/placeholder. */
|
|
64
38
|
resolveImageUrl?: EntityImageResolver;
|
|
65
39
|
size?: EntityAvatarSize;
|
|
66
40
|
className?: string;
|
|
67
41
|
fallbackClassName?: string;
|
|
68
42
|
showInitials?: boolean;
|
|
43
|
+
/** Cache-busting for agency user profile images. */
|
|
69
44
|
cacheBreaker?: string | number;
|
|
70
45
|
}
|
|
71
46
|
declare function EntityAvatar({ entityType, entityData, firstName, lastName, name, imageUrl, resolveImageUrl, size, className, fallbackClassName, showInitials, cacheBreaker, }: EntityAvatarProps): react.JSX.Element;
|
package/dist/index.js
CHANGED
package/dist/marketing.cjs
CHANGED
|
@@ -941,6 +941,7 @@ function ProjectDealCard({
|
|
|
941
941
|
onCollabClick,
|
|
942
942
|
resolveImageUrl,
|
|
943
943
|
asideFooter,
|
|
944
|
+
statusPill,
|
|
944
945
|
className
|
|
945
946
|
}) {
|
|
946
947
|
const [isExpanded, setIsExpanded] = (0, import_react3.useState)(false);
|
|
@@ -996,7 +997,7 @@ function ProjectDealCard({
|
|
|
996
997
|
deal.total_equity_shares.toLocaleString(),
|
|
997
998
|
" shares"
|
|
998
999
|
] }),
|
|
999
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1000
|
+
statusPill ?? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1000
1001
|
"div",
|
|
1001
1002
|
{
|
|
1002
1003
|
className: (0, import_ui_web8.cn)(
|
|
@@ -1122,7 +1123,7 @@ function ProjectDealCard({
|
|
|
1122
1123
|
deal.total_equity_shares.toLocaleString(),
|
|
1123
1124
|
" shares"
|
|
1124
1125
|
] }),
|
|
1125
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1126
|
+
statusPill ?? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1126
1127
|
"div",
|
|
1127
1128
|
{
|
|
1128
1129
|
className: (0, import_ui_web8.cn)(
|