@verma-consulting/design-library 0.1.59 → 0.1.61
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/LICENSE +21 -0
- package/dist/index.js +22 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -238,28 +238,34 @@ var wordmarkCore = {
|
|
|
238
238
|
fontWeight: 600,
|
|
239
239
|
letterSpacing: "-0.015em",
|
|
240
240
|
lineHeight: 1.35,
|
|
241
|
-
color
|
|
241
|
+
/** Brand wordmark color (matches pre-refactor Logo); avoids dark `text.primary` on dark surfaces when theme mode is still light. */
|
|
242
|
+
color: "primary.main"
|
|
242
243
|
};
|
|
243
|
-
function
|
|
244
|
+
function wordmarkFontSize(centered, hasRowLogo) {
|
|
245
|
+
if (centered) return "1.0625rem";
|
|
246
|
+
if (!hasRowLogo) return "1.0625rem";
|
|
247
|
+
return "1rem";
|
|
248
|
+
}
|
|
249
|
+
function wordmarkSx(centered, hasRowLogo) {
|
|
244
250
|
return {
|
|
245
251
|
...wordmarkCore,
|
|
246
252
|
...centered ? {
|
|
247
|
-
fontSize:
|
|
253
|
+
fontSize: wordmarkFontSize(true, false),
|
|
248
254
|
textAlign: "center",
|
|
249
255
|
wordBreak: "break-word"
|
|
250
256
|
} : {
|
|
251
|
-
fontSize:
|
|
257
|
+
fontSize: wordmarkFontSize(false, hasRowLogo),
|
|
252
258
|
overflow: "hidden",
|
|
253
259
|
textOverflow: "ellipsis",
|
|
254
260
|
whiteSpace: "nowrap"
|
|
255
261
|
}
|
|
256
262
|
};
|
|
257
263
|
}
|
|
258
|
-
function companySlotTypographySx(centered) {
|
|
264
|
+
function companySlotTypographySx(centered, hasRowLogo) {
|
|
259
265
|
return {
|
|
260
266
|
"& .MuiTypography-root": {
|
|
261
267
|
...wordmarkCore,
|
|
262
|
-
fontSize: centered ?
|
|
268
|
+
fontSize: wordmarkFontSize(centered, centered ? false : hasRowLogo),
|
|
263
269
|
textAlign: centered ? "center" : "inherit",
|
|
264
270
|
overflow: "hidden",
|
|
265
271
|
textOverflow: "ellipsis",
|
|
@@ -273,6 +279,7 @@ function CompanySlot({
|
|
|
273
279
|
maxWidth,
|
|
274
280
|
harmonizeCompanyTypography,
|
|
275
281
|
companySlotSx,
|
|
282
|
+
hasRowLogo,
|
|
276
283
|
children
|
|
277
284
|
}) {
|
|
278
285
|
return /* @__PURE__ */ jsx3(
|
|
@@ -285,7 +292,7 @@ function CompanySlot({
|
|
|
285
292
|
display: "flex",
|
|
286
293
|
justifyContent: centered ? "center" : "flex-start",
|
|
287
294
|
alignItems: "center",
|
|
288
|
-
...harmonizeCompanyTypography ? companySlotTypographySx(centered) : null,
|
|
295
|
+
...harmonizeCompanyTypography ? companySlotTypographySx(centered, hasRowLogo) : null,
|
|
289
296
|
...companySlotSx
|
|
290
297
|
},
|
|
291
298
|
children
|
|
@@ -309,13 +316,14 @@ var Logo = memo(
|
|
|
309
316
|
const maxWidth = mdMatches ? 160 : 320;
|
|
310
317
|
const companyName = (organization == null ? void 0 : organization.name) || "\u2013";
|
|
311
318
|
const logoUrl = (_a2 = organization == null ? void 0 : organization.logo) == null ? void 0 : _a2.url;
|
|
319
|
+
const hasRowLogo = !!(logoUrl || defaultLogo);
|
|
312
320
|
const avatarSx = {
|
|
313
321
|
fontFamily: LOGO_FONT_STACK,
|
|
314
322
|
bgcolor: "primary.main",
|
|
315
323
|
fontWeight: 600,
|
|
316
324
|
letterSpacing: "-0.02em"
|
|
317
325
|
};
|
|
318
|
-
const wm = wordmarkSx(centered);
|
|
326
|
+
const wm = wordmarkSx(centered, hasRowLogo);
|
|
319
327
|
if (centered) {
|
|
320
328
|
return /* @__PURE__ */ jsxs(
|
|
321
329
|
Stack,
|
|
@@ -324,10 +332,12 @@ var Logo = memo(
|
|
|
324
332
|
onClick: handleClick,
|
|
325
333
|
sx: {
|
|
326
334
|
cursor: "pointer",
|
|
327
|
-
alignItems: "
|
|
335
|
+
alignItems: "center",
|
|
328
336
|
width: "100%",
|
|
329
337
|
maxWidth,
|
|
330
|
-
minWidth: 0
|
|
338
|
+
minWidth: 0,
|
|
339
|
+
mx: "auto",
|
|
340
|
+
"&:hover": { opacity: 0.9, transition: "opacity 0.2s ease-in-out" }
|
|
331
341
|
},
|
|
332
342
|
children: [
|
|
333
343
|
(logoUrl || defaultLogo) && /* @__PURE__ */ jsx3(
|
|
@@ -373,6 +383,7 @@ var Logo = memo(
|
|
|
373
383
|
maxWidth,
|
|
374
384
|
harmonizeCompanyTypography,
|
|
375
385
|
companySlotSx,
|
|
386
|
+
hasRowLogo,
|
|
376
387
|
children: companyComponent
|
|
377
388
|
}
|
|
378
389
|
)
|
|
@@ -416,6 +427,7 @@ var Logo = memo(
|
|
|
416
427
|
maxWidth,
|
|
417
428
|
harmonizeCompanyTypography,
|
|
418
429
|
companySlotSx,
|
|
430
|
+
hasRowLogo,
|
|
419
431
|
children: companyComponent
|
|
420
432
|
}
|
|
421
433
|
) })
|