@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 +68 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -228,7 +228,8 @@ import {
|
|
|
228
228
|
Tooltip,
|
|
229
229
|
Box as Box2,
|
|
230
230
|
useTheme,
|
|
231
|
-
useMediaQuery
|
|
231
|
+
useMediaQuery,
|
|
232
|
+
Stack
|
|
232
233
|
} from "@mui/material";
|
|
233
234
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
234
235
|
var LOGO_FONT_STACK = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';
|
|
@@ -237,28 +238,34 @@ var wordmarkCore = {
|
|
|
237
238
|
fontWeight: 600,
|
|
238
239
|
letterSpacing: "-0.015em",
|
|
239
240
|
lineHeight: 1.35,
|
|
240
|
-
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"
|
|
241
243
|
};
|
|
242
|
-
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) {
|
|
243
250
|
return {
|
|
244
251
|
...wordmarkCore,
|
|
245
252
|
...centered ? {
|
|
246
|
-
fontSize:
|
|
253
|
+
fontSize: wordmarkFontSize(true, false),
|
|
247
254
|
textAlign: "center",
|
|
248
255
|
wordBreak: "break-word"
|
|
249
256
|
} : {
|
|
250
|
-
fontSize:
|
|
257
|
+
fontSize: wordmarkFontSize(false, hasRowLogo),
|
|
251
258
|
overflow: "hidden",
|
|
252
259
|
textOverflow: "ellipsis",
|
|
253
260
|
whiteSpace: "nowrap"
|
|
254
261
|
}
|
|
255
262
|
};
|
|
256
263
|
}
|
|
257
|
-
function companySlotTypographySx(centered) {
|
|
264
|
+
function companySlotTypographySx(centered, hasRowLogo) {
|
|
258
265
|
return {
|
|
259
266
|
"& .MuiTypography-root": {
|
|
260
267
|
...wordmarkCore,
|
|
261
|
-
fontSize: centered ?
|
|
268
|
+
fontSize: wordmarkFontSize(centered, centered ? false : hasRowLogo),
|
|
262
269
|
textAlign: centered ? "center" : "inherit",
|
|
263
270
|
overflow: "hidden",
|
|
264
271
|
textOverflow: "ellipsis",
|
|
@@ -272,6 +279,7 @@ function CompanySlot({
|
|
|
272
279
|
maxWidth,
|
|
273
280
|
harmonizeCompanyTypography,
|
|
274
281
|
companySlotSx,
|
|
282
|
+
hasRowLogo,
|
|
275
283
|
children
|
|
276
284
|
}) {
|
|
277
285
|
return /* @__PURE__ */ jsx3(
|
|
@@ -284,7 +292,7 @@ function CompanySlot({
|
|
|
284
292
|
display: "flex",
|
|
285
293
|
justifyContent: centered ? "center" : "flex-start",
|
|
286
294
|
alignItems: "center",
|
|
287
|
-
...harmonizeCompanyTypography ? companySlotTypographySx(centered) : null,
|
|
295
|
+
...harmonizeCompanyTypography ? companySlotTypographySx(centered, hasRowLogo) : null,
|
|
288
296
|
...companySlotSx
|
|
289
297
|
},
|
|
290
298
|
children
|
|
@@ -308,50 +316,77 @@ var Logo = memo(
|
|
|
308
316
|
const maxWidth = mdMatches ? 160 : 320;
|
|
309
317
|
const companyName = (organization == null ? void 0 : organization.name) || "\u2013";
|
|
310
318
|
const logoUrl = (_a2 = organization == null ? void 0 : organization.logo) == null ? void 0 : _a2.url;
|
|
319
|
+
const hasRowLogo = !!(logoUrl || defaultLogo);
|
|
311
320
|
const avatarSx = {
|
|
312
321
|
fontFamily: LOGO_FONT_STACK,
|
|
313
322
|
bgcolor: "primary.main",
|
|
314
323
|
fontWeight: 600,
|
|
315
324
|
letterSpacing: "-0.02em"
|
|
316
325
|
};
|
|
317
|
-
const wm = wordmarkSx(centered);
|
|
326
|
+
const wm = wordmarkSx(centered, hasRowLogo);
|
|
318
327
|
if (centered) {
|
|
319
328
|
return /* @__PURE__ */ jsxs(
|
|
320
|
-
|
|
329
|
+
Stack,
|
|
321
330
|
{
|
|
322
|
-
container: true,
|
|
323
|
-
direction: "column",
|
|
324
|
-
alignItems: "center",
|
|
325
|
-
justifyContent: "center",
|
|
326
331
|
spacing: 1,
|
|
327
|
-
sx: { cursor: "pointer" },
|
|
328
332
|
onClick: handleClick,
|
|
333
|
+
sx: {
|
|
334
|
+
cursor: "pointer",
|
|
335
|
+
alignItems: "stretch",
|
|
336
|
+
width: "100%",
|
|
337
|
+
maxWidth,
|
|
338
|
+
minWidth: 0
|
|
339
|
+
},
|
|
329
340
|
children: [
|
|
330
|
-
(logoUrl || defaultLogo) && /* @__PURE__ */ jsx3(
|
|
331
|
-
|
|
341
|
+
(logoUrl || defaultLogo) && /* @__PURE__ */ jsx3(
|
|
342
|
+
Box2,
|
|
332
343
|
{
|
|
333
|
-
alt: companyName || "avatar",
|
|
334
|
-
src: logoUrl,
|
|
335
344
|
sx: {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
345
|
+
display: "flex",
|
|
346
|
+
justifyContent: "center",
|
|
347
|
+
alignItems: "center",
|
|
348
|
+
width: "100%"
|
|
340
349
|
},
|
|
341
|
-
|
|
342
|
-
|
|
350
|
+
children: logoUrl ? /* @__PURE__ */ jsx3(
|
|
351
|
+
Avatar,
|
|
352
|
+
{
|
|
353
|
+
alt: companyName || "avatar",
|
|
354
|
+
src: logoUrl,
|
|
355
|
+
sx: {
|
|
356
|
+
width: 64,
|
|
357
|
+
height: 64,
|
|
358
|
+
fontSize: "1.125rem",
|
|
359
|
+
...avatarSx
|
|
360
|
+
},
|
|
361
|
+
imgProps: { loading: "lazy" },
|
|
362
|
+
children: (companyName == null ? void 0 : companyName.charAt(0)) || "?"
|
|
363
|
+
}
|
|
364
|
+
) : defaultLogo
|
|
343
365
|
}
|
|
344
|
-
)
|
|
345
|
-
/* @__PURE__ */ jsx3(
|
|
346
|
-
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ jsx3(
|
|
368
|
+
Box2,
|
|
347
369
|
{
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
370
|
+
sx: {
|
|
371
|
+
width: "100%",
|
|
372
|
+
minWidth: 0,
|
|
373
|
+
display: "flex",
|
|
374
|
+
justifyContent: "center",
|
|
375
|
+
textAlign: "center"
|
|
376
|
+
},
|
|
377
|
+
children: loggedIn ? /* @__PURE__ */ jsx3(Tooltip, { title: companyName, placement: "top", arrow: true, children: /* @__PURE__ */ jsx3(Typography, { component: "span", sx: wm, children: companyName }) }) : /* @__PURE__ */ jsx3(
|
|
378
|
+
CompanySlot,
|
|
379
|
+
{
|
|
380
|
+
centered: true,
|
|
381
|
+
maxWidth,
|
|
382
|
+
harmonizeCompanyTypography,
|
|
383
|
+
companySlotSx,
|
|
384
|
+
hasRowLogo,
|
|
385
|
+
children: companyComponent
|
|
386
|
+
}
|
|
387
|
+
)
|
|
353
388
|
}
|
|
354
|
-
)
|
|
389
|
+
)
|
|
355
390
|
]
|
|
356
391
|
}
|
|
357
392
|
);
|
|
@@ -390,6 +425,7 @@ var Logo = memo(
|
|
|
390
425
|
maxWidth,
|
|
391
426
|
harmonizeCompanyTypography,
|
|
392
427
|
companySlotSx,
|
|
428
|
+
hasRowLogo,
|
|
393
429
|
children: companyComponent
|
|
394
430
|
}
|
|
395
431
|
) })
|
|
@@ -1811,7 +1847,7 @@ import {
|
|
|
1811
1847
|
import {
|
|
1812
1848
|
Autocomplete as Autocomplete2,
|
|
1813
1849
|
Box as Box9,
|
|
1814
|
-
Stack,
|
|
1850
|
+
Stack as Stack2,
|
|
1815
1851
|
TextField as TextField2,
|
|
1816
1852
|
useTheme as useTheme11,
|
|
1817
1853
|
useMediaQuery as useMediaQuery4
|
|
@@ -2060,7 +2096,7 @@ var PhoneNumberField = ({
|
|
|
2060
2096
|
onBlurCapture: handleWrapperBlur,
|
|
2061
2097
|
sx: { display: "flex", alignItems: "center", width: "100%" },
|
|
2062
2098
|
children: /* @__PURE__ */ jsxs10(
|
|
2063
|
-
|
|
2099
|
+
Stack2,
|
|
2064
2100
|
{
|
|
2065
2101
|
direction: "row",
|
|
2066
2102
|
spacing: 0,
|