@verma-consulting/design-library 0.1.58 → 0.1.60

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/index.js CHANGED
@@ -283,28 +283,34 @@ var wordmarkCore = {
283
283
  fontWeight: 600,
284
284
  letterSpacing: "-0.015em",
285
285
  lineHeight: 1.35,
286
- color: "text.primary"
286
+ /** Brand wordmark color (matches pre-refactor Logo); avoids dark `text.primary` on dark surfaces when theme mode is still light. */
287
+ color: "primary.main"
287
288
  };
288
- function wordmarkSx(centered) {
289
+ function wordmarkFontSize(centered, hasRowLogo) {
290
+ if (centered) return "1.0625rem";
291
+ if (!hasRowLogo) return "1.0625rem";
292
+ return "1rem";
293
+ }
294
+ function wordmarkSx(centered, hasRowLogo) {
289
295
  return {
290
296
  ...wordmarkCore,
291
297
  ...centered ? {
292
- fontSize: "1.0625rem",
298
+ fontSize: wordmarkFontSize(true, false),
293
299
  textAlign: "center",
294
300
  wordBreak: "break-word"
295
301
  } : {
296
- fontSize: "0.9375rem",
302
+ fontSize: wordmarkFontSize(false, hasRowLogo),
297
303
  overflow: "hidden",
298
304
  textOverflow: "ellipsis",
299
305
  whiteSpace: "nowrap"
300
306
  }
301
307
  };
302
308
  }
303
- function companySlotTypographySx(centered) {
309
+ function companySlotTypographySx(centered, hasRowLogo) {
304
310
  return {
305
311
  "& .MuiTypography-root": {
306
312
  ...wordmarkCore,
307
- fontSize: centered ? "1.0625rem" : "0.9375rem",
313
+ fontSize: wordmarkFontSize(centered, centered ? false : hasRowLogo),
308
314
  textAlign: centered ? "center" : "inherit",
309
315
  overflow: "hidden",
310
316
  textOverflow: "ellipsis",
@@ -318,6 +324,7 @@ function CompanySlot({
318
324
  maxWidth,
319
325
  harmonizeCompanyTypography,
320
326
  companySlotSx,
327
+ hasRowLogo,
321
328
  children
322
329
  }) {
323
330
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -330,7 +337,7 @@ function CompanySlot({
330
337
  display: "flex",
331
338
  justifyContent: centered ? "center" : "flex-start",
332
339
  alignItems: "center",
333
- ...harmonizeCompanyTypography ? companySlotTypographySx(centered) : null,
340
+ ...harmonizeCompanyTypography ? companySlotTypographySx(centered, hasRowLogo) : null,
334
341
  ...companySlotSx
335
342
  },
336
343
  children
@@ -354,50 +361,77 @@ var Logo = (0, import_react.memo)(
354
361
  const maxWidth = mdMatches ? 160 : 320;
355
362
  const companyName = (organization == null ? void 0 : organization.name) || "\u2013";
356
363
  const logoUrl = (_a2 = organization == null ? void 0 : organization.logo) == null ? void 0 : _a2.url;
364
+ const hasRowLogo = !!(logoUrl || defaultLogo);
357
365
  const avatarSx = {
358
366
  fontFamily: LOGO_FONT_STACK,
359
367
  bgcolor: "primary.main",
360
368
  fontWeight: 600,
361
369
  letterSpacing: "-0.02em"
362
370
  };
363
- const wm = wordmarkSx(centered);
371
+ const wm = wordmarkSx(centered, hasRowLogo);
364
372
  if (centered) {
365
373
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
366
- import_material2.Grid,
374
+ import_material2.Stack,
367
375
  {
368
- container: true,
369
- direction: "column",
370
- alignItems: "center",
371
- justifyContent: "center",
372
376
  spacing: 1,
373
- sx: { cursor: "pointer" },
374
377
  onClick: handleClick,
378
+ sx: {
379
+ cursor: "pointer",
380
+ alignItems: "stretch",
381
+ width: "100%",
382
+ maxWidth,
383
+ minWidth: 0
384
+ },
375
385
  children: [
376
- (logoUrl || defaultLogo) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Grid, { item: true, sx: { display: "flex", justifyContent: "center" }, children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
377
- import_material2.Avatar,
386
+ (logoUrl || defaultLogo) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
387
+ import_material2.Box,
378
388
  {
379
- alt: companyName || "avatar",
380
- src: logoUrl,
381
389
  sx: {
382
- width: 64,
383
- height: 64,
384
- fontSize: "1.125rem",
385
- ...avatarSx
390
+ display: "flex",
391
+ justifyContent: "center",
392
+ alignItems: "center",
393
+ width: "100%"
386
394
  },
387
- imgProps: { loading: "lazy" },
388
- children: (companyName == null ? void 0 : companyName.charAt(0)) || "?"
395
+ children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
396
+ import_material2.Avatar,
397
+ {
398
+ alt: companyName || "avatar",
399
+ src: logoUrl,
400
+ sx: {
401
+ width: 64,
402
+ height: 64,
403
+ fontSize: "1.125rem",
404
+ ...avatarSx
405
+ },
406
+ imgProps: { loading: "lazy" },
407
+ children: (companyName == null ? void 0 : companyName.charAt(0)) || "?"
408
+ }
409
+ ) : defaultLogo
389
410
  }
390
- ) : defaultLogo }),
391
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Grid, { item: true, sx: { maxWidth, width: "100%", textAlign: "center" }, children: loggedIn ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Tooltip, { title: companyName, placement: "top", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { component: "span", sx: wm, children: companyName }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
392
- CompanySlot,
411
+ ),
412
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
413
+ import_material2.Box,
393
414
  {
394
- centered: true,
395
- maxWidth,
396
- harmonizeCompanyTypography,
397
- companySlotSx,
398
- children: companyComponent
415
+ sx: {
416
+ width: "100%",
417
+ minWidth: 0,
418
+ display: "flex",
419
+ justifyContent: "center",
420
+ textAlign: "center"
421
+ },
422
+ children: loggedIn ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Tooltip, { title: companyName, placement: "top", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { component: "span", sx: wm, children: companyName }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
423
+ CompanySlot,
424
+ {
425
+ centered: true,
426
+ maxWidth,
427
+ harmonizeCompanyTypography,
428
+ companySlotSx,
429
+ hasRowLogo,
430
+ children: companyComponent
431
+ }
432
+ )
399
433
  }
400
- ) })
434
+ )
401
435
  ]
402
436
  }
403
437
  );
@@ -436,6 +470,7 @@ var Logo = (0, import_react.memo)(
436
470
  maxWidth,
437
471
  harmonizeCompanyTypography,
438
472
  companySlotSx,
473
+ hasRowLogo,
439
474
  children: companyComponent
440
475
  }
441
476
  ) })