@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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 vermadev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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,13 +361,14 @@ 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
374
  import_material2.Stack,
@@ -369,10 +377,12 @@ var Logo = (0, import_react.memo)(
369
377
  onClick: handleClick,
370
378
  sx: {
371
379
  cursor: "pointer",
372
- alignItems: "stretch",
380
+ alignItems: "center",
373
381
  width: "100%",
374
382
  maxWidth,
375
- minWidth: 0
383
+ minWidth: 0,
384
+ mx: "auto",
385
+ "&:hover": { opacity: 0.9, transition: "opacity 0.2s ease-in-out" }
376
386
  },
377
387
  children: [
378
388
  (logoUrl || defaultLogo) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -418,6 +428,7 @@ var Logo = (0, import_react.memo)(
418
428
  maxWidth,
419
429
  harmonizeCompanyTypography,
420
430
  companySlotSx,
431
+ hasRowLogo,
421
432
  children: companyComponent
422
433
  }
423
434
  )
@@ -461,6 +472,7 @@ var Logo = (0, import_react.memo)(
461
472
  maxWidth,
462
473
  harmonizeCompanyTypography,
463
474
  companySlotSx,
475
+ hasRowLogo,
464
476
  children: companyComponent
465
477
  }
466
478
  ) })