@bwp-web/components 1.3.2 → 1.4.0
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/README.md +52 -39
- package/dist/BiampHeader/BiampHeader.d.ts.map +1 -1
- package/dist/BiampSidebar/BiampSidebar.d.ts +8 -2
- package/dist/BiampSidebar/BiampSidebar.d.ts.map +1 -1
- package/dist/index.cjs +200 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +198 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -421,37 +421,138 @@ function BiampWrapper({ children, sx, ...props }) {
|
|
|
421
421
|
import {
|
|
422
422
|
Box,
|
|
423
423
|
ListItemButton,
|
|
424
|
-
Stack as Stack2
|
|
424
|
+
Stack as Stack2,
|
|
425
|
+
Typography
|
|
425
426
|
} from "@mui/material";
|
|
426
|
-
import { BiampLogoIcon } from "@bwp-web/assets";
|
|
427
|
+
import { BiampLogoIcon, SquareRoundedArrowRightIcon } from "@bwp-web/assets";
|
|
428
|
+
import { createContext, useContext, useState } from "react";
|
|
427
429
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
430
|
+
var BiampSidebarContext = createContext({
|
|
431
|
+
expanded: false
|
|
432
|
+
});
|
|
428
433
|
function BiampSidebar({
|
|
429
434
|
children,
|
|
430
435
|
bottomLogoIcon,
|
|
436
|
+
bottomLogoText,
|
|
437
|
+
expandable = true,
|
|
438
|
+
expanded: expandedProp,
|
|
439
|
+
defaultExpanded = false,
|
|
440
|
+
onExpandedChange,
|
|
431
441
|
sx,
|
|
432
442
|
...props
|
|
433
443
|
}) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
444
|
+
const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
|
|
445
|
+
const isControlled = expandedProp !== void 0;
|
|
446
|
+
const expanded = isControlled ? expandedProp : internalExpanded;
|
|
447
|
+
const toggleExpanded = () => {
|
|
448
|
+
const next = !expanded;
|
|
449
|
+
if (!isControlled) setInternalExpanded(next);
|
|
450
|
+
onExpandedChange?.(next);
|
|
451
|
+
};
|
|
452
|
+
const width = expanded ? "240px" : "48px";
|
|
453
|
+
return /* @__PURE__ */ jsx2(BiampSidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ jsxs(
|
|
454
|
+
Stack2,
|
|
455
|
+
{
|
|
456
|
+
sx: {
|
|
457
|
+
width,
|
|
458
|
+
minWidth: width,
|
|
459
|
+
height: "100%",
|
|
460
|
+
overflowX: "hidden",
|
|
461
|
+
transition: ({ transitions }) => transitions.create(["width", "min-width"], {
|
|
462
|
+
easing: transitions.easing.sharp,
|
|
463
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
464
|
+
}),
|
|
465
|
+
...sx
|
|
466
|
+
},
|
|
467
|
+
...props,
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx2(Stack2, { sx: { flex: 1, minHeight: 0 }, children }),
|
|
470
|
+
expandable && /* @__PURE__ */ jsx2(
|
|
471
|
+
BiampSidebarIcon,
|
|
472
|
+
{
|
|
473
|
+
icon: /* @__PURE__ */ jsx2(
|
|
474
|
+
SquareRoundedArrowRightIcon,
|
|
475
|
+
{
|
|
476
|
+
sx: {
|
|
477
|
+
transform: expanded ? "rotate(180deg)" : "none",
|
|
478
|
+
transition: ({ transitions }) => transitions.create("transform", {
|
|
479
|
+
duration: transitions.duration.shorter
|
|
480
|
+
})
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
name: "Collapse menu",
|
|
485
|
+
onClick: toggleExpanded
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
/* @__PURE__ */ jsxs(
|
|
489
|
+
Stack2,
|
|
490
|
+
{
|
|
491
|
+
direction: "row",
|
|
492
|
+
alignItems: "center",
|
|
493
|
+
justifyContent: "space-between",
|
|
494
|
+
sx: { mt: 2, overflow: "hidden" },
|
|
495
|
+
children: [
|
|
496
|
+
bottomLogoIcon ?? /* @__PURE__ */ jsx2(
|
|
497
|
+
BiampLogoIcon,
|
|
498
|
+
{
|
|
499
|
+
sx: { width: "48px", height: "15px", flexShrink: 0 }
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
bottomLogoText && /* @__PURE__ */ jsx2(
|
|
503
|
+
Typography,
|
|
504
|
+
{
|
|
505
|
+
variant: "caption",
|
|
506
|
+
fontWeight: 500,
|
|
507
|
+
color: "sidebar.main",
|
|
508
|
+
noWrap: true,
|
|
509
|
+
sx: {
|
|
510
|
+
opacity: expanded ? 1 : 0,
|
|
511
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
512
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
513
|
+
})
|
|
514
|
+
},
|
|
515
|
+
children: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} ${bottomLogoText}`
|
|
516
|
+
}
|
|
517
|
+
)
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
) });
|
|
438
524
|
}
|
|
439
525
|
function BiampSidebarIconList({
|
|
440
526
|
children,
|
|
441
527
|
sx,
|
|
442
528
|
...props
|
|
443
529
|
}) {
|
|
444
|
-
return /* @__PURE__ */ jsx2(
|
|
530
|
+
return /* @__PURE__ */ jsx2(
|
|
531
|
+
Stack2,
|
|
532
|
+
{
|
|
533
|
+
sx: {
|
|
534
|
+
flex: 1,
|
|
535
|
+
minHeight: 0,
|
|
536
|
+
gap: "4px",
|
|
537
|
+
overflowY: "auto",
|
|
538
|
+
...sx
|
|
539
|
+
},
|
|
540
|
+
...props,
|
|
541
|
+
children
|
|
542
|
+
}
|
|
543
|
+
);
|
|
445
544
|
}
|
|
446
545
|
function BiampSidebarIcon({
|
|
447
546
|
selected,
|
|
448
547
|
icon,
|
|
449
548
|
selectedIcon,
|
|
549
|
+
name,
|
|
450
550
|
sx,
|
|
451
551
|
...props
|
|
452
552
|
}) {
|
|
553
|
+
const { expanded } = useContext(BiampSidebarContext);
|
|
453
554
|
const displayedSelectedIcon = selectedIcon ?? icon;
|
|
454
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ jsxs(
|
|
455
556
|
ListItemButton,
|
|
456
557
|
{
|
|
457
558
|
selected,
|
|
@@ -459,16 +560,50 @@ function BiampSidebarIcon({
|
|
|
459
560
|
disableRipple: true,
|
|
460
561
|
sx: {
|
|
461
562
|
minWidth: "48px",
|
|
462
|
-
maxWidth: "48px",
|
|
463
563
|
minHeight: "48px",
|
|
464
564
|
maxHeight: "48px",
|
|
465
565
|
borderRadius: "8px",
|
|
466
|
-
justifyContent: "
|
|
566
|
+
justifyContent: "flex-start",
|
|
467
567
|
alignItems: "center",
|
|
568
|
+
padding: 0,
|
|
569
|
+
overflow: "hidden",
|
|
570
|
+
color: "text.secondary",
|
|
468
571
|
...sx
|
|
469
572
|
},
|
|
470
573
|
...props,
|
|
471
|
-
children:
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx2(
|
|
576
|
+
Box,
|
|
577
|
+
{
|
|
578
|
+
sx: {
|
|
579
|
+
width: "48px",
|
|
580
|
+
height: "48px",
|
|
581
|
+
display: "flex",
|
|
582
|
+
alignItems: "center",
|
|
583
|
+
justifyContent: "center",
|
|
584
|
+
flexShrink: 0
|
|
585
|
+
},
|
|
586
|
+
children: selected ? displayedSelectedIcon : icon
|
|
587
|
+
}
|
|
588
|
+
),
|
|
589
|
+
name && /* @__PURE__ */ jsx2(
|
|
590
|
+
Typography,
|
|
591
|
+
{
|
|
592
|
+
variant: "body1",
|
|
593
|
+
fontWeight: 600,
|
|
594
|
+
color: "inherit",
|
|
595
|
+
noWrap: true,
|
|
596
|
+
sx: {
|
|
597
|
+
pr: 2,
|
|
598
|
+
opacity: expanded ? 1 : 0,
|
|
599
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
600
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
601
|
+
})
|
|
602
|
+
},
|
|
603
|
+
children: name
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
]
|
|
472
607
|
}
|
|
473
608
|
);
|
|
474
609
|
}
|
|
@@ -507,8 +642,9 @@ import {
|
|
|
507
642
|
Popover,
|
|
508
643
|
Stack as Stack3,
|
|
509
644
|
TextField,
|
|
510
|
-
Typography
|
|
645
|
+
Typography as Typography2
|
|
511
646
|
} from "@mui/material";
|
|
647
|
+
import { Children } from "react";
|
|
512
648
|
import { BiampRedLogo, ExternalLinkIcon, SearchIcon } from "@bwp-web/assets";
|
|
513
649
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
514
650
|
function BiampHeader({ children, sx, ...props }) {
|
|
@@ -558,8 +694,8 @@ function BiampHeaderTitle({
|
|
|
558
694
|
}
|
|
559
695
|
),
|
|
560
696
|
/* @__PURE__ */ jsxs2(Stack3, { direction: "row", gap: 0.5, children: [
|
|
561
|
-
title && /* @__PURE__ */ jsx3(
|
|
562
|
-
subtitle && /* @__PURE__ */ jsx3(
|
|
697
|
+
title && /* @__PURE__ */ jsx3(Typography2, { variant: "h4", children: title }),
|
|
698
|
+
subtitle && /* @__PURE__ */ jsx3(Typography2, { variant: "h4", color: "text.secondary", children: subtitle })
|
|
563
699
|
] })
|
|
564
700
|
]
|
|
565
701
|
}
|
|
@@ -739,8 +875,8 @@ function BiampBuildAppContentItem({
|
|
|
739
875
|
...props,
|
|
740
876
|
children: [
|
|
741
877
|
/* @__PURE__ */ jsx3(Box2, { sx: { width: 54, height: 54 }, mb: 0.5, children: image }),
|
|
742
|
-
/* @__PURE__ */ jsx3(
|
|
743
|
-
/* @__PURE__ */ jsx3(
|
|
878
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", fontWeight: 600, mb: 0.5, children: name }),
|
|
879
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", color: "text.secondary", children: description }),
|
|
744
880
|
button && /* @__PURE__ */ jsx3(Box2, { position: "absolute", top: "12px", right: "12px", children: button })
|
|
745
881
|
]
|
|
746
882
|
}
|
|
@@ -751,12 +887,17 @@ function BiampEndUserAppContent({
|
|
|
751
887
|
sx,
|
|
752
888
|
...props
|
|
753
889
|
}) {
|
|
890
|
+
const isGrid = Children.count(children) > 1;
|
|
754
891
|
return /* @__PURE__ */ jsx3(
|
|
755
892
|
Stack3,
|
|
756
893
|
{
|
|
757
894
|
direction: "column",
|
|
758
895
|
sx: {
|
|
759
896
|
gap: 1.5,
|
|
897
|
+
...isGrid && {
|
|
898
|
+
display: "grid",
|
|
899
|
+
gridTemplateColumns: "1fr 1fr"
|
|
900
|
+
},
|
|
760
901
|
...sx
|
|
761
902
|
},
|
|
762
903
|
...props,
|
|
@@ -797,8 +938,8 @@ function BiampEndUserAppContentItem({
|
|
|
797
938
|
children: [
|
|
798
939
|
/* @__PURE__ */ jsx3(Box2, { sx: { width: 32, height: 32 }, children: image }),
|
|
799
940
|
/* @__PURE__ */ jsxs2(Stack3, { direction: "column", children: [
|
|
800
|
-
/* @__PURE__ */ jsx3(
|
|
801
|
-
/* @__PURE__ */ jsx3(
|
|
941
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", fontWeight: 600, children: name }),
|
|
942
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", color: "text.secondary", children: description })
|
|
802
943
|
] }),
|
|
803
944
|
/* @__PURE__ */ jsx3(ExternalLinkIcon, { sx: { width: 16, height: 16, ml: "auto" } })
|
|
804
945
|
]
|
|
@@ -915,7 +1056,7 @@ import { useEffect as useEffect2, useRef as useRef3 } from "react";
|
|
|
915
1056
|
import { NoResultsIcon } from "@bwp-web/assets";
|
|
916
1057
|
|
|
917
1058
|
// src/BiampTable/BiampTableStatusMessage.tsx
|
|
918
|
-
import { Stack as Stack5, Typography as
|
|
1059
|
+
import { Stack as Stack5, Typography as Typography3 } from "@mui/material";
|
|
919
1060
|
import { cloneElement } from "react";
|
|
920
1061
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
921
1062
|
function BiampTableStatusMessage({
|
|
@@ -930,8 +1071,8 @@ function BiampTableStatusMessage({
|
|
|
930
1071
|
"aria-hidden": true,
|
|
931
1072
|
sx: { width: 56, height: 56, ...icon.props.sx }
|
|
932
1073
|
}),
|
|
933
|
-
/* @__PURE__ */ jsx4(
|
|
934
|
-
description && /* @__PURE__ */ jsx4(
|
|
1074
|
+
/* @__PURE__ */ jsx4(Typography3, { variant: "h2", children: title }),
|
|
1075
|
+
description && /* @__PURE__ */ jsx4(Typography3, { variant: "body1", children: description }),
|
|
935
1076
|
children
|
|
936
1077
|
] });
|
|
937
1078
|
}
|
|
@@ -979,13 +1120,13 @@ import React2 from "react";
|
|
|
979
1120
|
|
|
980
1121
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
981
1122
|
import { Box as Box3, Tooltip } from "@mui/material";
|
|
982
|
-
import { useCallback, useRef, useState } from "react";
|
|
1123
|
+
import { useCallback, useRef, useState as useState2 } from "react";
|
|
983
1124
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
984
1125
|
function BiampTableTruncatedCell({
|
|
985
1126
|
children
|
|
986
1127
|
}) {
|
|
987
1128
|
const textRef = useRef(null);
|
|
988
|
-
const [open, setOpen] =
|
|
1129
|
+
const [open, setOpen] = useState2(false);
|
|
989
1130
|
const handleMouseEnter = useCallback(() => {
|
|
990
1131
|
const el = textRef.current;
|
|
991
1132
|
if (el && el.scrollWidth > el.clientWidth) {
|
|
@@ -1392,9 +1533,9 @@ var BiampTableRow = React2.memo(
|
|
|
1392
1533
|
);
|
|
1393
1534
|
|
|
1394
1535
|
// src/BiampTable/useLoadingDelay.ts
|
|
1395
|
-
import { useEffect, useRef as useRef2, useState as
|
|
1536
|
+
import { useEffect, useRef as useRef2, useState as useState3 } from "react";
|
|
1396
1537
|
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1397
|
-
const [status, setStatus] =
|
|
1538
|
+
const [status, setStatus] = useState3("idle");
|
|
1398
1539
|
const timeoutRef = useRef2(null);
|
|
1399
1540
|
function clearPending() {
|
|
1400
1541
|
if (timeoutRef.current !== null) {
|
|
@@ -1666,7 +1807,7 @@ import {
|
|
|
1666
1807
|
List,
|
|
1667
1808
|
ListItem,
|
|
1668
1809
|
Popover as Popover2,
|
|
1669
|
-
Typography as
|
|
1810
|
+
Typography as Typography4
|
|
1670
1811
|
} from "@mui/material";
|
|
1671
1812
|
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1672
1813
|
function toVisibilityState(visibility) {
|
|
@@ -1747,7 +1888,7 @@ function BiampTableColumnVisibility({
|
|
|
1747
1888
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1748
1889
|
}
|
|
1749
1890
|
),
|
|
1750
|
-
/* @__PURE__ */ jsx13(
|
|
1891
|
+
/* @__PURE__ */ jsx13(Typography4, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1751
1892
|
]
|
|
1752
1893
|
}
|
|
1753
1894
|
),
|
|
@@ -1775,7 +1916,7 @@ function BiampTableColumnVisibility({
|
|
|
1775
1916
|
}
|
|
1776
1917
|
}
|
|
1777
1918
|
),
|
|
1778
|
-
/* @__PURE__ */ jsx13(
|
|
1919
|
+
/* @__PURE__ */ jsx13(Typography4, { variant: "caption", children: columnName })
|
|
1779
1920
|
]
|
|
1780
1921
|
},
|
|
1781
1922
|
column.id
|
|
@@ -1790,7 +1931,7 @@ function BiampTableColumnVisibility({
|
|
|
1790
1931
|
|
|
1791
1932
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1792
1933
|
import { ColumnsIcon } from "@bwp-web/assets";
|
|
1793
|
-
import { useState as
|
|
1934
|
+
import { useState as useState4 } from "react";
|
|
1794
1935
|
|
|
1795
1936
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
1796
1937
|
import {
|
|
@@ -1843,7 +1984,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1843
1984
|
showAllLabel,
|
|
1844
1985
|
...actionButtonProps
|
|
1845
1986
|
}) {
|
|
1846
|
-
const [anchorEl, setAnchorEl] =
|
|
1987
|
+
const [anchorEl, setAnchorEl] = useState4(null);
|
|
1847
1988
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1848
1989
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1849
1990
|
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
@@ -2010,10 +2151,10 @@ import {
|
|
|
2010
2151
|
Divider as Divider2,
|
|
2011
2152
|
Drawer,
|
|
2012
2153
|
IconButton as IconButton4,
|
|
2013
|
-
Typography as
|
|
2154
|
+
Typography as Typography5
|
|
2014
2155
|
} from "@mui/material";
|
|
2015
2156
|
import { CloseIcon, FilterIcon } from "@bwp-web/assets";
|
|
2016
|
-
import { useId, useState as
|
|
2157
|
+
import { useId, useState as useState5 } from "react";
|
|
2017
2158
|
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2018
2159
|
function BiampTableToolbarFilters({
|
|
2019
2160
|
activeFilterCount,
|
|
@@ -2028,7 +2169,7 @@ function BiampTableToolbarFilters({
|
|
|
2028
2169
|
buttonLabel = "Filters",
|
|
2029
2170
|
DrawerProps: drawerProps
|
|
2030
2171
|
}) {
|
|
2031
|
-
const [open, setOpen] =
|
|
2172
|
+
const [open, setOpen] = useState5(false);
|
|
2032
2173
|
const titleId = useId();
|
|
2033
2174
|
function handleClose() {
|
|
2034
2175
|
onApply?.();
|
|
@@ -2074,7 +2215,7 @@ function BiampTableToolbarFilters({
|
|
|
2074
2215
|
px: 3.5,
|
|
2075
2216
|
py: 2.5,
|
|
2076
2217
|
children: [
|
|
2077
|
-
/* @__PURE__ */ jsxs9(
|
|
2218
|
+
/* @__PURE__ */ jsxs9(Typography5, { id: titleId, variant: "h2", children: [
|
|
2078
2219
|
title,
|
|
2079
2220
|
/* @__PURE__ */ jsx20(
|
|
2080
2221
|
Badge2,
|
|
@@ -2154,7 +2295,7 @@ import {
|
|
|
2154
2295
|
useMediaQuery
|
|
2155
2296
|
} from "@mui/material";
|
|
2156
2297
|
import { CloseIcon as CloseIcon2, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
2157
|
-
import { useEffect as useEffect5, useState as
|
|
2298
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
2158
2299
|
|
|
2159
2300
|
// src/BiampTable/useDebouncedCallback.ts
|
|
2160
2301
|
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef5 } from "react";
|
|
@@ -2206,8 +2347,8 @@ function BiampTableToolbarSearch({
|
|
|
2206
2347
|
...textFieldProps
|
|
2207
2348
|
}) {
|
|
2208
2349
|
const isMobile = useMediaQuery((t) => t.breakpoints.down("md"));
|
|
2209
|
-
const [inputValue, setInputValue] =
|
|
2210
|
-
const [isExpanded, setIsExpanded] =
|
|
2350
|
+
const [inputValue, setInputValue] = useState6(defaultValue);
|
|
2351
|
+
const [isExpanded, setIsExpanded] = useState6(false);
|
|
2211
2352
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2212
2353
|
useEffect5(() => {
|
|
2213
2354
|
setInputValue(defaultValue);
|
|
@@ -2539,7 +2680,7 @@ function downloadCsv(csvContent, filename) {
|
|
|
2539
2680
|
import {
|
|
2540
2681
|
Box as Box12,
|
|
2541
2682
|
Collapse as Collapse2,
|
|
2542
|
-
Typography as
|
|
2683
|
+
Typography as Typography6
|
|
2543
2684
|
} from "@mui/material";
|
|
2544
2685
|
import {
|
|
2545
2686
|
ErrorStatusIcon,
|
|
@@ -2577,7 +2718,7 @@ function BiampBannerIcon({ severity, children }) {
|
|
|
2577
2718
|
return /* @__PURE__ */ jsx22(Fragment4, { children: severity ? iconMapping[severity] : children });
|
|
2578
2719
|
}
|
|
2579
2720
|
function BiampBannerContent({ children, ...props }) {
|
|
2580
|
-
return /* @__PURE__ */ jsx22(
|
|
2721
|
+
return /* @__PURE__ */ jsx22(Typography6, { textAlign: "center", variant: "h3", ...props, children });
|
|
2581
2722
|
}
|
|
2582
2723
|
function BiampBannerActions({ children, ...props }) {
|
|
2583
2724
|
return /* @__PURE__ */ jsx22(Box12, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
@@ -2646,7 +2787,7 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2646
2787
|
}
|
|
2647
2788
|
|
|
2648
2789
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
2649
|
-
import { createContext, forwardRef, useContext } from "react";
|
|
2790
|
+
import { createContext as createContext2, forwardRef, useContext as useContext2 } from "react";
|
|
2650
2791
|
import {
|
|
2651
2792
|
Autocomplete,
|
|
2652
2793
|
Box as Box13,
|
|
@@ -2654,11 +2795,11 @@ import {
|
|
|
2654
2795
|
InputAdornment as InputAdornment3,
|
|
2655
2796
|
Paper,
|
|
2656
2797
|
TextField as TextField3,
|
|
2657
|
-
Typography as
|
|
2798
|
+
Typography as Typography7
|
|
2658
2799
|
} from "@mui/material";
|
|
2659
2800
|
import { KeyArrowDownIcon, KeyArrowUpIcon, SearchIcon as SearchIcon3 } from "@bwp-web/assets";
|
|
2660
2801
|
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2661
|
-
var SearchContext =
|
|
2802
|
+
var SearchContext = createContext2({
|
|
2662
2803
|
hasOptions: true,
|
|
2663
2804
|
loading: false,
|
|
2664
2805
|
noResultsText: "No results found",
|
|
@@ -2695,10 +2836,10 @@ function KeyCap({
|
|
|
2695
2836
|
}
|
|
2696
2837
|
var BiampGlobalSearchPaper = forwardRef(
|
|
2697
2838
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2698
|
-
const { hasOptions, loading, noResultsText } =
|
|
2839
|
+
const { hasOptions, loading, noResultsText } = useContext2(SearchContext);
|
|
2699
2840
|
return /* @__PURE__ */ jsxs11(Paper, { ref, ...props, children: [
|
|
2700
2841
|
hasOptions || loading ? children : /* @__PURE__ */ jsx25(
|
|
2701
|
-
|
|
2842
|
+
Typography7,
|
|
2702
2843
|
{
|
|
2703
2844
|
variant: "body2",
|
|
2704
2845
|
color: "text.secondary",
|
|
@@ -2723,7 +2864,7 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2723
2864
|
/* @__PURE__ */ jsx25(KeyCap, { children: /* @__PURE__ */ jsx25(KeyArrowUpIcon, {}) })
|
|
2724
2865
|
] }),
|
|
2725
2866
|
/* @__PURE__ */ jsx25(
|
|
2726
|
-
|
|
2867
|
+
Typography7,
|
|
2727
2868
|
{
|
|
2728
2869
|
variant: "caption",
|
|
2729
2870
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2735,7 +2876,7 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2735
2876
|
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2736
2877
|
/* @__PURE__ */ jsx25(KeyCap, { variant: "text", children: "Enter" }),
|
|
2737
2878
|
/* @__PURE__ */ jsx25(
|
|
2738
|
-
|
|
2879
|
+
Typography7,
|
|
2739
2880
|
{
|
|
2740
2881
|
variant: "caption",
|
|
2741
2882
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2780,7 +2921,7 @@ function BiampGlobalSearchListItem({
|
|
|
2780
2921
|
option,
|
|
2781
2922
|
props: liProps
|
|
2782
2923
|
}) {
|
|
2783
|
-
const { query } =
|
|
2924
|
+
const { query } = useContext2(SearchContext);
|
|
2784
2925
|
const { key, ...rest } = liProps;
|
|
2785
2926
|
const maxChips = 3;
|
|
2786
2927
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
@@ -2811,9 +2952,9 @@ function BiampGlobalSearchListItem({
|
|
|
2811
2952
|
children: option.icon
|
|
2812
2953
|
}
|
|
2813
2954
|
),
|
|
2814
|
-
/* @__PURE__ */ jsx25(
|
|
2955
|
+
/* @__PURE__ */ jsx25(Typography7, { variant: "body2", noWrap: true, sx: { flexShrink: 0 }, children: /* @__PURE__ */ jsx25(HighlightText, { text: option.title, query }) }),
|
|
2815
2956
|
option.subtitle && /* @__PURE__ */ jsx25(
|
|
2816
|
-
|
|
2957
|
+
Typography7,
|
|
2817
2958
|
{
|
|
2818
2959
|
className: "hoverContent",
|
|
2819
2960
|
variant: "body2",
|
|
@@ -2939,7 +3080,7 @@ function BiampGlobalSearch({
|
|
|
2939
3080
|
loading,
|
|
2940
3081
|
onChange: handleChange,
|
|
2941
3082
|
onInputChange: handleInputChange,
|
|
2942
|
-
loadingText: /* @__PURE__ */ jsx25(
|
|
3083
|
+
loadingText: /* @__PURE__ */ jsx25(Typography7, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2943
3084
|
freeSolo: true,
|
|
2944
3085
|
filterOptions: (x) => x,
|
|
2945
3086
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -3004,7 +3145,7 @@ function BiampGlobalSearch({
|
|
|
3004
3145
|
|
|
3005
3146
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
3006
3147
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
3007
|
-
import { Box as Box14, Typography as
|
|
3148
|
+
import { Box as Box14, Typography as Typography8 } from "@mui/material";
|
|
3008
3149
|
import { darken } from "@mui/material/styles";
|
|
3009
3150
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3010
3151
|
var DEFAULT_SIZE = 40;
|
|
@@ -3039,7 +3180,7 @@ function UserInitialsIcon({
|
|
|
3039
3180
|
sx: { ...sx },
|
|
3040
3181
|
...props,
|
|
3041
3182
|
children: /* @__PURE__ */ jsx26(
|
|
3042
|
-
|
|
3183
|
+
Typography8,
|
|
3043
3184
|
{
|
|
3044
3185
|
variant: "h3",
|
|
3045
3186
|
color: textColor,
|
|
@@ -3062,7 +3203,7 @@ var getInitials = (name) => {
|
|
|
3062
3203
|
|
|
3063
3204
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
3064
3205
|
import { SvgIcon, Skeleton, Box as Box15 } from "@mui/material";
|
|
3065
|
-
import { useEffect as useEffect6, useState as
|
|
3206
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
3066
3207
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3067
3208
|
var svgCache = /* @__PURE__ */ new Map();
|
|
3068
3209
|
function clearDynamicSvgIconCache() {
|
|
@@ -3074,16 +3215,16 @@ function applyCurrentColor(svg) {
|
|
|
3074
3215
|
function useDynamicSvgIcon(url, options = {}) {
|
|
3075
3216
|
const { replaceColors = false, onLoad, onError } = options;
|
|
3076
3217
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
3077
|
-
const [svgContent, setSvgContent] =
|
|
3218
|
+
const [svgContent, setSvgContent] = useState7(() => {
|
|
3078
3219
|
const cached = svgCache.get(url);
|
|
3079
3220
|
return cached ? transform(cached.innerContent) : null;
|
|
3080
3221
|
});
|
|
3081
|
-
const [svgViewBox, setSvgViewBox] =
|
|
3222
|
+
const [svgViewBox, setSvgViewBox] = useState7(() => {
|
|
3082
3223
|
const cached = svgCache.get(url);
|
|
3083
3224
|
return cached?.viewBox ?? null;
|
|
3084
3225
|
});
|
|
3085
|
-
const [loading, setLoading] =
|
|
3086
|
-
const [error, setError] =
|
|
3226
|
+
const [loading, setLoading] = useState7(() => !svgCache.has(url));
|
|
3227
|
+
const [error, setError] = useState7(null);
|
|
3087
3228
|
useEffect6(() => {
|
|
3088
3229
|
if (!url) {
|
|
3089
3230
|
setLoading(false);
|