@czi-sds/data-viz 0.14.3 → 0.16.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/dist/index.cjs.d.ts +24 -0
- package/dist/index.cjs.js +104 -48
- package/dist/index.esm.d.ts +24 -0
- package/dist/index.esm.js +104 -48
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -965,15 +965,16 @@ const Shadows = {
|
|
|
965
965
|
};
|
|
966
966
|
|
|
967
967
|
const Spaces = {
|
|
968
|
+
xxxs: 2,
|
|
969
|
+
xxs: 4,
|
|
970
|
+
xs: 6,
|
|
971
|
+
s: 8,
|
|
972
|
+
m: 12,
|
|
968
973
|
default: 12,
|
|
969
974
|
l: 16,
|
|
970
|
-
m: 12,
|
|
971
|
-
s: 8,
|
|
972
975
|
xl: 24,
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
xxs: 4,
|
|
976
|
-
xxxs: 2
|
|
976
|
+
xxl: 32,
|
|
977
|
+
xxxl: 40
|
|
977
978
|
};
|
|
978
979
|
|
|
979
980
|
const SDSLightThemeColors = {
|
|
@@ -1736,6 +1737,7 @@ function makeThemeOptions(appTheme, mode) {
|
|
|
1736
1737
|
appTheme.spacing.l,
|
|
1737
1738
|
appTheme.spacing.xl,
|
|
1738
1739
|
appTheme.spacing.xxl,
|
|
1740
|
+
appTheme.spacing.xxxl,
|
|
1739
1741
|
],
|
|
1740
1742
|
transitions: {
|
|
1741
1743
|
duration: {
|
|
@@ -9146,9 +9148,9 @@ const StyledPaper = styled$2(Paper, {
|
|
|
9146
9148
|
background-color: ${semanticColors?.base?.surface};
|
|
9147
9149
|
background-image: none;
|
|
9148
9150
|
box-shadow: ${shadows?.l};
|
|
9149
|
-
max-height: calc(100vh - ${2 * (spaces?.
|
|
9151
|
+
max-height: calc(100vh - ${2 * (spaces?.xxxl || 40)}px);
|
|
9150
9152
|
border-radius: ${corners?.xl}px;
|
|
9151
|
-
padding: ${isSmall ? spaces?.xl : spaces?.
|
|
9153
|
+
padding: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
9152
9154
|
outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
|
|
9153
9155
|
`;
|
|
9154
9156
|
}}
|
|
@@ -9198,7 +9200,7 @@ const StyledButton$1 = styled$2(Button) `
|
|
|
9198
9200
|
const { sdsSize } = props;
|
|
9199
9201
|
const isSmall = sdsSize === "small" || sdsSize === "medium";
|
|
9200
9202
|
const spaces = getSpaces(props);
|
|
9201
|
-
const right = isSmall ? spaces?.xl : spaces?.
|
|
9203
|
+
const right = isSmall ? spaces?.xl : spaces?.xxxl;
|
|
9202
9204
|
return `
|
|
9203
9205
|
right: ${right}px;
|
|
9204
9206
|
`;
|
|
@@ -9298,7 +9300,7 @@ const StyledDialogActions = styled$2(DialogActions$1, {
|
|
|
9298
9300
|
return `
|
|
9299
9301
|
justify-content: ${buttonPosition === "right" ? "flex-end" : "flex-start"};;
|
|
9300
9302
|
|
|
9301
|
-
margin-top: ${isSmall ? spaces?.xl : spaces?.
|
|
9303
|
+
margin-top: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
9302
9304
|
|
|
9303
9305
|
&.${dialogActionsClasses.spacing} > :not(:first-of-type) {
|
|
9304
9306
|
margin-left: ${spaces?.m}px;
|
|
@@ -9405,16 +9407,16 @@ const getResponsivePadding = (props) => {
|
|
|
9405
9407
|
const spaces = getSpaces(props);
|
|
9406
9408
|
const breakpoints = getBreakpoints(props);
|
|
9407
9409
|
return css$1 `
|
|
9408
|
-
padding: ${spaces?.
|
|
9410
|
+
padding: ${spaces?.xxxl}px
|
|
9409
9411
|
${overlayContainerMinMargin?.small || HeroMargins.SMALL};
|
|
9410
9412
|
|
|
9411
9413
|
${breakpoints?.up("md")} {
|
|
9412
|
-
padding: ${spaces?.
|
|
9414
|
+
padding: ${spaces?.xxxl}px
|
|
9413
9415
|
${overlayContainerMinMargin?.medium || HeroMargins.MEDIUM};
|
|
9414
9416
|
}
|
|
9415
9417
|
|
|
9416
9418
|
${breakpoints?.up("lg")} {
|
|
9417
|
-
padding: ${spaces?.
|
|
9419
|
+
padding: ${spaces?.xxxl}px
|
|
9418
9420
|
${overlayContainerMinMargin?.large || HeroMargins.LARGE};
|
|
9419
9421
|
}
|
|
9420
9422
|
`;
|
|
@@ -10506,7 +10508,7 @@ const LegendContainer = styled$2("div") `
|
|
|
10506
10508
|
`;
|
|
10507
10509
|
const LegendItem = styled$2("div") `
|
|
10508
10510
|
${(props) => {
|
|
10509
|
-
const { isSelected, disabled } = props;
|
|
10511
|
+
const { isSelected, disabled, isHovered } = props;
|
|
10510
10512
|
const spaces = getSpaces(props);
|
|
10511
10513
|
const semanticColors = getSemanticColors(props);
|
|
10512
10514
|
const corners = getCorners(props);
|
|
@@ -10517,7 +10519,7 @@ const LegendItem = styled$2("div") `
|
|
|
10517
10519
|
transition: background-color 0.2s ease-in-out;
|
|
10518
10520
|
padding: ${spaces?.xxxs}px ${spaces?.xxs}px;
|
|
10519
10521
|
border-radius: ${corners?.s}px;
|
|
10520
|
-
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : "transparent"};
|
|
10522
|
+
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : isHovered ? semanticColors?.base?.backgroundSecondary : "transparent"};
|
|
10521
10523
|
pointer-events: ${disabled ? "none" : "auto"};
|
|
10522
10524
|
|
|
10523
10525
|
&:hover {
|
|
@@ -10616,7 +10618,7 @@ const Legend = (props) => {
|
|
|
10616
10618
|
: hasSelection && !isSelected;
|
|
10617
10619
|
// Determine color: use colors prop, then item color, then fallback to gray
|
|
10618
10620
|
const itemColor = colors?.[index] || item.color || fallbackColor;
|
|
10619
|
-
return (jsxs(LegendItem, { onMouseEnter: () => handleMouseEnter(item, index), onMouseLeave: () => handleMouseLeave(item, index), onClick: () => handleClick(item, index), role: "button", tabIndex: item.disabled ? -1 : 0, "aria-label": `${item.name}${item.value ? `: ${item.value}` : ""}`, "aria-pressed": isSelected, "aria-disabled": item.disabled, isSelected: isSelected, disabled: item.disabled, children: [jsx(LegendIcon, { color: itemColor, isDimmed: isDimmed }), jsx(LegendLabel, { disabled: item.disabled, children: item.name }), showValues && item.value !== undefined && (jsx(LegendValue, { disabled: item.disabled, children: typeof item.value === "number"
|
|
10621
|
+
return (jsxs(LegendItem, { onMouseEnter: () => handleMouseEnter(item, index), onMouseLeave: () => handleMouseLeave(item, index), onClick: () => handleClick(item, index), role: "button", tabIndex: item.disabled ? -1 : 0, "aria-label": `${item.name}${item.value ? `: ${item.value}` : ""}`, "aria-pressed": isSelected, "aria-disabled": item.disabled, isSelected: isSelected, disabled: item.disabled, isHovered: isHovered, children: [jsx(LegendIcon, { color: itemColor, isDimmed: isDimmed }), jsx(LegendLabel, { disabled: item.disabled, children: item.name }), showValues && item.value !== undefined && (jsx(LegendValue, { disabled: item.disabled, children: typeof item.value === "number"
|
|
10620
10622
|
? item.value.toLocaleString()
|
|
10621
10623
|
: item.value }))] }, `${item.name}-${index}`));
|
|
10622
10624
|
}) })));
|
|
@@ -17374,6 +17376,7 @@ memo(StyledDivider$1);
|
|
|
17374
17376
|
|
|
17375
17377
|
/* eslint-disable sonarjs/cognitive-complexity */
|
|
17376
17378
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
17379
|
+
const TOOLBAR_HEIGHT = 48;
|
|
17377
17380
|
const doNotForwardProps$a = [
|
|
17378
17381
|
"hasInvertedStyle",
|
|
17379
17382
|
"isNarrow",
|
|
@@ -17389,7 +17392,7 @@ const doNotForwardProps$a = [
|
|
|
17389
17392
|
const StyledTopComponentSlot = styled$2("div") `
|
|
17390
17393
|
position: sticky;
|
|
17391
17394
|
top: 0;
|
|
17392
|
-
z-index:
|
|
17395
|
+
z-index: 2100;
|
|
17393
17396
|
`;
|
|
17394
17397
|
const StyledAppBar = styled$2(AppBar, {
|
|
17395
17398
|
shouldForwardProp: (prop) => ![...doNotForwardProps$a, "sdsStyle"].includes(prop)
|
|
@@ -17401,7 +17404,7 @@ const StyledAppBar = styled$2(AppBar, {
|
|
|
17401
17404
|
background-image: none;
|
|
17402
17405
|
max-width: 100%;
|
|
17403
17406
|
overflow-x: auto;
|
|
17404
|
-
z-index:
|
|
17407
|
+
z-index: 2100;
|
|
17405
17408
|
`;
|
|
17406
17409
|
}}
|
|
17407
17410
|
`;
|
|
@@ -17430,8 +17433,8 @@ const StyledToolbar = styled$2(Toolbar, {
|
|
|
17430
17433
|
const spaces = getSpaces(props);
|
|
17431
17434
|
return css$2 `
|
|
17432
17435
|
&.MuiToolbar-root {
|
|
17433
|
-
min-height:
|
|
17434
|
-
max-height:
|
|
17436
|
+
min-height: ${TOOLBAR_HEIGHT}px;
|
|
17437
|
+
max-height: ${TOOLBAR_HEIGHT}px;
|
|
17435
17438
|
padding: ${spaces?.s}px ${spaces?.l}px;
|
|
17436
17439
|
|
|
17437
17440
|
${isNarrow && NarrowToolbar(props)}
|
|
@@ -17594,7 +17597,7 @@ const StyledTitleContainer = styled$2("div", {
|
|
|
17594
17597
|
color: ${props.hasInvertedStyle
|
|
17595
17598
|
? colors?.base.textPrimaryOnDark
|
|
17596
17599
|
: colors?.base.textPrimary};
|
|
17597
|
-
margin-right: ${spaces?.
|
|
17600
|
+
margin-right: ${spaces?.xxxl}px;
|
|
17598
17601
|
width: 100%;
|
|
17599
17602
|
|
|
17600
17603
|
${isNarrow && NarrowTitleContainer()}
|
|
@@ -17636,8 +17639,8 @@ const StyledPrimaryNavContainer = styled$2("div", {
|
|
|
17636
17639
|
const primaryNavPositionWithoutSearch = primaryNavPosition === "left" ? "flex-start" : "flex-end";
|
|
17637
17640
|
return css$2 `
|
|
17638
17641
|
flex-direction: ${isNarrow ? "column" : "row"};
|
|
17639
|
-
gap: ${spaces?.
|
|
17640
|
-
margin-right: ${spaces?.
|
|
17642
|
+
gap: ${spaces?.xxxl}px;
|
|
17643
|
+
margin-right: ${spaces?.xxxl}px;
|
|
17641
17644
|
flex: 1;
|
|
17642
17645
|
justify-content: ${showSearch
|
|
17643
17646
|
? primaryNavPositionWithSearch
|
|
@@ -17764,14 +17767,14 @@ const NarrowButtonStyles = (props) => {
|
|
|
17764
17767
|
&::before {
|
|
17765
17768
|
content: "";
|
|
17766
17769
|
position: absolute;
|
|
17767
|
-
height: ${spaces?.
|
|
17770
|
+
height: ${spaces?.xxxl}px;
|
|
17768
17771
|
width: 100%;
|
|
17769
17772
|
background: linear-gradient(
|
|
17770
17773
|
to top,
|
|
17771
17774
|
${backgroundColor} 0%,
|
|
17772
17775
|
${backgroundColor}00 100%
|
|
17773
17776
|
);
|
|
17774
|
-
top: -${spaces?.
|
|
17777
|
+
top: -${spaces?.xxxl}px;
|
|
17775
17778
|
}
|
|
17776
17779
|
|
|
17777
17780
|
.MuiButton-icon .MuiSvgIcon-root {
|
|
@@ -17792,7 +17795,7 @@ const StyledButtonSection = styled$2("section", {
|
|
|
17792
17795
|
const spaces = getSpaces(props);
|
|
17793
17796
|
return css$2 `
|
|
17794
17797
|
gap: ${spaces?.m}px;
|
|
17795
|
-
margin-left: ${spaces?.
|
|
17798
|
+
margin-left: ${spaces?.xxxl}px;
|
|
17796
17799
|
|
|
17797
17800
|
${isNarrow && NarrowButtonStyles(props)}
|
|
17798
17801
|
`;
|
|
@@ -17812,8 +17815,8 @@ const StyledDrawer$1 = styled$2(Drawer, {
|
|
|
17812
17815
|
width: 100%;
|
|
17813
17816
|
display: flex;
|
|
17814
17817
|
flex-direction: column;
|
|
17815
|
-
top: ${topOffset}px;
|
|
17816
|
-
height: calc(100% - ${topOffset}px);
|
|
17818
|
+
top: ${topOffset + TOOLBAR_HEIGHT}px;
|
|
17819
|
+
height: calc(100% - ${topOffset + TOOLBAR_HEIGHT}px);
|
|
17817
17820
|
justify-content: space-between;
|
|
17818
17821
|
}
|
|
17819
17822
|
`;
|
|
@@ -17863,7 +17866,7 @@ const DrawerAccordionStyles = (props) => {
|
|
|
17863
17866
|
&[aria-expanded="true"] {
|
|
17864
17867
|
position: sticky;
|
|
17865
17868
|
border-radius: 0;
|
|
17866
|
-
top:
|
|
17869
|
+
top: ${spaces?.s}px;
|
|
17867
17870
|
z-index: 11;
|
|
17868
17871
|
backdrop-filter: blur(0px);
|
|
17869
17872
|
color: ${textOpenColor};
|
|
@@ -18048,6 +18051,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
|
|
|
18048
18051
|
return css$2 `
|
|
18049
18052
|
pointer-events: none;
|
|
18050
18053
|
top: ${topOffset}px;
|
|
18054
|
+
z-index: 2000;
|
|
18051
18055
|
|
|
18052
18056
|
.MuiDrawer-paper {
|
|
18053
18057
|
background-color: ${hasInvertedStyle
|
|
@@ -18060,7 +18064,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
|
|
|
18060
18064
|
box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.1);
|
|
18061
18065
|
background-image: none;
|
|
18062
18066
|
padding: ${spaces?.xl ? spaces?.xl + 48 : 48}px ${spaces?.xl}px
|
|
18063
|
-
${spaces?.
|
|
18067
|
+
${spaces?.xxxl}px;
|
|
18064
18068
|
transform: translateY(48px);
|
|
18065
18069
|
top: ${topOffset}px;
|
|
18066
18070
|
}
|
|
@@ -18086,7 +18090,7 @@ const StyledMegaMenuContent = styled$2("div", {
|
|
|
18086
18090
|
: semanticColors?.base.backgroundPrimary};
|
|
18087
18091
|
display: flex;
|
|
18088
18092
|
flex-wrap: wrap;
|
|
18089
|
-
gap: ${spaces?.
|
|
18093
|
+
gap: ${spaces?.xxxl}px;
|
|
18090
18094
|
width: 100%;
|
|
18091
18095
|
max-width: 1200px;
|
|
18092
18096
|
margin: 0 auto;
|
|
@@ -18105,7 +18109,7 @@ const StyledHoverDrawerColumn = styled$2("div", {
|
|
|
18105
18109
|
// Account for gaps between columns
|
|
18106
18110
|
const columnsPerRow = totalColumns > 4 ? 4 : totalColumns;
|
|
18107
18111
|
const gapCount = columnsPerRow - 1;
|
|
18108
|
-
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.
|
|
18112
|
+
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxxl}px)) / ${columnsPerRow})`;
|
|
18109
18113
|
return css$2 `
|
|
18110
18114
|
display: flex;
|
|
18111
18115
|
flex-direction: column;
|
|
@@ -18306,7 +18310,7 @@ const StyledHoverDrawerActions = styled$2("div", {
|
|
|
18306
18310
|
margin-top: ${spaces?.l}px;
|
|
18307
18311
|
padding-left: ${isNarrow
|
|
18308
18312
|
? `calc(${spaces?.l}px + ${spaces?.m}px)`
|
|
18309
|
-
: `calc(${spaces?.
|
|
18313
|
+
: `calc(${spaces?.xxxl}px + ${spaces?.xs}px)`};
|
|
18310
18314
|
flex-wrap: wrap;
|
|
18311
18315
|
`;
|
|
18312
18316
|
}}
|
|
@@ -19189,9 +19193,10 @@ function useNavigationState() {
|
|
|
19189
19193
|
};
|
|
19190
19194
|
}
|
|
19191
19195
|
|
|
19192
|
-
function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
|
|
19196
|
+
function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, onDrawerStyleNavItemHover, }) {
|
|
19193
19197
|
const theme = useTheme$4();
|
|
19194
19198
|
const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
|
|
19199
|
+
const [clickedDrawerKey, setClickedDrawerKey] = useState(null);
|
|
19195
19200
|
// Helper function to wrap dropdown items' onClick handlers
|
|
19196
19201
|
// This automatically sets the parent dropdown as active when an item is clicked
|
|
19197
19202
|
const wrapDropdownItemsWithActiveKey = (dropdownItems, parentKey) => {
|
|
@@ -19230,8 +19235,23 @@ function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, ite
|
|
|
19230
19235
|
const handleClick = (e) => {
|
|
19231
19236
|
onChange(key);
|
|
19232
19237
|
parentOnClick?.(e);
|
|
19238
|
+
if (drawerOpen) {
|
|
19239
|
+
setActiveDrawerKey(null);
|
|
19240
|
+
setContentKey(null);
|
|
19241
|
+
setClickedDrawerKey(key);
|
|
19242
|
+
}
|
|
19233
19243
|
};
|
|
19234
|
-
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () =>
|
|
19244
|
+
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
|
|
19245
|
+
onDrawerStyleNavItemHover?.(item);
|
|
19246
|
+
if (clickedDrawerKey !== key) {
|
|
19247
|
+
onDrawerOpen(key);
|
|
19248
|
+
}
|
|
19249
|
+
}, onMouseLeave: () => {
|
|
19250
|
+
if (clickedDrawerKey === key) {
|
|
19251
|
+
setClickedDrawerKey(null);
|
|
19252
|
+
}
|
|
19253
|
+
onDrawerClose();
|
|
19254
|
+
}, children: jsx(UnifiedNavItem, __assign({}, rest, { itemType: item.itemType, active: isActive, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, sdsStyle: "minimal", onClick: handleClick, innerSdsStyle: sdsStyle, navVariant: "primary", component: componentProp, href: defaultUrl, target: target, rel: rel, children: jsxs(StyledLabel, { itemType: item.itemType, active: isActive, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, navVariant: "primary", children: [jsx(StyledLabelTextWrapper$1, { active: isActive, isNarrow: isNarrow, children: label }), jsx(StyledLabelTextWrapperShadow$1, { "aria-hidden": "true", isNarrow: isNarrow, children: label }), jsx(Icon, { sdsIcon: isDrawerOpen ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] }) })) }, key));
|
|
19235
19255
|
};
|
|
19236
19256
|
const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
|
|
19237
19257
|
const isDropdownOpen = open && activeDropdownKey === key;
|
|
@@ -19474,7 +19494,7 @@ const StyledTag = styled$2(Tag) `
|
|
|
19474
19494
|
margin: 0;
|
|
19475
19495
|
`;
|
|
19476
19496
|
|
|
19477
|
-
function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNarrow, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
|
|
19497
|
+
function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNarrow, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, onDrawerStyleNavItemHover, }) {
|
|
19478
19498
|
const theme = useTheme$4();
|
|
19479
19499
|
const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
|
|
19480
19500
|
function onClose() {
|
|
@@ -19498,7 +19518,10 @@ function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNa
|
|
|
19498
19518
|
const handleClick = (e) => {
|
|
19499
19519
|
parentOnClick?.(e);
|
|
19500
19520
|
};
|
|
19501
|
-
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () =>
|
|
19521
|
+
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
|
|
19522
|
+
onDrawerStyleNavItemHover?.(item);
|
|
19523
|
+
onDrawerOpen(key);
|
|
19524
|
+
}, onMouseLeave: onDrawerClose, children: jsxs(UnifiedNavItem, __assign({}, rest, { hasInvertedStyle: hasInvertedStyle, active: isDrawerOpen, isNarrow: isNarrow, sdsStyle: "minimal", innerSdsStyle: sdsStyle, navVariant: "secondary", onClick: handleClick, component: componentProp, href: defaultUrl, target: target, rel: rel, children: [jsx(StyledLabelTextWrapper$1, { active: isDrawerOpen, isNarrow: isNarrow, children: label }), jsx(StyledLabelTextWrapperShadow$1, { "aria-hidden": "true", isNarrow: isNarrow, children: label }), jsx(Icon, { sdsIcon: isDrawerOpen ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] })) }, key));
|
|
19502
19525
|
};
|
|
19503
19526
|
const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
|
|
19504
19527
|
const isDropdownOpen = open && activeDropdownKey === key;
|
|
@@ -19670,7 +19693,7 @@ forwardRef((props, ref) => {
|
|
|
19670
19693
|
const { activePrimaryNavKey: controlledActivePrimaryNavKey, buttons, sdsStyle = "dropdown", menuProps = {
|
|
19671
19694
|
disableScrollLock: true,
|
|
19672
19695
|
disablePortal: true
|
|
19673
|
-
}, backgroundAppearance = "matchBackground", logo, logoUrl, logoLinkComponent = "a", logoLinkProps, scrollElevation = true, primaryNavItems, primaryNavPosition = "left", searchProps, secondaryNavItems, setActivePrimaryNavKey: onActivePrimaryNavKeyChange, showSearch = true, tag, tagColor, title, drawerOpen: controlledDrawerOpen, setDrawerOpen: onDrawerOpenChange, isSticky = true, topComponentSlot, ...rest } = props;
|
|
19696
|
+
}, backgroundAppearance = "matchBackground", logo, logoUrl, logoLinkComponent = "a", logoLinkProps, scrollElevation = true, primaryNavItems, primaryNavPosition = "left", searchProps, secondaryNavItems, setActivePrimaryNavKey: onActivePrimaryNavKeyChange, showSearch = true, tag, tagColor, title, drawerOpen: controlledDrawerOpen, setDrawerOpen: onDrawerOpenChange, isSticky = true, topComponentSlot, onDrawerStyleNavItemHover, ...rest } = props;
|
|
19674
19697
|
const navRef = useRef(null);
|
|
19675
19698
|
const topSlotRef = useRef(null);
|
|
19676
19699
|
const [topOffset, setTopOffset] = useState(0);
|
|
@@ -19823,11 +19846,11 @@ forwardRef((props, ref) => {
|
|
|
19823
19846
|
};
|
|
19824
19847
|
const renderPrimaryNav = () => {
|
|
19825
19848
|
return (primaryNavItems &&
|
|
19826
|
-
primaryNavItems.length > 0 && (jsx(NavigationHeaderPrimaryNav, { items: primaryNavItems, value: activePrimaryNavKey, onChange: setActivePrimaryNavKey, hasInvertedStyle: hasInvertedStyle, isNarrow: dimensions.isNarrow, menuProps: menuProps, sdsStyle: sdsStyle, expandedAccordion: expandedAccordion, setExpandedAccordion: setExpandedAccordion, accordionRefs: accordionRefs, scrollToAccordion: scrollToAccordion, onDrawerStateChange: handlePrimaryDrawerStateChange, topOffset: topOffset, onClose: () => setDrawerOpen(false) })));
|
|
19849
|
+
primaryNavItems.length > 0 && (jsx(NavigationHeaderPrimaryNav, { items: primaryNavItems, value: activePrimaryNavKey, onChange: setActivePrimaryNavKey, hasInvertedStyle: hasInvertedStyle, isNarrow: dimensions.isNarrow, menuProps: menuProps, sdsStyle: sdsStyle, expandedAccordion: expandedAccordion, setExpandedAccordion: setExpandedAccordion, accordionRefs: accordionRefs, scrollToAccordion: scrollToAccordion, onDrawerStateChange: handlePrimaryDrawerStateChange, topOffset: topOffset, onClose: () => setDrawerOpen(false), onDrawerStyleNavItemHover: onDrawerStyleNavItemHover })));
|
|
19827
19850
|
};
|
|
19828
19851
|
const renderSecondaryNav = () => {
|
|
19829
19852
|
return (secondaryNavItems &&
|
|
19830
|
-
secondaryNavItems.length > 0 && (jsx(NavigationHeaderSecondaryNav, { items: secondaryNavItems, hasInvertedStyle: hasInvertedStyle, isNarrow: dimensions.isNarrow, menuProps: menuProps, sdsStyle: sdsStyle, expandedAccordion: expandedAccordion, setExpandedAccordion: setExpandedAccordion, accordionRefs: accordionRefs, scrollToAccordion: scrollToAccordion, onDrawerStateChange: handleSecondaryDrawerStateChange, topOffset: topOffset, onClose: () => setDrawerOpen(false) })));
|
|
19853
|
+
secondaryNavItems.length > 0 && (jsx(NavigationHeaderSecondaryNav, { items: secondaryNavItems, hasInvertedStyle: hasInvertedStyle, isNarrow: dimensions.isNarrow, menuProps: menuProps, sdsStyle: sdsStyle, expandedAccordion: expandedAccordion, setExpandedAccordion: setExpandedAccordion, accordionRefs: accordionRefs, scrollToAccordion: scrollToAccordion, onDrawerStateChange: handleSecondaryDrawerStateChange, topOffset: topOffset, onClose: () => setDrawerOpen(false), onDrawerStyleNavItemHover: onDrawerStyleNavItemHover })));
|
|
19831
19854
|
};
|
|
19832
19855
|
const renderButtonsNode = () => {
|
|
19833
19856
|
if (!buttons || buttons.length === 0)
|
|
@@ -19907,7 +19930,7 @@ forwardRef((props, ref) => {
|
|
|
19907
19930
|
const position = sdsStyle === "drawer" ? "sticky" : isSticky ? "sticky" : "relative";
|
|
19908
19931
|
// Disable elevation when drawer style is active and any drawer is open
|
|
19909
19932
|
const effectiveScrollElevation = scrollElevation && !(sdsStyle === "drawer" && isAnyDrawerOpen);
|
|
19910
|
-
return (jsxs(Fragment, { children: [topComponentSlot && (jsx(StyledTopComponentSlot, { ref: topSlotRef, children: topComponentSlot })), jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsx(StyledAppBar, __assign({ elevation: 0, hasInvertedStyle: hasInvertedStyle, ref: mergeRefs([ref, navRef]), "aria-label": "Main navigation", tabIndex: 0, position: position, style: { top: topOffset } }, rest, { children: headerContent })) })), dimensions.isNarrow && drawerOpen && (
|
|
19933
|
+
return (jsxs(Fragment, { children: [topComponentSlot && (jsx(StyledTopComponentSlot, { ref: topSlotRef, children: topComponentSlot })), jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsx(StyledAppBar, __assign({ elevation: 0, hasInvertedStyle: hasInvertedStyle, ref: mergeRefs([ref, navRef]), "aria-label": "Main navigation", tabIndex: 0, position: position, style: { top: topOffset } }, rest, { children: headerContent })) })), dimensions.isNarrow && drawerOpen && (jsx(StyledDrawer$1, { anchor: "right", open: drawerOpen, onClose: () => setDrawerOpen(false), hasInvertedStyle: hasInvertedStyle, topOffset: topOffset, role: "dialog", "aria-label": "Navigation menu", disableScrollLock: false, children: jsxs(StyledDrawerContent, { children: [jsxs("div", { children: [search, primaryNav, primaryNav && secondaryNav && (jsx(StyledSectionDivider, { hasInvertedStyle: hasInvertedStyle })), secondaryNav] }), buttonsNode] }) }))] }));
|
|
19911
19934
|
});
|
|
19912
19935
|
|
|
19913
19936
|
/**
|
|
@@ -24957,7 +24980,7 @@ var renderBarSegment = function (item, index, options) {
|
|
|
24957
24980
|
};
|
|
24958
24981
|
var StackedBarChart = function (props) {
|
|
24959
24982
|
var _a, _b, _c;
|
|
24960
|
-
var title = props.title, badge = props.badge, _d = props.hideBadge, hideBadge = _d === void 0 ? false : _d, data = props.data, _e = props.width, width = _e === void 0 ? "100%" : _e, _f = props.barHeight, barHeightProp = _f === void 0 ? 16 : _f, _g = props.showLegend, showLegend = _g === void 0 ? true : _g, _h = props.showLegendValues, showLegendValues = _h === void 0 ? true : _h, _j = props.legendValueFormat, legendValueFormat = _j === void 0 ? "percentage" : _j, _k = props.selectedIndices, selectedIndices = _k === void 0 ? [] : _k, onSelectionChange = props.onSelectionChange, _l = props.selectionBehavior, selectionBehavior = _l === void 0 ? "dim" : _l, _m = props.mode, mode = _m === void 0 ? "proportional" : _m, maxAmount = props.maxAmount, _o = props.remainingLabel, remainingLabel = _o === void 0 ? "Remaining" : _o, remainingUnit = props.remainingUnit, unit = props.unit, colorGeneratorOptions = props.colorGeneratorOptions, rest = __rest(props, ["title", "badge", "hideBadge", "data", "width", "barHeight", "showLegend", "showLegendValues", "legendValueFormat", "selectedIndices", "onSelectionChange", "selectionBehavior", "mode", "maxAmount", "remainingLabel", "remainingUnit", "unit", "colorGeneratorOptions"]);
|
|
24983
|
+
var title = props.title, badge = props.badge, _d = props.hideBadge, hideBadge = _d === void 0 ? false : _d, data = props.data, _e = props.width, width = _e === void 0 ? "100%" : _e, _f = props.barHeight, barHeightProp = _f === void 0 ? 16 : _f, _g = props.showLegend, showLegend = _g === void 0 ? true : _g, _h = props.showLegendValues, showLegendValues = _h === void 0 ? true : _h, _j = props.legendValueFormat, legendValueFormat = _j === void 0 ? "percentage" : _j, _k = props.selectedIndices, selectedIndices = _k === void 0 ? [] : _k, onSelectionChange = props.onSelectionChange, onSegmentMouseEnter = props.onSegmentMouseEnter, onSegmentMouseLeave = props.onSegmentMouseLeave, onLegendItemMouseEnter = props.onLegendItemMouseEnter, onLegendItemMouseLeave = props.onLegendItemMouseLeave, onSegmentClick = props.onSegmentClick, onLegendItemClick = props.onLegendItemClick, _l = props.selectionBehavior, selectionBehavior = _l === void 0 ? "dim" : _l, _m = props.mode, mode = _m === void 0 ? "proportional" : _m, maxAmount = props.maxAmount, _o = props.remainingLabel, remainingLabel = _o === void 0 ? "Remaining" : _o, remainingUnit = props.remainingUnit, unit = props.unit, colorGeneratorOptions = props.colorGeneratorOptions, rest = __rest(props, ["title", "badge", "hideBadge", "data", "width", "barHeight", "showLegend", "showLegendValues", "legendValueFormat", "selectedIndices", "onSelectionChange", "onSegmentMouseEnter", "onSegmentMouseLeave", "onLegendItemMouseEnter", "onLegendItemMouseLeave", "onSegmentClick", "onLegendItemClick", "selectionBehavior", "mode", "maxAmount", "remainingLabel", "remainingUnit", "unit", "colorGeneratorOptions"]);
|
|
24961
24984
|
// Ensure barHeight is at least 1px
|
|
24962
24985
|
var barHeight = Math.max(1, barHeightProp);
|
|
24963
24986
|
var theme = useTheme$4();
|
|
@@ -25190,8 +25213,24 @@ var StackedBarChart = function (props) {
|
|
|
25190
25213
|
theme,
|
|
25191
25214
|
]);
|
|
25192
25215
|
// Handle legend item hover and leave
|
|
25193
|
-
var handleLegendItemHover = useCallback(function (_item, index) {
|
|
25194
|
-
|
|
25216
|
+
var handleLegendItemHover = useCallback(function (_item, index) {
|
|
25217
|
+
setHoveredIndex(index);
|
|
25218
|
+
if (onLegendItemMouseEnter && data[index]) {
|
|
25219
|
+
onLegendItemMouseEnter(data[index], index);
|
|
25220
|
+
}
|
|
25221
|
+
}, [onLegendItemMouseEnter, data]);
|
|
25222
|
+
var handleLegendItemLeave = useCallback(function (_item, index) {
|
|
25223
|
+
setHoveredIndex(null);
|
|
25224
|
+
if (onLegendItemMouseLeave && data[index]) {
|
|
25225
|
+
onLegendItemMouseLeave(data[index], index);
|
|
25226
|
+
}
|
|
25227
|
+
}, [onLegendItemMouseLeave, data]);
|
|
25228
|
+
// Handle legend item click
|
|
25229
|
+
var handleLegendItemClickInternal = useCallback(function (_item, index) {
|
|
25230
|
+
if (onLegendItemClick && data[index]) {
|
|
25231
|
+
onLegendItemClick(data[index], index);
|
|
25232
|
+
}
|
|
25233
|
+
}, [onLegendItemClick, data]);
|
|
25195
25234
|
// Handle selection change - reusable logic for both segment and legend
|
|
25196
25235
|
var handleSelectionChange = useCallback(function (newSelectedIndices) {
|
|
25197
25236
|
if (!onSelectionChange)
|
|
@@ -25201,8 +25240,13 @@ var StackedBarChart = function (props) {
|
|
|
25201
25240
|
});
|
|
25202
25241
|
onSelectionChange(newSelectedIndices, selectedData);
|
|
25203
25242
|
}, [onSelectionChange, data]);
|
|
25204
|
-
// Handle segment click - toggle selection
|
|
25243
|
+
// Handle segment click - toggle selection and call onSegmentClick
|
|
25205
25244
|
var handleSegmentClick = useCallback(function (index) {
|
|
25245
|
+
// Call onSegmentClick callback if provided
|
|
25246
|
+
if (onSegmentClick && data[index]) {
|
|
25247
|
+
onSegmentClick(data[index], index);
|
|
25248
|
+
}
|
|
25249
|
+
// Handle selection change
|
|
25206
25250
|
if (!onSelectionChange)
|
|
25207
25251
|
return;
|
|
25208
25252
|
var isSelected = selectedIndicesSet.has(index);
|
|
@@ -25212,6 +25256,8 @@ var StackedBarChart = function (props) {
|
|
|
25212
25256
|
handleSelectionChange(newSelectedIndices);
|
|
25213
25257
|
}, [
|
|
25214
25258
|
onSelectionChange,
|
|
25259
|
+
onSegmentClick,
|
|
25260
|
+
data,
|
|
25215
25261
|
selectedIndices,
|
|
25216
25262
|
selectedIndicesSet,
|
|
25217
25263
|
handleSelectionChange,
|
|
@@ -25234,14 +25280,24 @@ var StackedBarChart = function (props) {
|
|
|
25234
25280
|
selectionBehavior: selectionBehavior,
|
|
25235
25281
|
isLast: isLastVisible,
|
|
25236
25282
|
onMouseEnter: function () {
|
|
25237
|
-
|
|
25283
|
+
if (!item.isExiting) {
|
|
25284
|
+
setHoveredIndex(item.originalIndex);
|
|
25285
|
+
if (onSegmentMouseEnter && data[item.originalIndex]) {
|
|
25286
|
+
onSegmentMouseEnter(data[item.originalIndex], item.originalIndex);
|
|
25287
|
+
}
|
|
25288
|
+
}
|
|
25289
|
+
},
|
|
25290
|
+
onMouseLeave: function () {
|
|
25291
|
+
setHoveredIndex(null);
|
|
25292
|
+
if (onSegmentMouseLeave && data[item.originalIndex]) {
|
|
25293
|
+
onSegmentMouseLeave(data[item.originalIndex], item.originalIndex);
|
|
25294
|
+
}
|
|
25238
25295
|
},
|
|
25239
|
-
onMouseLeave: function () { return setHoveredIndex(null); },
|
|
25240
25296
|
onClick: function () {
|
|
25241
25297
|
return !item.isExiting && handleSegmentClick(item.originalIndex);
|
|
25242
25298
|
},
|
|
25243
25299
|
});
|
|
25244
|
-
}), hasRemaining && (jsx(BarSegment, { color: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.sds) === null || _b === void 0 ? void 0 : _b.base) === null || _c === void 0 ? void 0 : _c.backgroundTertiary, percentage: displayRemainingPercentage, height: barHeight, isLast: true, opacity: 1, disabled: true }, "remaining"))] }), showLegend && (jsx(Legend, { items: legendItems, showValues: showLegendValues, onItemMouseEnter: handleLegendItemHover, onItemMouseLeave: handleLegendItemLeave, selectedIndices: selectedIndices, onSelectionChange: onSelectionChange ? handleSelectionChange : undefined, hoveredIndex: hoveredIndex }))] }));
|
|
25300
|
+
}), hasRemaining && (jsx(BarSegment, { color: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.sds) === null || _b === void 0 ? void 0 : _b.base) === null || _c === void 0 ? void 0 : _c.backgroundTertiary, percentage: displayRemainingPercentage, height: barHeight, isLast: true, opacity: 1, disabled: true }, "remaining"))] }), showLegend && (jsx(Legend, { items: legendItems, showValues: showLegendValues, onItemMouseEnter: handleLegendItemHover, onItemMouseLeave: handleLegendItemLeave, onItemClick: onLegendItemClick ? handleLegendItemClickInternal : undefined, selectedIndices: selectedIndices, onSelectionChange: onSelectionChange ? handleSelectionChange : undefined, hoveredIndex: hoveredIndex }))] }));
|
|
25245
25301
|
// If no title, render chart and optional legend without wrapper
|
|
25246
25302
|
if (!title) {
|
|
25247
25303
|
return (jsx(ChartWrapper, __assign$1({ width: width }, rest, { children: chartContent })));
|