@fairmint/ui 0.2.22 → 0.2.23

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.
@@ -36334,6 +36334,28 @@ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36334
36334
  xid,
36335
36335
  xor
36336
36336
  }, Symbol.toStringTag, { value: "Module" }));
36337
+ const fontSizes = {
36338
+ /** 12px — labels, captions, table headers */
36339
+ xs: "0.75rem",
36340
+ /** 14px — secondary body text, meta */
36341
+ sm: "0.875rem",
36342
+ /** 16px — default body text */
36343
+ md: "1rem",
36344
+ /** 18px — large body, lead text */
36345
+ lg: "1.125rem",
36346
+ /** 20px — small headings, emphasized values */
36347
+ xl: "1.25rem",
36348
+ /** 24px — section values, stat subtitles */
36349
+ "2xl": "1.5rem",
36350
+ /** 28px — card hero values */
36351
+ "3xl": "1.75rem",
36352
+ /** 32px — page hero values */
36353
+ "4xl": "2rem",
36354
+ /** 36px — large display values */
36355
+ "5xl": "2.25rem",
36356
+ /** 40px — extra-large display values */
36357
+ "6xl": "2.5rem"
36358
+ };
36337
36359
  const spacing = {
36338
36360
  xs: "0.625rem",
36339
36361
  sm: "0.75rem",
@@ -36493,6 +36515,13 @@ const theme = createTheme({
36493
36515
  radius: radii,
36494
36516
  defaultRadius: "md",
36495
36517
  spacing,
36518
+ fontSizes: {
36519
+ xs: fontSizes.xs,
36520
+ sm: fontSizes.sm,
36521
+ md: fontSizes.md,
36522
+ lg: fontSizes.lg,
36523
+ xl: fontSizes.xl
36524
+ },
36496
36525
  breakpoints: {
36497
36526
  xs: "30em",
36498
36527
  sm: "48em",
@@ -36618,7 +36647,40 @@ ActionIcon.displayName = "ActionIcon";
36618
36647
  function Alert(props) {
36619
36648
  return /* @__PURE__ */ jsx(Alert$1, { ...props });
36620
36649
  }
36621
- const Avatar = forwardRef((props, ref) => /* @__PURE__ */ jsx(Avatar$1, { radius: "md", color: colors.primary, ...props, ref }));
36650
+ function getAvatarColor(name) {
36651
+ if (!name) return AVATAR_PALETTE[0];
36652
+ let hash2 = 0;
36653
+ for (let i = 0; i < name.length; i++) {
36654
+ hash2 = hash2 * 31 + name.charCodeAt(i) >>> 0;
36655
+ }
36656
+ return AVATAR_PALETTE[hash2 % AVATAR_PALETTE.length];
36657
+ }
36658
+ function getInitials(name) {
36659
+ const words = name.trim().split(/\s+/).filter(Boolean);
36660
+ if (words.length >= 2) {
36661
+ return (words[0][0] + words[1][0]).toUpperCase();
36662
+ }
36663
+ if (words.length === 1) {
36664
+ return words[0][0].toUpperCase();
36665
+ }
36666
+ return "";
36667
+ }
36668
+ const Avatar = forwardRef(
36669
+ ({ children, color, name, ...props }, ref) => {
36670
+ const normalizedName = name?.trim() ?? "";
36671
+ const fallbackInitial = normalizedName ? Array.from(normalizedName)[0]?.toUpperCase() : void 0;
36672
+ return /* @__PURE__ */ jsx(
36673
+ Avatar$1,
36674
+ {
36675
+ radius: "md",
36676
+ color: color ?? (normalizedName ? getAvatarColor(normalizedName) : colors.primary),
36677
+ ...props,
36678
+ ref,
36679
+ children: children ?? fallbackInitial
36680
+ }
36681
+ );
36682
+ }
36683
+ );
36622
36684
  Avatar.displayName = "Avatar";
36623
36685
  const Badge = forwardRef((props, ref) => /* @__PURE__ */ jsx(Badge$1, { variant: "light", ...props, ref }));
36624
36686
  Badge.displayName = "Badge";
@@ -38114,24 +38176,6 @@ function ColorDot({ color, size: size2 = 8, style, ...rest }) {
38114
38176
  };
38115
38177
  return /* @__PURE__ */ jsx(Box, { "data-testid": "color-dot", style: [baseStyle, style], ...rest });
38116
38178
  }
38117
- function getAvatarColor(name) {
38118
- if (!name) return AVATAR_PALETTE[0];
38119
- let hash2 = 0;
38120
- for (let i = 0; i < name.length; i++) {
38121
- hash2 = hash2 * 31 + name.charCodeAt(i) >>> 0;
38122
- }
38123
- return AVATAR_PALETTE[hash2 % AVATAR_PALETTE.length];
38124
- }
38125
- function getInitials(name) {
38126
- const words = name.trim().split(/\s+/).filter(Boolean);
38127
- if (words.length >= 2) {
38128
- return (words[0][0] + words[1][0]).toUpperCase();
38129
- }
38130
- if (words.length === 1) {
38131
- return words[0][0].toUpperCase();
38132
- }
38133
- return "";
38134
- }
38135
38179
  const BRAND_GRADIENT = `linear-gradient(90deg, ${brandColors.blue} 0%, ${brandColors.indigo} 50%, ${brandColors.purple} 100%)`;
38136
38180
  function CompanyBanner({
38137
38181
  companyName,
@@ -38604,8 +38648,10 @@ const DefaultChevronIcon = () => /* @__PURE__ */ jsx(
38604
38648
  function ListRow({
38605
38649
  avatarSrc,
38606
38650
  avatarFallback,
38607
- avatarColor = colors.primary,
38651
+ avatarColor,
38652
+ avatarColorFromName = false,
38608
38653
  title,
38654
+ avatarName = title,
38609
38655
  subtitle,
38610
38656
  value,
38611
38657
  valueSubtitle,
@@ -38621,7 +38667,17 @@ function ListRow({
38621
38667
  const isClickable = Boolean(onClick);
38622
38668
  const displayChevron = showChevron ?? isClickable;
38623
38669
  const content = /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
38624
- /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, alt: title, radius: "md", size: 40, color: avatarColor, children: avatarFallback ?? title.charAt(0).toUpperCase() }),
38670
+ /* @__PURE__ */ jsx(
38671
+ Avatar,
38672
+ {
38673
+ src: avatarSrc,
38674
+ alt: title,
38675
+ name: avatarName,
38676
+ size: 40,
38677
+ color: avatarColor ?? (avatarColorFromName ? void 0 : colors.primary),
38678
+ children: avatarFallback
38679
+ }
38680
+ ),
38625
38681
  /* @__PURE__ */ jsxs(Box, { flex: 1, miw: 0, children: [
38626
38682
  /* @__PURE__ */ jsx(Text, { fw: 500, size: "sm", truncate: true, children: title }),
38627
38683
  subtitle && /* @__PURE__ */ jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, lh: 1.3, children: subtitle })
@@ -40190,7 +40246,7 @@ function DocumentRow({
40190
40246
  {
40191
40247
  title: name,
40192
40248
  subtitle: subtitle || void 0,
40193
- avatarFallback: name.charAt(0).toUpperCase(),
40249
+ avatarName: name,
40194
40250
  avatarColor: colors.neutral,
40195
40251
  rightSection,
40196
40252
  onClick,
@@ -40216,7 +40272,8 @@ function EquityGrantCard({
40216
40272
  ListRow,
40217
40273
  {
40218
40274
  avatarSrc: logoUrl,
40219
- avatarColor: getAvatarColor(companyName),
40275
+ avatarName: companyName,
40276
+ avatarColorFromName: true,
40220
40277
  title: companyName,
40221
40278
  subtitle,
40222
40279
  value: estimatedValue !== void 0 ? formatCurrency(estimatedValue) : void 0,
@@ -40239,7 +40296,8 @@ function InvestmentCard({
40239
40296
  ListRow,
40240
40297
  {
40241
40298
  avatarSrc: logoUrl,
40242
- avatarColor: getAvatarColor(companyName),
40299
+ avatarName: companyName,
40300
+ avatarColorFromName: true,
40243
40301
  title: companyName,
40244
40302
  subtitle: status,
40245
40303
  rightSection: rightSection ?? /* @__PURE__ */ jsx(Currency, { value, fw: 500, size: "sm" }),
@@ -40311,17 +40369,7 @@ function InvestorProfileCard({
40311
40369
  const [isAvatarHovered, setIsAvatarHovered] = useState(false);
40312
40370
  const [isAvatarFocused, setIsAvatarFocused] = useState(false);
40313
40371
  const displayName = name?.trim() || "Add your name";
40314
- const avatarEl = /* @__PURE__ */ jsx(
40315
- Avatar,
40316
- {
40317
- src: avatarUrl,
40318
- alt: displayName,
40319
- radius: "md",
40320
- size: 56,
40321
- color: getAvatarColor(displayName),
40322
- children: displayName.charAt(0).toUpperCase()
40323
- }
40324
- );
40372
+ const avatarEl = /* @__PURE__ */ jsx(Avatar, { name: displayName, src: avatarUrl, alt: displayName, radius: "md", size: 56 });
40325
40373
  return /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
40326
40374
  /* @__PURE__ */ jsxs(Group, { gap: "md", wrap: "nowrap", children: [
40327
40375
  onUploadPhoto ? /* @__PURE__ */ jsxs(
@@ -41081,6 +41129,7 @@ export {
41081
41129
  ethereumAddressSchema,
41082
41130
  fairmintCssVariables,
41083
41131
  fairmintVars,
41132
+ fontSizes,
41084
41133
  formatCurrency,
41085
41134
  formatCurrencyPrecise,
41086
41135
  formatDate,