@czi-sds/data-viz 0.14.3 → 0.15.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.js CHANGED
@@ -989,15 +989,16 @@ const Shadows = {
989
989
  };
990
990
 
991
991
  const Spaces = {
992
+ xxxs: 2,
993
+ xxs: 4,
994
+ xs: 6,
995
+ s: 8,
996
+ m: 12,
992
997
  default: 12,
993
998
  l: 16,
994
- m: 12,
995
- s: 8,
996
999
  xl: 24,
997
- xs: 6,
998
- xxl: 40,
999
- xxs: 4,
1000
- xxxs: 2
1000
+ xxl: 32,
1001
+ xxxl: 40
1001
1002
  };
1002
1003
 
1003
1004
  const SDSLightThemeColors = {
@@ -9170,9 +9171,9 @@ const StyledPaper = styled$2__default.default(material.Paper, {
9170
9171
  background-color: ${semanticColors?.base?.surface};
9171
9172
  background-image: none;
9172
9173
  box-shadow: ${shadows?.l};
9173
- max-height: calc(100vh - ${2 * (spaces?.xxl || 0)}px);
9174
+ max-height: calc(100vh - ${2 * (spaces?.xxxl || 40)}px);
9174
9175
  border-radius: ${corners?.xl}px;
9175
- padding: ${isSmall ? spaces?.xl : spaces?.xxl}px;
9176
+ padding: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
9176
9177
  outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
9177
9178
  `;
9178
9179
  }}
@@ -9222,7 +9223,7 @@ const StyledButton$1 = styled$2__default.default(Button) `
9222
9223
  const { sdsSize } = props;
9223
9224
  const isSmall = sdsSize === "small" || sdsSize === "medium";
9224
9225
  const spaces = getSpaces(props);
9225
- const right = isSmall ? spaces?.xl : spaces?.xxl;
9226
+ const right = isSmall ? spaces?.xl : spaces?.xxxl;
9226
9227
  return `
9227
9228
  right: ${right}px;
9228
9229
  `;
@@ -9322,7 +9323,7 @@ const StyledDialogActions = styled$2__default.default(material.DialogActions, {
9322
9323
  return `
9323
9324
  justify-content: ${buttonPosition === "right" ? "flex-end" : "flex-start"};;
9324
9325
 
9325
- margin-top: ${isSmall ? spaces?.xl : spaces?.xxl}px;
9326
+ margin-top: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
9326
9327
 
9327
9328
  &.${material.dialogActionsClasses.spacing} > :not(:first-of-type) {
9328
9329
  margin-left: ${spaces?.m}px;
@@ -9429,16 +9430,16 @@ const getResponsivePadding = (props) => {
9429
9430
  const spaces = getSpaces(props);
9430
9431
  const breakpoints = getBreakpoints(props);
9431
9432
  return react.css `
9432
- padding: ${spaces?.xxl}px
9433
+ padding: ${spaces?.xxxl}px
9433
9434
  ${overlayContainerMinMargin?.small || HeroMargins.SMALL};
9434
9435
 
9435
9436
  ${breakpoints?.up("md")} {
9436
- padding: ${spaces?.xxl}px
9437
+ padding: ${spaces?.xxxl}px
9437
9438
  ${overlayContainerMinMargin?.medium || HeroMargins.MEDIUM};
9438
9439
  }
9439
9440
 
9440
9441
  ${breakpoints?.up("lg")} {
9441
- padding: ${spaces?.xxl}px
9442
+ padding: ${spaces?.xxxl}px
9442
9443
  ${overlayContainerMinMargin?.large || HeroMargins.LARGE};
9443
9444
  }
9444
9445
  `;
@@ -10530,7 +10531,7 @@ const LegendContainer = styled$2__default.default("div") `
10530
10531
  `;
10531
10532
  const LegendItem = styled$2__default.default("div") `
10532
10533
  ${(props) => {
10533
- const { isSelected, disabled } = props;
10534
+ const { isSelected, disabled, isHovered } = props;
10534
10535
  const spaces = getSpaces(props);
10535
10536
  const semanticColors = getSemanticColors(props);
10536
10537
  const corners = getCorners(props);
@@ -10541,7 +10542,7 @@ const LegendItem = styled$2__default.default("div") `
10541
10542
  transition: background-color 0.2s ease-in-out;
10542
10543
  padding: ${spaces?.xxxs}px ${spaces?.xxs}px;
10543
10544
  border-radius: ${corners?.s}px;
10544
- background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : "transparent"};
10545
+ background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : isHovered ? semanticColors?.base?.backgroundSecondary : "transparent"};
10545
10546
  pointer-events: ${disabled ? "none" : "auto"};
10546
10547
 
10547
10548
  &:hover {
@@ -10640,7 +10641,7 @@ const Legend = (props) => {
10640
10641
  : hasSelection && !isSelected;
10641
10642
  // Determine color: use colors prop, then item color, then fallback to gray
10642
10643
  const itemColor = colors?.[index] || item.color || fallbackColor;
10643
- return (jsxRuntime.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: [jsxRuntime.jsx(LegendIcon, { color: itemColor, isDimmed: isDimmed }), jsxRuntime.jsx(LegendLabel, { disabled: item.disabled, children: item.name }), showValues && item.value !== undefined && (jsxRuntime.jsx(LegendValue, { disabled: item.disabled, children: typeof item.value === "number"
10644
+ return (jsxRuntime.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: [jsxRuntime.jsx(LegendIcon, { color: itemColor, isDimmed: isDimmed }), jsxRuntime.jsx(LegendLabel, { disabled: item.disabled, children: item.name }), showValues && item.value !== undefined && (jsxRuntime.jsx(LegendValue, { disabled: item.disabled, children: typeof item.value === "number"
10644
10645
  ? item.value.toLocaleString()
10645
10646
  : item.value }))] }, `${item.name}-${index}`));
10646
10647
  }) })));
@@ -17398,6 +17399,7 @@ React.memo(StyledDivider$1);
17398
17399
 
17399
17400
  /* eslint-disable sonarjs/cognitive-complexity */
17400
17401
  /* eslint-disable sonarjs/no-duplicate-string */
17402
+ const TOOLBAR_HEIGHT = 48;
17401
17403
  const doNotForwardProps$a = [
17402
17404
  "hasInvertedStyle",
17403
17405
  "isNarrow",
@@ -17413,7 +17415,7 @@ const doNotForwardProps$a = [
17413
17415
  const StyledTopComponentSlot = styled$2__default.default("div") `
17414
17416
  position: sticky;
17415
17417
  top: 0;
17416
- z-index: 1300;
17418
+ z-index: 2100;
17417
17419
  `;
17418
17420
  const StyledAppBar = styled$2__default.default(material.AppBar, {
17419
17421
  shouldForwardProp: (prop) => ![...doNotForwardProps$a, "sdsStyle"].includes(prop)
@@ -17425,7 +17427,7 @@ const StyledAppBar = styled$2__default.default(material.AppBar, {
17425
17427
  background-image: none;
17426
17428
  max-width: 100%;
17427
17429
  overflow-x: auto;
17428
- z-index: ${props.theme?.zIndex?.drawer ? props.theme.zIndex.drawer + 10 : 1210};
17430
+ z-index: 2100;
17429
17431
  `;
17430
17432
  }}
17431
17433
  `;
@@ -17454,8 +17456,8 @@ const StyledToolbar = styled$2__default.default(material.Toolbar, {
17454
17456
  const spaces = getSpaces(props);
17455
17457
  return material.css `
17456
17458
  &.MuiToolbar-root {
17457
- min-height: 48px;
17458
- max-height: 48px;
17459
+ min-height: ${TOOLBAR_HEIGHT}px;
17460
+ max-height: ${TOOLBAR_HEIGHT}px;
17459
17461
  padding: ${spaces?.s}px ${spaces?.l}px;
17460
17462
 
17461
17463
  ${isNarrow && NarrowToolbar(props)}
@@ -17618,7 +17620,7 @@ const StyledTitleContainer = styled$2__default.default("div", {
17618
17620
  color: ${props.hasInvertedStyle
17619
17621
  ? colors?.base.textPrimaryOnDark
17620
17622
  : colors?.base.textPrimary};
17621
- margin-right: ${spaces?.xxl}px;
17623
+ margin-right: ${spaces?.xxxl}px;
17622
17624
  width: 100%;
17623
17625
 
17624
17626
  ${isNarrow && NarrowTitleContainer()}
@@ -17660,8 +17662,8 @@ const StyledPrimaryNavContainer = styled$2__default.default("div", {
17660
17662
  const primaryNavPositionWithoutSearch = primaryNavPosition === "left" ? "flex-start" : "flex-end";
17661
17663
  return material.css `
17662
17664
  flex-direction: ${isNarrow ? "column" : "row"};
17663
- gap: ${spaces?.xxl}px;
17664
- margin-right: ${spaces?.xxl}px;
17665
+ gap: ${spaces?.xxxl}px;
17666
+ margin-right: ${spaces?.xxxl}px;
17665
17667
  flex: 1;
17666
17668
  justify-content: ${showSearch
17667
17669
  ? primaryNavPositionWithSearch
@@ -17788,14 +17790,14 @@ const NarrowButtonStyles = (props) => {
17788
17790
  &::before {
17789
17791
  content: "";
17790
17792
  position: absolute;
17791
- height: ${spaces?.xxl}px;
17793
+ height: ${spaces?.xxxl}px;
17792
17794
  width: 100%;
17793
17795
  background: linear-gradient(
17794
17796
  to top,
17795
17797
  ${backgroundColor} 0%,
17796
17798
  ${backgroundColor}00 100%
17797
17799
  );
17798
- top: -${spaces?.xxl}px;
17800
+ top: -${spaces?.xxxl}px;
17799
17801
  }
17800
17802
 
17801
17803
  .MuiButton-icon .MuiSvgIcon-root {
@@ -17816,7 +17818,7 @@ const StyledButtonSection = styled$2__default.default("section", {
17816
17818
  const spaces = getSpaces(props);
17817
17819
  return material.css `
17818
17820
  gap: ${spaces?.m}px;
17819
- margin-left: ${spaces?.xxl}px;
17821
+ margin-left: ${spaces?.xxxl}px;
17820
17822
 
17821
17823
  ${isNarrow && NarrowButtonStyles(props)}
17822
17824
  `;
@@ -17836,8 +17838,8 @@ const StyledDrawer$1 = styled$2__default.default(material.Drawer, {
17836
17838
  width: 100%;
17837
17839
  display: flex;
17838
17840
  flex-direction: column;
17839
- top: ${topOffset}px;
17840
- height: calc(100% - ${topOffset}px);
17841
+ top: ${topOffset + TOOLBAR_HEIGHT}px;
17842
+ height: calc(100% - ${topOffset + TOOLBAR_HEIGHT}px);
17841
17843
  justify-content: space-between;
17842
17844
  }
17843
17845
  `;
@@ -17887,7 +17889,7 @@ const DrawerAccordionStyles = (props) => {
17887
17889
  &[aria-expanded="true"] {
17888
17890
  position: sticky;
17889
17891
  border-radius: 0;
17890
- top: calc(48px + ${spaces?.s}px);
17892
+ top: ${spaces?.s}px;
17891
17893
  z-index: 11;
17892
17894
  backdrop-filter: blur(0px);
17893
17895
  color: ${textOpenColor};
@@ -18072,6 +18074,7 @@ const StyledMegaMenuDrawer = styled$2__default.default(material.Drawer, {
18072
18074
  return material.css `
18073
18075
  pointer-events: none;
18074
18076
  top: ${topOffset}px;
18077
+ z-index: 2000;
18075
18078
 
18076
18079
  .MuiDrawer-paper {
18077
18080
  background-color: ${hasInvertedStyle
@@ -18084,7 +18087,7 @@ const StyledMegaMenuDrawer = styled$2__default.default(material.Drawer, {
18084
18087
  box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.1);
18085
18088
  background-image: none;
18086
18089
  padding: ${spaces?.xl ? spaces?.xl + 48 : 48}px ${spaces?.xl}px
18087
- ${spaces?.xxl}px;
18090
+ ${spaces?.xxxl}px;
18088
18091
  transform: translateY(48px);
18089
18092
  top: ${topOffset}px;
18090
18093
  }
@@ -18110,7 +18113,7 @@ const StyledMegaMenuContent = styled$2__default.default("div", {
18110
18113
  : semanticColors?.base.backgroundPrimary};
18111
18114
  display: flex;
18112
18115
  flex-wrap: wrap;
18113
- gap: ${spaces?.xxl}px;
18116
+ gap: ${spaces?.xxxl}px;
18114
18117
  width: 100%;
18115
18118
  max-width: 1200px;
18116
18119
  margin: 0 auto;
@@ -18129,7 +18132,7 @@ const StyledHoverDrawerColumn = styled$2__default.default("div", {
18129
18132
  // Account for gaps between columns
18130
18133
  const columnsPerRow = totalColumns > 4 ? 4 : totalColumns;
18131
18134
  const gapCount = columnsPerRow - 1;
18132
- const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxl}px)) / ${columnsPerRow})`;
18135
+ const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxxl}px)) / ${columnsPerRow})`;
18133
18136
  return material.css `
18134
18137
  display: flex;
18135
18138
  flex-direction: column;
@@ -18330,7 +18333,7 @@ const StyledHoverDrawerActions = styled$2__default.default("div", {
18330
18333
  margin-top: ${spaces?.l}px;
18331
18334
  padding-left: ${isNarrow
18332
18335
  ? `calc(${spaces?.l}px + ${spaces?.m}px)`
18333
- : `calc(${spaces?.xxl}px + ${spaces?.xs}px)`};
18336
+ : `calc(${spaces?.xxxl}px + ${spaces?.xs}px)`};
18334
18337
  flex-wrap: wrap;
18335
18338
  `;
18336
18339
  }}
@@ -19216,6 +19219,7 @@ function useNavigationState() {
19216
19219
  function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
19217
19220
  const theme = material.useTheme();
19218
19221
  const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
19222
+ const [clickedDrawerKey, setClickedDrawerKey] = React.useState(null);
19219
19223
  // Helper function to wrap dropdown items' onClick handlers
19220
19224
  // This automatically sets the parent dropdown as active when an item is clicked
19221
19225
  const wrapDropdownItemsWithActiveKey = (dropdownItems, parentKey) => {
@@ -19254,8 +19258,22 @@ function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, ite
19254
19258
  const handleClick = (e) => {
19255
19259
  onChange(key);
19256
19260
  parentOnClick?.(e);
19261
+ if (drawerOpen) {
19262
+ setActiveDrawerKey(null);
19263
+ setContentKey(null);
19264
+ setClickedDrawerKey(key);
19265
+ }
19257
19266
  };
19258
- return (jsxRuntime.jsx(StyledHoverDrawerContainer, { onMouseEnter: () => onDrawerOpen(key), onMouseLeave: onDrawerClose, children: jsxRuntime.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: jsxRuntime.jsxs(StyledLabel, { itemType: item.itemType, active: isActive, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, navVariant: "primary", children: [jsxRuntime.jsx(StyledLabelTextWrapper$1, { active: isActive, isNarrow: isNarrow, children: label }), jsxRuntime.jsx(StyledLabelTextWrapperShadow$1, { "aria-hidden": "true", isNarrow: isNarrow, children: label }), jsxRuntime.jsx(Icon, { sdsIcon: isDrawerOpen ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] }) })) }, key));
19267
+ return (jsxRuntime.jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
19268
+ if (clickedDrawerKey !== key) {
19269
+ onDrawerOpen(key);
19270
+ }
19271
+ }, onMouseLeave: () => {
19272
+ if (clickedDrawerKey === key) {
19273
+ setClickedDrawerKey(null);
19274
+ }
19275
+ onDrawerClose();
19276
+ }, children: jsxRuntime.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: jsxRuntime.jsxs(StyledLabel, { itemType: item.itemType, active: isActive, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, navVariant: "primary", children: [jsxRuntime.jsx(StyledLabelTextWrapper$1, { active: isActive, isNarrow: isNarrow, children: label }), jsxRuntime.jsx(StyledLabelTextWrapperShadow$1, { "aria-hidden": "true", isNarrow: isNarrow, children: label }), jsxRuntime.jsx(Icon, { sdsIcon: isDrawerOpen ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] }) })) }, key));
19259
19277
  };
19260
19278
  const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
19261
19279
  const isDropdownOpen = open && activeDropdownKey === key;
@@ -19931,7 +19949,7 @@ React.forwardRef((props, ref) => {
19931
19949
  const position = sdsStyle === "drawer" ? "sticky" : isSticky ? "sticky" : "relative";
19932
19950
  // Disable elevation when drawer style is active and any drawer is open
19933
19951
  const effectiveScrollElevation = scrollElevation && !(sdsStyle === "drawer" && isAnyDrawerOpen);
19934
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [topComponentSlot && (jsxRuntime.jsx(StyledTopComponentSlot, { ref: topSlotRef, children: topComponentSlot })), jsxRuntime.jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsxRuntime.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 && (jsxRuntime.jsxs(StyledDrawer$1, { anchor: "right", open: drawerOpen, onClose: () => setDrawerOpen(false), hasInvertedStyle: hasInvertedStyle, topOffset: topOffset, role: "dialog", "aria-label": "Navigation menu", children: [jsxRuntime.jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsxRuntime.jsx(StyledAppBar, __assign({ elevation: 10, hasInvertedStyle: hasInvertedStyle, ref: mergeRefs([ref, navRef]), "aria-label": "Main navigation", tabIndex: 0, position: "sticky" }, rest, { children: headerContent })) })), jsxRuntime.jsxs(StyledDrawerContent, { children: [jsxRuntime.jsxs("div", { children: [search, primaryNav, primaryNav && secondaryNav && (jsxRuntime.jsx(StyledSectionDivider, { hasInvertedStyle: hasInvertedStyle })), secondaryNav] }), buttonsNode] })] }))] }));
19952
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [topComponentSlot && (jsxRuntime.jsx(StyledTopComponentSlot, { ref: topSlotRef, children: topComponentSlot })), jsxRuntime.jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsxRuntime.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 && (jsxRuntime.jsx(StyledDrawer$1, { anchor: "right", open: drawerOpen, onClose: () => setDrawerOpen(false), hasInvertedStyle: hasInvertedStyle, topOffset: topOffset, role: "dialog", "aria-label": "Navigation menu", disableScrollLock: false, children: jsxRuntime.jsxs(StyledDrawerContent, { children: [jsxRuntime.jsxs("div", { children: [search, primaryNav, primaryNav && secondaryNav && (jsxRuntime.jsx(StyledSectionDivider, { hasInvertedStyle: hasInvertedStyle })), secondaryNav] }), buttonsNode] }) }))] }));
19935
19953
  });
19936
19954
 
19937
19955
  /**
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
- xs: 6,
974
- xxl: 40,
975
- xxs: 4,
976
- xxxs: 2
976
+ xxl: 32,
977
+ xxxl: 40
977
978
  };
978
979
 
979
980
  const SDSLightThemeColors = {
@@ -9146,9 +9147,9 @@ const StyledPaper = styled$2(Paper, {
9146
9147
  background-color: ${semanticColors?.base?.surface};
9147
9148
  background-image: none;
9148
9149
  box-shadow: ${shadows?.l};
9149
- max-height: calc(100vh - ${2 * (spaces?.xxl || 0)}px);
9150
+ max-height: calc(100vh - ${2 * (spaces?.xxxl || 40)}px);
9150
9151
  border-radius: ${corners?.xl}px;
9151
- padding: ${isSmall ? spaces?.xl : spaces?.xxl}px;
9152
+ padding: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
9152
9153
  outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
9153
9154
  `;
9154
9155
  }}
@@ -9198,7 +9199,7 @@ const StyledButton$1 = styled$2(Button) `
9198
9199
  const { sdsSize } = props;
9199
9200
  const isSmall = sdsSize === "small" || sdsSize === "medium";
9200
9201
  const spaces = getSpaces(props);
9201
- const right = isSmall ? spaces?.xl : spaces?.xxl;
9202
+ const right = isSmall ? spaces?.xl : spaces?.xxxl;
9202
9203
  return `
9203
9204
  right: ${right}px;
9204
9205
  `;
@@ -9298,7 +9299,7 @@ const StyledDialogActions = styled$2(DialogActions$1, {
9298
9299
  return `
9299
9300
  justify-content: ${buttonPosition === "right" ? "flex-end" : "flex-start"};;
9300
9301
 
9301
- margin-top: ${isSmall ? spaces?.xl : spaces?.xxl}px;
9302
+ margin-top: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
9302
9303
 
9303
9304
  &.${dialogActionsClasses.spacing} > :not(:first-of-type) {
9304
9305
  margin-left: ${spaces?.m}px;
@@ -9405,16 +9406,16 @@ const getResponsivePadding = (props) => {
9405
9406
  const spaces = getSpaces(props);
9406
9407
  const breakpoints = getBreakpoints(props);
9407
9408
  return css$1 `
9408
- padding: ${spaces?.xxl}px
9409
+ padding: ${spaces?.xxxl}px
9409
9410
  ${overlayContainerMinMargin?.small || HeroMargins.SMALL};
9410
9411
 
9411
9412
  ${breakpoints?.up("md")} {
9412
- padding: ${spaces?.xxl}px
9413
+ padding: ${spaces?.xxxl}px
9413
9414
  ${overlayContainerMinMargin?.medium || HeroMargins.MEDIUM};
9414
9415
  }
9415
9416
 
9416
9417
  ${breakpoints?.up("lg")} {
9417
- padding: ${spaces?.xxl}px
9418
+ padding: ${spaces?.xxxl}px
9418
9419
  ${overlayContainerMinMargin?.large || HeroMargins.LARGE};
9419
9420
  }
9420
9421
  `;
@@ -10506,7 +10507,7 @@ const LegendContainer = styled$2("div") `
10506
10507
  `;
10507
10508
  const LegendItem = styled$2("div") `
10508
10509
  ${(props) => {
10509
- const { isSelected, disabled } = props;
10510
+ const { isSelected, disabled, isHovered } = props;
10510
10511
  const spaces = getSpaces(props);
10511
10512
  const semanticColors = getSemanticColors(props);
10512
10513
  const corners = getCorners(props);
@@ -10517,7 +10518,7 @@ const LegendItem = styled$2("div") `
10517
10518
  transition: background-color 0.2s ease-in-out;
10518
10519
  padding: ${spaces?.xxxs}px ${spaces?.xxs}px;
10519
10520
  border-radius: ${corners?.s}px;
10520
- background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : "transparent"};
10521
+ background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : isHovered ? semanticColors?.base?.backgroundSecondary : "transparent"};
10521
10522
  pointer-events: ${disabled ? "none" : "auto"};
10522
10523
 
10523
10524
  &:hover {
@@ -10616,7 +10617,7 @@ const Legend = (props) => {
10616
10617
  : hasSelection && !isSelected;
10617
10618
  // Determine color: use colors prop, then item color, then fallback to gray
10618
10619
  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"
10620
+ 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
10621
  ? item.value.toLocaleString()
10621
10622
  : item.value }))] }, `${item.name}-${index}`));
10622
10623
  }) })));
@@ -17374,6 +17375,7 @@ memo(StyledDivider$1);
17374
17375
 
17375
17376
  /* eslint-disable sonarjs/cognitive-complexity */
17376
17377
  /* eslint-disable sonarjs/no-duplicate-string */
17378
+ const TOOLBAR_HEIGHT = 48;
17377
17379
  const doNotForwardProps$a = [
17378
17380
  "hasInvertedStyle",
17379
17381
  "isNarrow",
@@ -17389,7 +17391,7 @@ const doNotForwardProps$a = [
17389
17391
  const StyledTopComponentSlot = styled$2("div") `
17390
17392
  position: sticky;
17391
17393
  top: 0;
17392
- z-index: 1300;
17394
+ z-index: 2100;
17393
17395
  `;
17394
17396
  const StyledAppBar = styled$2(AppBar, {
17395
17397
  shouldForwardProp: (prop) => ![...doNotForwardProps$a, "sdsStyle"].includes(prop)
@@ -17401,7 +17403,7 @@ const StyledAppBar = styled$2(AppBar, {
17401
17403
  background-image: none;
17402
17404
  max-width: 100%;
17403
17405
  overflow-x: auto;
17404
- z-index: ${props.theme?.zIndex?.drawer ? props.theme.zIndex.drawer + 10 : 1210};
17406
+ z-index: 2100;
17405
17407
  `;
17406
17408
  }}
17407
17409
  `;
@@ -17430,8 +17432,8 @@ const StyledToolbar = styled$2(Toolbar, {
17430
17432
  const spaces = getSpaces(props);
17431
17433
  return css$2 `
17432
17434
  &.MuiToolbar-root {
17433
- min-height: 48px;
17434
- max-height: 48px;
17435
+ min-height: ${TOOLBAR_HEIGHT}px;
17436
+ max-height: ${TOOLBAR_HEIGHT}px;
17435
17437
  padding: ${spaces?.s}px ${spaces?.l}px;
17436
17438
 
17437
17439
  ${isNarrow && NarrowToolbar(props)}
@@ -17594,7 +17596,7 @@ const StyledTitleContainer = styled$2("div", {
17594
17596
  color: ${props.hasInvertedStyle
17595
17597
  ? colors?.base.textPrimaryOnDark
17596
17598
  : colors?.base.textPrimary};
17597
- margin-right: ${spaces?.xxl}px;
17599
+ margin-right: ${spaces?.xxxl}px;
17598
17600
  width: 100%;
17599
17601
 
17600
17602
  ${isNarrow && NarrowTitleContainer()}
@@ -17636,8 +17638,8 @@ const StyledPrimaryNavContainer = styled$2("div", {
17636
17638
  const primaryNavPositionWithoutSearch = primaryNavPosition === "left" ? "flex-start" : "flex-end";
17637
17639
  return css$2 `
17638
17640
  flex-direction: ${isNarrow ? "column" : "row"};
17639
- gap: ${spaces?.xxl}px;
17640
- margin-right: ${spaces?.xxl}px;
17641
+ gap: ${spaces?.xxxl}px;
17642
+ margin-right: ${spaces?.xxxl}px;
17641
17643
  flex: 1;
17642
17644
  justify-content: ${showSearch
17643
17645
  ? primaryNavPositionWithSearch
@@ -17764,14 +17766,14 @@ const NarrowButtonStyles = (props) => {
17764
17766
  &::before {
17765
17767
  content: "";
17766
17768
  position: absolute;
17767
- height: ${spaces?.xxl}px;
17769
+ height: ${spaces?.xxxl}px;
17768
17770
  width: 100%;
17769
17771
  background: linear-gradient(
17770
17772
  to top,
17771
17773
  ${backgroundColor} 0%,
17772
17774
  ${backgroundColor}00 100%
17773
17775
  );
17774
- top: -${spaces?.xxl}px;
17776
+ top: -${spaces?.xxxl}px;
17775
17777
  }
17776
17778
 
17777
17779
  .MuiButton-icon .MuiSvgIcon-root {
@@ -17792,7 +17794,7 @@ const StyledButtonSection = styled$2("section", {
17792
17794
  const spaces = getSpaces(props);
17793
17795
  return css$2 `
17794
17796
  gap: ${spaces?.m}px;
17795
- margin-left: ${spaces?.xxl}px;
17797
+ margin-left: ${spaces?.xxxl}px;
17796
17798
 
17797
17799
  ${isNarrow && NarrowButtonStyles(props)}
17798
17800
  `;
@@ -17812,8 +17814,8 @@ const StyledDrawer$1 = styled$2(Drawer, {
17812
17814
  width: 100%;
17813
17815
  display: flex;
17814
17816
  flex-direction: column;
17815
- top: ${topOffset}px;
17816
- height: calc(100% - ${topOffset}px);
17817
+ top: ${topOffset + TOOLBAR_HEIGHT}px;
17818
+ height: calc(100% - ${topOffset + TOOLBAR_HEIGHT}px);
17817
17819
  justify-content: space-between;
17818
17820
  }
17819
17821
  `;
@@ -17863,7 +17865,7 @@ const DrawerAccordionStyles = (props) => {
17863
17865
  &[aria-expanded="true"] {
17864
17866
  position: sticky;
17865
17867
  border-radius: 0;
17866
- top: calc(48px + ${spaces?.s}px);
17868
+ top: ${spaces?.s}px;
17867
17869
  z-index: 11;
17868
17870
  backdrop-filter: blur(0px);
17869
17871
  color: ${textOpenColor};
@@ -18048,6 +18050,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
18048
18050
  return css$2 `
18049
18051
  pointer-events: none;
18050
18052
  top: ${topOffset}px;
18053
+ z-index: 2000;
18051
18054
 
18052
18055
  .MuiDrawer-paper {
18053
18056
  background-color: ${hasInvertedStyle
@@ -18060,7 +18063,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
18060
18063
  box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.1);
18061
18064
  background-image: none;
18062
18065
  padding: ${spaces?.xl ? spaces?.xl + 48 : 48}px ${spaces?.xl}px
18063
- ${spaces?.xxl}px;
18066
+ ${spaces?.xxxl}px;
18064
18067
  transform: translateY(48px);
18065
18068
  top: ${topOffset}px;
18066
18069
  }
@@ -18086,7 +18089,7 @@ const StyledMegaMenuContent = styled$2("div", {
18086
18089
  : semanticColors?.base.backgroundPrimary};
18087
18090
  display: flex;
18088
18091
  flex-wrap: wrap;
18089
- gap: ${spaces?.xxl}px;
18092
+ gap: ${spaces?.xxxl}px;
18090
18093
  width: 100%;
18091
18094
  max-width: 1200px;
18092
18095
  margin: 0 auto;
@@ -18105,7 +18108,7 @@ const StyledHoverDrawerColumn = styled$2("div", {
18105
18108
  // Account for gaps between columns
18106
18109
  const columnsPerRow = totalColumns > 4 ? 4 : totalColumns;
18107
18110
  const gapCount = columnsPerRow - 1;
18108
- const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxl}px)) / ${columnsPerRow})`;
18111
+ const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxxl}px)) / ${columnsPerRow})`;
18109
18112
  return css$2 `
18110
18113
  display: flex;
18111
18114
  flex-direction: column;
@@ -18306,7 +18309,7 @@ const StyledHoverDrawerActions = styled$2("div", {
18306
18309
  margin-top: ${spaces?.l}px;
18307
18310
  padding-left: ${isNarrow
18308
18311
  ? `calc(${spaces?.l}px + ${spaces?.m}px)`
18309
- : `calc(${spaces?.xxl}px + ${spaces?.xs}px)`};
18312
+ : `calc(${spaces?.xxxl}px + ${spaces?.xs}px)`};
18310
18313
  flex-wrap: wrap;
18311
18314
  `;
18312
18315
  }}
@@ -19192,6 +19195,7 @@ function useNavigationState() {
19192
19195
  function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
19193
19196
  const theme = useTheme$4();
19194
19197
  const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
19198
+ const [clickedDrawerKey, setClickedDrawerKey] = useState(null);
19195
19199
  // Helper function to wrap dropdown items' onClick handlers
19196
19200
  // This automatically sets the parent dropdown as active when an item is clicked
19197
19201
  const wrapDropdownItemsWithActiveKey = (dropdownItems, parentKey) => {
@@ -19230,8 +19234,22 @@ function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, ite
19230
19234
  const handleClick = (e) => {
19231
19235
  onChange(key);
19232
19236
  parentOnClick?.(e);
19237
+ if (drawerOpen) {
19238
+ setActiveDrawerKey(null);
19239
+ setContentKey(null);
19240
+ setClickedDrawerKey(key);
19241
+ }
19233
19242
  };
19234
- return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => onDrawerOpen(key), onMouseLeave: onDrawerClose, 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));
19243
+ return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
19244
+ if (clickedDrawerKey !== key) {
19245
+ onDrawerOpen(key);
19246
+ }
19247
+ }, onMouseLeave: () => {
19248
+ if (clickedDrawerKey === key) {
19249
+ setClickedDrawerKey(null);
19250
+ }
19251
+ onDrawerClose();
19252
+ }, 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
19253
  };
19236
19254
  const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
19237
19255
  const isDropdownOpen = open && activeDropdownKey === key;
@@ -19907,7 +19925,7 @@ forwardRef((props, ref) => {
19907
19925
  const position = sdsStyle === "drawer" ? "sticky" : isSticky ? "sticky" : "relative";
19908
19926
  // Disable elevation when drawer style is active and any drawer is open
19909
19927
  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 && (jsxs(StyledDrawer$1, { anchor: "right", open: drawerOpen, onClose: () => setDrawerOpen(false), hasInvertedStyle: hasInvertedStyle, topOffset: topOffset, role: "dialog", "aria-label": "Navigation menu", children: [jsx(ElevationScroll, __assign({}, props, { shouldElevate: effectiveScrollElevation, children: jsx(StyledAppBar, __assign({ elevation: 10, hasInvertedStyle: hasInvertedStyle, ref: mergeRefs([ref, navRef]), "aria-label": "Main navigation", tabIndex: 0, position: "sticky" }, rest, { children: headerContent })) })), jsxs(StyledDrawerContent, { children: [jsxs("div", { children: [search, primaryNav, primaryNav && secondaryNav && (jsx(StyledSectionDivider, { hasInvertedStyle: hasInvertedStyle })), secondaryNav] }), buttonsNode] })] }))] }));
19928
+ 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
19929
  });
19912
19930
 
19913
19931
  /**