@fairmint/ui 0.2.22 → 0.2.24
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/components/generic/ListRow/ListRow.d.ts +15 -4
- package/dist/components/generic/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/primitives/Avatar/Avatar.d.ts +5 -0
- package/dist/components/primitives/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/specific/EquityGrantCard/EquityGrantCard.d.ts.map +1 -1
- package/dist/components/specific/InvestmentCard/InvestmentCard.d.ts.map +1 -1
- package/dist/components/specific/InvestorProfileCard/InvestorProfileCard.d.ts.map +1 -1
- package/dist/fairmint-ui.cjs +170 -35
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +170 -35
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/theme/fontSizes.d.ts +32 -0
- package/dist/theme/fontSizes.d.ts.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/utils/format.d.ts +85 -0
- package/dist/utils/format.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface ListRowProps {
|
|
3
|
-
/** Avatar image URL. Falls back to
|
|
3
|
+
/** Avatar image URL. Falls back to name-derived initial. */
|
|
4
4
|
avatarSrc?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** @deprecated Use `avatarName` instead. Preserved for backwards compatibility. */
|
|
6
6
|
avatarFallback?: string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Name used to derive a fallback initial and deterministic avatar color.
|
|
9
|
+
* Defaults to `title` when omitted.
|
|
10
|
+
*/
|
|
11
|
+
avatarName?: string;
|
|
12
|
+
/** Explicit avatar background color override. When set, takes precedence over the name-derived color. */
|
|
8
13
|
avatarColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* When true and `avatarColor` is omitted, the Avatar primitive derives a
|
|
16
|
+
* deterministic background color from `avatarName` / `title`.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
avatarColorFromName?: boolean;
|
|
9
20
|
/** Primary text. */
|
|
10
21
|
title: string;
|
|
11
22
|
/** Secondary text below title. */
|
|
@@ -29,5 +40,5 @@ export interface ListRowProps {
|
|
|
29
40
|
/** aria-label for the button. Defaults to title. */
|
|
30
41
|
ariaLabel?: string;
|
|
31
42
|
}
|
|
32
|
-
export declare function ListRow({ avatarSrc, avatarFallback, avatarColor, title, subtitle, value, valueSubtitle, rightSection, showChevron, chevronIcon, onClick, animationDelay, isSelected, ariaLabel, }: ListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function ListRow({ avatarSrc, avatarFallback, avatarColor, avatarColorFromName, title, avatarName, subtitle, value, valueSubtitle, rightSection, showChevron, chevronIcon, onClick, animationDelay, isSelected, ariaLabel, }: ListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
33
44
|
//# sourceMappingURL=ListRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListRow.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/ListRow/ListRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListRow.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/ListRow/ListRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yGAAyG;IACzG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,qEAAqE;IACrE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkBD,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,cAAc,EACd,WAAW,EACX,mBAA2B,EAC3B,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,KAAK,EACL,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,cAAc,EACd,UAAkB,EAClB,SAAS,GACV,EAAE,YAAY,2CA2Fd"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { AvatarProps as MantineAvatarProps } from '@mantine/core';
|
|
2
2
|
export interface AvatarProps extends MantineAvatarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Optional display name used to derive a fallback initial and deterministic
|
|
5
|
+
* background color when explicit `children` / `color` are not provided.
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
3
8
|
}
|
|
4
9
|
export declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
10
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAKhG,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,MAAM,wGAkBlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EquityGrantCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityGrantCard/EquityGrantCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EquityGrantCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityGrantCard/EquityGrantCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,oBAAoB;IACnC,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,GACf,EAAE,oBAAoB,2CAiBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvestmentCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestmentCard/InvestmentCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InvestmentCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestmentCard/InvestmentCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,GACf,EAAE,mBAAmB,2CAarB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvestorProfileCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestorProfileCard/InvestorProfileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InvestorProfileCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestorProfileCard/InvestorProfileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AASjD,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wJAAwJ;IACxJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,8FAA8F;IAC9F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kGAAkG;IAClG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B;AA6CD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,EAAE,wBAAwB,2CAuI1B"}
|
package/dist/fairmint-ui.cjs
CHANGED
|
@@ -36352,6 +36352,28 @@ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
36352
36352
|
xid,
|
|
36353
36353
|
xor
|
|
36354
36354
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
36355
|
+
const fontSizes = {
|
|
36356
|
+
/** 12px — labels, captions, table headers */
|
|
36357
|
+
xs: "0.75rem",
|
|
36358
|
+
/** 14px — secondary body text, meta */
|
|
36359
|
+
sm: "0.875rem",
|
|
36360
|
+
/** 16px — default body text */
|
|
36361
|
+
md: "1rem",
|
|
36362
|
+
/** 18px — large body, lead text */
|
|
36363
|
+
lg: "1.125rem",
|
|
36364
|
+
/** 20px — small headings, emphasized values */
|
|
36365
|
+
xl: "1.25rem",
|
|
36366
|
+
/** 24px — section values, stat subtitles */
|
|
36367
|
+
"2xl": "1.5rem",
|
|
36368
|
+
/** 28px — card hero values */
|
|
36369
|
+
"3xl": "1.75rem",
|
|
36370
|
+
/** 32px — page hero values */
|
|
36371
|
+
"4xl": "2rem",
|
|
36372
|
+
/** 36px — large display values */
|
|
36373
|
+
"5xl": "2.25rem",
|
|
36374
|
+
/** 40px — extra-large display values */
|
|
36375
|
+
"6xl": "2.5rem"
|
|
36376
|
+
};
|
|
36355
36377
|
const spacing = {
|
|
36356
36378
|
xs: "0.625rem",
|
|
36357
36379
|
sm: "0.75rem",
|
|
@@ -36511,6 +36533,13 @@ const theme = createTheme({
|
|
|
36511
36533
|
radius: radii,
|
|
36512
36534
|
defaultRadius: "md",
|
|
36513
36535
|
spacing,
|
|
36536
|
+
fontSizes: {
|
|
36537
|
+
xs: fontSizes.xs,
|
|
36538
|
+
sm: fontSizes.sm,
|
|
36539
|
+
md: fontSizes.md,
|
|
36540
|
+
lg: fontSizes.lg,
|
|
36541
|
+
xl: fontSizes.xl
|
|
36542
|
+
},
|
|
36514
36543
|
breakpoints: {
|
|
36515
36544
|
xs: "30em",
|
|
36516
36545
|
sm: "48em",
|
|
@@ -36636,7 +36665,40 @@ ActionIcon.displayName = "ActionIcon";
|
|
|
36636
36665
|
function Alert(props) {
|
|
36637
36666
|
return /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { ...props });
|
|
36638
36667
|
}
|
|
36639
|
-
|
|
36668
|
+
function getAvatarColor(name) {
|
|
36669
|
+
if (!name) return AVATAR_PALETTE[0];
|
|
36670
|
+
let hash2 = 0;
|
|
36671
|
+
for (let i = 0; i < name.length; i++) {
|
|
36672
|
+
hash2 = hash2 * 31 + name.charCodeAt(i) >>> 0;
|
|
36673
|
+
}
|
|
36674
|
+
return AVATAR_PALETTE[hash2 % AVATAR_PALETTE.length];
|
|
36675
|
+
}
|
|
36676
|
+
function getInitials(name) {
|
|
36677
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
36678
|
+
if (words.length >= 2) {
|
|
36679
|
+
return (words[0][0] + words[1][0]).toUpperCase();
|
|
36680
|
+
}
|
|
36681
|
+
if (words.length === 1) {
|
|
36682
|
+
return words[0][0].toUpperCase();
|
|
36683
|
+
}
|
|
36684
|
+
return "";
|
|
36685
|
+
}
|
|
36686
|
+
const Avatar = React.forwardRef(
|
|
36687
|
+
({ children, color, name, ...props }, ref) => {
|
|
36688
|
+
const normalizedName = name?.trim() ?? "";
|
|
36689
|
+
const fallbackInitial = normalizedName ? Array.from(normalizedName)[0]?.toUpperCase() : void 0;
|
|
36690
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
36691
|
+
Avatar$1,
|
|
36692
|
+
{
|
|
36693
|
+
radius: "md",
|
|
36694
|
+
color: color ?? (normalizedName ? getAvatarColor(normalizedName) : colors.primary),
|
|
36695
|
+
...props,
|
|
36696
|
+
ref,
|
|
36697
|
+
children: children ?? fallbackInitial
|
|
36698
|
+
}
|
|
36699
|
+
);
|
|
36700
|
+
}
|
|
36701
|
+
);
|
|
36640
36702
|
Avatar.displayName = "Avatar";
|
|
36641
36703
|
const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "light", ...props, ref }));
|
|
36642
36704
|
Badge.displayName = "Badge";
|
|
@@ -38132,24 +38194,6 @@ function ColorDot({ color, size: size2 = 8, style, ...rest }) {
|
|
|
38132
38194
|
};
|
|
38133
38195
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-testid": "color-dot", style: [baseStyle, style], ...rest });
|
|
38134
38196
|
}
|
|
38135
|
-
function getAvatarColor(name) {
|
|
38136
|
-
if (!name) return AVATAR_PALETTE[0];
|
|
38137
|
-
let hash2 = 0;
|
|
38138
|
-
for (let i = 0; i < name.length; i++) {
|
|
38139
|
-
hash2 = hash2 * 31 + name.charCodeAt(i) >>> 0;
|
|
38140
|
-
}
|
|
38141
|
-
return AVATAR_PALETTE[hash2 % AVATAR_PALETTE.length];
|
|
38142
|
-
}
|
|
38143
|
-
function getInitials(name) {
|
|
38144
|
-
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
38145
|
-
if (words.length >= 2) {
|
|
38146
|
-
return (words[0][0] + words[1][0]).toUpperCase();
|
|
38147
|
-
}
|
|
38148
|
-
if (words.length === 1) {
|
|
38149
|
-
return words[0][0].toUpperCase();
|
|
38150
|
-
}
|
|
38151
|
-
return "";
|
|
38152
|
-
}
|
|
38153
38197
|
const BRAND_GRADIENT = `linear-gradient(90deg, ${brandColors.blue} 0%, ${brandColors.indigo} 50%, ${brandColors.purple} 100%)`;
|
|
38154
38198
|
function CompanyBanner({
|
|
38155
38199
|
companyName,
|
|
@@ -38307,6 +38351,90 @@ function formatDate(dateString) {
|
|
|
38307
38351
|
function formatPercent(n, decimals = 2) {
|
|
38308
38352
|
return `${n.toFixed(decimals)}%`;
|
|
38309
38353
|
}
|
|
38354
|
+
const COUNTRY_LOCALES = {
|
|
38355
|
+
US: "en-US",
|
|
38356
|
+
CA: "en-CA",
|
|
38357
|
+
GB: "en-GB",
|
|
38358
|
+
IE: "en-IE",
|
|
38359
|
+
AU: "en-AU",
|
|
38360
|
+
NZ: "en-NZ",
|
|
38361
|
+
FR: "fr-FR",
|
|
38362
|
+
BE: "fr-BE",
|
|
38363
|
+
LU: "fr-LU",
|
|
38364
|
+
DE: "de-DE",
|
|
38365
|
+
AT: "de-AT",
|
|
38366
|
+
CH: "de-CH",
|
|
38367
|
+
NL: "nl-NL",
|
|
38368
|
+
ES: "es-ES",
|
|
38369
|
+
IT: "it-IT",
|
|
38370
|
+
PT: "pt-PT",
|
|
38371
|
+
BR: "pt-BR",
|
|
38372
|
+
SE: "sv-SE",
|
|
38373
|
+
NO: "nb-NO",
|
|
38374
|
+
DK: "da-DK",
|
|
38375
|
+
FI: "fi-FI",
|
|
38376
|
+
PL: "pl-PL",
|
|
38377
|
+
JP: "ja-JP",
|
|
38378
|
+
CN: "zh-CN",
|
|
38379
|
+
IN: "en-IN",
|
|
38380
|
+
SG: "en-SG"
|
|
38381
|
+
};
|
|
38382
|
+
function localeForCountry(country) {
|
|
38383
|
+
if (!country) return "en-US";
|
|
38384
|
+
const key = country.toUpperCase();
|
|
38385
|
+
return COUNTRY_LOCALES[key] ?? "en-US";
|
|
38386
|
+
}
|
|
38387
|
+
const toNumber = (value) => {
|
|
38388
|
+
if (typeof value === "number") return value;
|
|
38389
|
+
if (value.trim() === "") return Number.NaN;
|
|
38390
|
+
const parsed = Number(value);
|
|
38391
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
38392
|
+
};
|
|
38393
|
+
function formatMonetary(monetary, options = {}) {
|
|
38394
|
+
const {
|
|
38395
|
+
locale: explicitLocale,
|
|
38396
|
+
country,
|
|
38397
|
+
fallbackCurrency = "USD",
|
|
38398
|
+
compactWholeNumbers = true
|
|
38399
|
+
} = options;
|
|
38400
|
+
if (monetary === null || monetary === void 0) return "";
|
|
38401
|
+
let amount;
|
|
38402
|
+
let currency;
|
|
38403
|
+
if (typeof monetary === "number" || typeof monetary === "string") {
|
|
38404
|
+
amount = toNumber(monetary);
|
|
38405
|
+
currency = fallbackCurrency.toUpperCase();
|
|
38406
|
+
} else {
|
|
38407
|
+
amount = toNumber(monetary.amount);
|
|
38408
|
+
currency = (monetary.currency || fallbackCurrency).toUpperCase();
|
|
38409
|
+
}
|
|
38410
|
+
if (!Number.isFinite(amount)) return "";
|
|
38411
|
+
const locale = explicitLocale ?? localeForCountry(country);
|
|
38412
|
+
let nativeFractionDigits = 2;
|
|
38413
|
+
try {
|
|
38414
|
+
const resolved = new Intl.NumberFormat(locale, {
|
|
38415
|
+
style: "currency",
|
|
38416
|
+
currency
|
|
38417
|
+
}).resolvedOptions().maximumFractionDigits;
|
|
38418
|
+
if (typeof resolved === "number") nativeFractionDigits = resolved;
|
|
38419
|
+
} catch {
|
|
38420
|
+
}
|
|
38421
|
+
const isWhole = Number.isInteger(amount);
|
|
38422
|
+
const minimumFractionDigits = compactWholeNumbers && isWhole ? 0 : nativeFractionDigits;
|
|
38423
|
+
const subUnitThreshold = 10 ** -nativeFractionDigits;
|
|
38424
|
+
const subUnit = Math.abs(amount) > 0 && Math.abs(amount) < subUnitThreshold;
|
|
38425
|
+
const maximumFractionDigits = subUnit ? Math.max(6, nativeFractionDigits) : nativeFractionDigits;
|
|
38426
|
+
try {
|
|
38427
|
+
return new Intl.NumberFormat(locale, {
|
|
38428
|
+
style: "currency",
|
|
38429
|
+
currency,
|
|
38430
|
+
minimumFractionDigits,
|
|
38431
|
+
maximumFractionDigits
|
|
38432
|
+
}).format(amount);
|
|
38433
|
+
} catch {
|
|
38434
|
+
const fallbackDigits = subUnit ? maximumFractionDigits : minimumFractionDigits;
|
|
38435
|
+
return `${amount.toFixed(fallbackDigits)} ${currency}`;
|
|
38436
|
+
}
|
|
38437
|
+
}
|
|
38310
38438
|
const TABULAR_NUMS = { fontVariantNumeric: "tabular-nums" };
|
|
38311
38439
|
function Currency({ value, precise = false, currency, style, ...rest }) {
|
|
38312
38440
|
let formatted;
|
|
@@ -38622,8 +38750,10 @@ const DefaultChevronIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
38622
38750
|
function ListRow({
|
|
38623
38751
|
avatarSrc,
|
|
38624
38752
|
avatarFallback,
|
|
38625
|
-
avatarColor
|
|
38753
|
+
avatarColor,
|
|
38754
|
+
avatarColorFromName = false,
|
|
38626
38755
|
title,
|
|
38756
|
+
avatarName = title,
|
|
38627
38757
|
subtitle,
|
|
38628
38758
|
value,
|
|
38629
38759
|
valueSubtitle,
|
|
@@ -38639,7 +38769,17 @@ function ListRow({
|
|
|
38639
38769
|
const isClickable = Boolean(onClick);
|
|
38640
38770
|
const displayChevron = showChevron ?? isClickable;
|
|
38641
38771
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
|
|
38642
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38772
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38773
|
+
Avatar,
|
|
38774
|
+
{
|
|
38775
|
+
src: avatarSrc,
|
|
38776
|
+
alt: title,
|
|
38777
|
+
name: avatarName,
|
|
38778
|
+
size: 40,
|
|
38779
|
+
color: avatarColor ?? (avatarColorFromName ? void 0 : colors.primary),
|
|
38780
|
+
children: avatarFallback
|
|
38781
|
+
}
|
|
38782
|
+
),
|
|
38643
38783
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { flex: 1, miw: 0, children: [
|
|
38644
38784
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { fw: 500, size: "sm", truncate: true, children: title }),
|
|
38645
38785
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, lh: 1.3, children: subtitle })
|
|
@@ -40208,7 +40348,7 @@ function DocumentRow({
|
|
|
40208
40348
|
{
|
|
40209
40349
|
title: name,
|
|
40210
40350
|
subtitle: subtitle || void 0,
|
|
40211
|
-
|
|
40351
|
+
avatarName: name,
|
|
40212
40352
|
avatarColor: colors.neutral,
|
|
40213
40353
|
rightSection,
|
|
40214
40354
|
onClick,
|
|
@@ -40234,7 +40374,8 @@ function EquityGrantCard({
|
|
|
40234
40374
|
ListRow,
|
|
40235
40375
|
{
|
|
40236
40376
|
avatarSrc: logoUrl,
|
|
40237
|
-
|
|
40377
|
+
avatarName: companyName,
|
|
40378
|
+
avatarColorFromName: true,
|
|
40238
40379
|
title: companyName,
|
|
40239
40380
|
subtitle,
|
|
40240
40381
|
value: estimatedValue !== void 0 ? formatCurrency(estimatedValue) : void 0,
|
|
@@ -40257,7 +40398,8 @@ function InvestmentCard({
|
|
|
40257
40398
|
ListRow,
|
|
40258
40399
|
{
|
|
40259
40400
|
avatarSrc: logoUrl,
|
|
40260
|
-
|
|
40401
|
+
avatarName: companyName,
|
|
40402
|
+
avatarColorFromName: true,
|
|
40261
40403
|
title: companyName,
|
|
40262
40404
|
subtitle: status,
|
|
40263
40405
|
rightSection: rightSection ?? /* @__PURE__ */ jsxRuntime.jsx(Currency, { value, fw: 500, size: "sm" }),
|
|
@@ -40329,17 +40471,7 @@ function InvestorProfileCard({
|
|
|
40329
40471
|
const [isAvatarHovered, setIsAvatarHovered] = React.useState(false);
|
|
40330
40472
|
const [isAvatarFocused, setIsAvatarFocused] = React.useState(false);
|
|
40331
40473
|
const displayName = name?.trim() || "Add your name";
|
|
40332
|
-
const avatarEl = /* @__PURE__ */ jsxRuntime.jsx(
|
|
40333
|
-
Avatar,
|
|
40334
|
-
{
|
|
40335
|
-
src: avatarUrl,
|
|
40336
|
-
alt: displayName,
|
|
40337
|
-
radius: "md",
|
|
40338
|
-
size: 56,
|
|
40339
|
-
color: getAvatarColor(displayName),
|
|
40340
|
-
children: displayName.charAt(0).toUpperCase()
|
|
40341
|
-
}
|
|
40342
|
-
);
|
|
40474
|
+
const avatarEl = /* @__PURE__ */ jsxRuntime.jsx(Avatar, { name: displayName, src: avatarUrl, alt: displayName, radius: "md", size: 56 });
|
|
40343
40475
|
return /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "md", children: [
|
|
40344
40476
|
/* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: "md", wrap: "nowrap", children: [
|
|
40345
40477
|
onUploadPhoto ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -41098,9 +41230,11 @@ exports.emailSchema = emailSchema;
|
|
|
41098
41230
|
exports.ethereumAddressSchema = ethereumAddressSchema;
|
|
41099
41231
|
exports.fairmintCssVariables = fairmintCssVariables;
|
|
41100
41232
|
exports.fairmintVars = fairmintVars;
|
|
41233
|
+
exports.fontSizes = fontSizes;
|
|
41101
41234
|
exports.formatCurrency = formatCurrency;
|
|
41102
41235
|
exports.formatCurrencyPrecise = formatCurrencyPrecise;
|
|
41103
41236
|
exports.formatDate = formatDate;
|
|
41237
|
+
exports.formatMonetary = formatMonetary;
|
|
41104
41238
|
exports.formatNumber = formatNumber;
|
|
41105
41239
|
exports.formatPercent = formatPercent;
|
|
41106
41240
|
exports.formatPhone = formatPhone;
|
|
@@ -41114,6 +41248,7 @@ exports.getWalletLabel = getWalletLabel;
|
|
|
41114
41248
|
exports.isEthereumAddress = isEthereumAddress;
|
|
41115
41249
|
exports.isRemovableWalletType = isRemovableWalletType;
|
|
41116
41250
|
exports.isSystemWalletType = isSystemWalletType;
|
|
41251
|
+
exports.localeForCountry = localeForCountry;
|
|
41117
41252
|
exports.neutralColors = neutralColors;
|
|
41118
41253
|
exports.normalizePhone = normalizePhone;
|
|
41119
41254
|
exports.normalizeWalletType = normalizeWalletType;
|