@czi-sds/components 22.17.1 → 23.1.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 +7 -3
- package/dist/index.cjs.js +64 -41
- package/dist/index.esm.d.ts +7 -3
- package/dist/index.esm.js +64 -41
- package/dist/tailwind.json +7 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/variables.css +14 -12
- package/dist/variables.scss +7 -6
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -498,15 +498,16 @@ const Shadows = {
|
|
|
498
498
|
};
|
|
499
499
|
|
|
500
500
|
const Spaces = {
|
|
501
|
+
xxxs: 2,
|
|
502
|
+
xxs: 4,
|
|
503
|
+
xs: 6,
|
|
504
|
+
s: 8,
|
|
505
|
+
m: 12,
|
|
501
506
|
default: 12,
|
|
502
507
|
l: 16,
|
|
503
|
-
m: 12,
|
|
504
|
-
s: 8,
|
|
505
508
|
xl: 24,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
xxs: 4,
|
|
509
|
-
xxxs: 2
|
|
509
|
+
xxl: 32,
|
|
510
|
+
xxxl: 40
|
|
510
511
|
};
|
|
511
512
|
|
|
512
513
|
const SDSLightThemeColors = {
|
|
@@ -1280,6 +1281,7 @@ function makeThemeOptions(appTheme, mode) {
|
|
|
1280
1281
|
appTheme.spacing.l,
|
|
1281
1282
|
appTheme.spacing.xl,
|
|
1282
1283
|
appTheme.spacing.xxl,
|
|
1284
|
+
appTheme.spacing.xxxl,
|
|
1283
1285
|
],
|
|
1284
1286
|
transitions: {
|
|
1285
1287
|
duration: {
|
|
@@ -9843,9 +9845,9 @@ const StyledPaper = styled$2(Paper, {
|
|
|
9843
9845
|
background-color: ${semanticColors?.base?.surface};
|
|
9844
9846
|
background-image: none;
|
|
9845
9847
|
box-shadow: ${shadows?.l};
|
|
9846
|
-
max-height: calc(100vh - ${2 * (spaces?.
|
|
9848
|
+
max-height: calc(100vh - ${2 * (spaces?.xxxl || 40)}px);
|
|
9847
9849
|
border-radius: ${corners?.xl}px;
|
|
9848
|
-
padding: ${isSmall ? spaces?.xl : spaces?.
|
|
9850
|
+
padding: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
9849
9851
|
outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
|
|
9850
9852
|
`;
|
|
9851
9853
|
}}
|
|
@@ -9895,7 +9897,7 @@ const StyledButton$1 = styled$2(Button) `
|
|
|
9895
9897
|
const { sdsSize } = props;
|
|
9896
9898
|
const isSmall = sdsSize === "small" || sdsSize === "medium";
|
|
9897
9899
|
const spaces = getSpaces(props);
|
|
9898
|
-
const right = isSmall ? spaces?.xl : spaces?.
|
|
9900
|
+
const right = isSmall ? spaces?.xl : spaces?.xxxl;
|
|
9899
9901
|
return `
|
|
9900
9902
|
right: ${right}px;
|
|
9901
9903
|
`;
|
|
@@ -9995,7 +9997,7 @@ const StyledDialogActions = styled$2(DialogActions$1, {
|
|
|
9995
9997
|
return `
|
|
9996
9998
|
justify-content: ${buttonPosition === "right" ? "flex-end" : "flex-start"};;
|
|
9997
9999
|
|
|
9998
|
-
margin-top: ${isSmall ? spaces?.xl : spaces?.
|
|
10000
|
+
margin-top: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
9999
10001
|
|
|
10000
10002
|
&.${dialogActionsClasses.spacing} > :not(:first-of-type) {
|
|
10001
10003
|
margin-left: ${spaces?.m}px;
|
|
@@ -10102,16 +10104,16 @@ const getResponsivePadding = (props) => {
|
|
|
10102
10104
|
const spaces = getSpaces(props);
|
|
10103
10105
|
const breakpoints = getBreakpoints(props);
|
|
10104
10106
|
return css$1 `
|
|
10105
|
-
padding: ${spaces?.
|
|
10107
|
+
padding: ${spaces?.xxxl}px
|
|
10106
10108
|
${overlayContainerMinMargin?.small || HeroMargins.SMALL};
|
|
10107
10109
|
|
|
10108
10110
|
${breakpoints?.up("md")} {
|
|
10109
|
-
padding: ${spaces?.
|
|
10111
|
+
padding: ${spaces?.xxxl}px
|
|
10110
10112
|
${overlayContainerMinMargin?.medium || HeroMargins.MEDIUM};
|
|
10111
10113
|
}
|
|
10112
10114
|
|
|
10113
10115
|
${breakpoints?.up("lg")} {
|
|
10114
|
-
padding: ${spaces?.
|
|
10116
|
+
padding: ${spaces?.xxxl}px
|
|
10115
10117
|
${overlayContainerMinMargin?.large || HeroMargins.LARGE};
|
|
10116
10118
|
}
|
|
10117
10119
|
`;
|
|
@@ -11292,7 +11294,7 @@ const LegendContainer = styled$2("div") `
|
|
|
11292
11294
|
`;
|
|
11293
11295
|
const LegendItem = styled$2("div") `
|
|
11294
11296
|
${(props) => {
|
|
11295
|
-
const { isSelected, disabled } = props;
|
|
11297
|
+
const { isSelected, disabled, isHovered } = props;
|
|
11296
11298
|
const spaces = getSpaces(props);
|
|
11297
11299
|
const semanticColors = getSemanticColors(props);
|
|
11298
11300
|
const corners = getCorners(props);
|
|
@@ -11303,7 +11305,7 @@ const LegendItem = styled$2("div") `
|
|
|
11303
11305
|
transition: background-color 0.2s ease-in-out;
|
|
11304
11306
|
padding: ${spaces?.xxxs}px ${spaces?.xxs}px;
|
|
11305
11307
|
border-radius: ${corners?.s}px;
|
|
11306
|
-
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : "transparent"};
|
|
11308
|
+
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : isHovered ? semanticColors?.base?.backgroundSecondary : "transparent"};
|
|
11307
11309
|
pointer-events: ${disabled ? "none" : "auto"};
|
|
11308
11310
|
|
|
11309
11311
|
&:hover {
|
|
@@ -11402,7 +11404,7 @@ const Legend = (props) => {
|
|
|
11402
11404
|
: hasSelection && !isSelected;
|
|
11403
11405
|
// Determine color: use colors prop, then item color, then fallback to gray
|
|
11404
11406
|
const itemColor = colors?.[index] || item.color || fallbackColor;
|
|
11405
|
-
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"
|
|
11407
|
+
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"
|
|
11406
11408
|
? item.value.toLocaleString()
|
|
11407
11409
|
: item.value }))] }, `${item.name}-${index}`));
|
|
11408
11410
|
}) })));
|
|
@@ -18323,6 +18325,7 @@ function NavigationFooter({ backgroundAppearance = "matchBackground", images, lo
|
|
|
18323
18325
|
|
|
18324
18326
|
/* eslint-disable sonarjs/cognitive-complexity */
|
|
18325
18327
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
18328
|
+
const TOOLBAR_HEIGHT = 48;
|
|
18326
18329
|
const doNotForwardProps$a = [
|
|
18327
18330
|
"hasInvertedStyle",
|
|
18328
18331
|
"isNarrow",
|
|
@@ -18338,7 +18341,7 @@ const doNotForwardProps$a = [
|
|
|
18338
18341
|
const StyledTopComponentSlot = styled$2("div") `
|
|
18339
18342
|
position: sticky;
|
|
18340
18343
|
top: 0;
|
|
18341
|
-
z-index:
|
|
18344
|
+
z-index: 2100;
|
|
18342
18345
|
`;
|
|
18343
18346
|
const StyledAppBar = styled$2(AppBar, {
|
|
18344
18347
|
shouldForwardProp: (prop) => ![...doNotForwardProps$a, "sdsStyle"].includes(prop)
|
|
@@ -18350,7 +18353,7 @@ const StyledAppBar = styled$2(AppBar, {
|
|
|
18350
18353
|
background-image: none;
|
|
18351
18354
|
max-width: 100%;
|
|
18352
18355
|
overflow-x: auto;
|
|
18353
|
-
z-index:
|
|
18356
|
+
z-index: 2100;
|
|
18354
18357
|
`;
|
|
18355
18358
|
}}
|
|
18356
18359
|
`;
|
|
@@ -18379,8 +18382,8 @@ const StyledToolbar = styled$2(Toolbar, {
|
|
|
18379
18382
|
const spaces = getSpaces(props);
|
|
18380
18383
|
return css$3 `
|
|
18381
18384
|
&.MuiToolbar-root {
|
|
18382
|
-
min-height:
|
|
18383
|
-
max-height:
|
|
18385
|
+
min-height: ${TOOLBAR_HEIGHT}px;
|
|
18386
|
+
max-height: ${TOOLBAR_HEIGHT}px;
|
|
18384
18387
|
padding: ${spaces?.s}px ${spaces?.l}px;
|
|
18385
18388
|
|
|
18386
18389
|
${isNarrow && NarrowToolbar(props)}
|
|
@@ -18543,7 +18546,7 @@ const StyledTitleContainer = styled$2("div", {
|
|
|
18543
18546
|
color: ${props.hasInvertedStyle
|
|
18544
18547
|
? colors?.base.textPrimaryOnDark
|
|
18545
18548
|
: colors?.base.textPrimary};
|
|
18546
|
-
margin-right: ${spaces?.
|
|
18549
|
+
margin-right: ${spaces?.xxxl}px;
|
|
18547
18550
|
width: 100%;
|
|
18548
18551
|
|
|
18549
18552
|
${isNarrow && NarrowTitleContainer()}
|
|
@@ -18585,8 +18588,8 @@ const StyledPrimaryNavContainer = styled$2("div", {
|
|
|
18585
18588
|
const primaryNavPositionWithoutSearch = primaryNavPosition === "left" ? "flex-start" : "flex-end";
|
|
18586
18589
|
return css$3 `
|
|
18587
18590
|
flex-direction: ${isNarrow ? "column" : "row"};
|
|
18588
|
-
gap: ${spaces?.
|
|
18589
|
-
margin-right: ${spaces?.
|
|
18591
|
+
gap: ${spaces?.xxxl}px;
|
|
18592
|
+
margin-right: ${spaces?.xxxl}px;
|
|
18590
18593
|
flex: 1;
|
|
18591
18594
|
justify-content: ${showSearch
|
|
18592
18595
|
? primaryNavPositionWithSearch
|
|
@@ -18713,14 +18716,14 @@ const NarrowButtonStyles = (props) => {
|
|
|
18713
18716
|
&::before {
|
|
18714
18717
|
content: "";
|
|
18715
18718
|
position: absolute;
|
|
18716
|
-
height: ${spaces?.
|
|
18719
|
+
height: ${spaces?.xxxl}px;
|
|
18717
18720
|
width: 100%;
|
|
18718
18721
|
background: linear-gradient(
|
|
18719
18722
|
to top,
|
|
18720
18723
|
${backgroundColor} 0%,
|
|
18721
18724
|
${backgroundColor}00 100%
|
|
18722
18725
|
);
|
|
18723
|
-
top: -${spaces?.
|
|
18726
|
+
top: -${spaces?.xxxl}px;
|
|
18724
18727
|
}
|
|
18725
18728
|
|
|
18726
18729
|
.MuiButton-icon .MuiSvgIcon-root {
|
|
@@ -18741,7 +18744,7 @@ const StyledButtonSection = styled$2("section", {
|
|
|
18741
18744
|
const spaces = getSpaces(props);
|
|
18742
18745
|
return css$3 `
|
|
18743
18746
|
gap: ${spaces?.m}px;
|
|
18744
|
-
margin-left: ${spaces?.
|
|
18747
|
+
margin-left: ${spaces?.xxxl}px;
|
|
18745
18748
|
|
|
18746
18749
|
${isNarrow && NarrowButtonStyles(props)}
|
|
18747
18750
|
`;
|
|
@@ -18761,8 +18764,8 @@ const StyledDrawer$1 = styled$2(Drawer, {
|
|
|
18761
18764
|
width: 100%;
|
|
18762
18765
|
display: flex;
|
|
18763
18766
|
flex-direction: column;
|
|
18764
|
-
top: ${topOffset}px;
|
|
18765
|
-
height: calc(100% - ${topOffset}px);
|
|
18767
|
+
top: ${topOffset + TOOLBAR_HEIGHT}px;
|
|
18768
|
+
height: calc(100% - ${topOffset + TOOLBAR_HEIGHT}px);
|
|
18766
18769
|
justify-content: space-between;
|
|
18767
18770
|
}
|
|
18768
18771
|
`;
|
|
@@ -18812,7 +18815,7 @@ const DrawerAccordionStyles = (props) => {
|
|
|
18812
18815
|
&[aria-expanded="true"] {
|
|
18813
18816
|
position: sticky;
|
|
18814
18817
|
border-radius: 0;
|
|
18815
|
-
top:
|
|
18818
|
+
top: ${spaces?.s}px;
|
|
18816
18819
|
z-index: 11;
|
|
18817
18820
|
backdrop-filter: blur(0px);
|
|
18818
18821
|
color: ${textOpenColor};
|
|
@@ -18997,6 +19000,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
|
|
|
18997
19000
|
return css$3 `
|
|
18998
19001
|
pointer-events: none;
|
|
18999
19002
|
top: ${topOffset}px;
|
|
19003
|
+
z-index: 2000;
|
|
19000
19004
|
|
|
19001
19005
|
.MuiDrawer-paper {
|
|
19002
19006
|
background-color: ${hasInvertedStyle
|
|
@@ -19009,7 +19013,7 @@ const StyledMegaMenuDrawer = styled$2(Drawer, {
|
|
|
19009
19013
|
box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.1);
|
|
19010
19014
|
background-image: none;
|
|
19011
19015
|
padding: ${spaces?.xl ? spaces?.xl + 48 : 48}px ${spaces?.xl}px
|
|
19012
|
-
${spaces?.
|
|
19016
|
+
${spaces?.xxxl}px;
|
|
19013
19017
|
transform: translateY(48px);
|
|
19014
19018
|
top: ${topOffset}px;
|
|
19015
19019
|
}
|
|
@@ -19035,7 +19039,7 @@ const StyledMegaMenuContent = styled$2("div", {
|
|
|
19035
19039
|
: semanticColors?.base.backgroundPrimary};
|
|
19036
19040
|
display: flex;
|
|
19037
19041
|
flex-wrap: wrap;
|
|
19038
|
-
gap: ${spaces?.
|
|
19042
|
+
gap: ${spaces?.xxxl}px;
|
|
19039
19043
|
width: 100%;
|
|
19040
19044
|
max-width: 1200px;
|
|
19041
19045
|
margin: 0 auto;
|
|
@@ -19054,7 +19058,7 @@ const StyledHoverDrawerColumn = styled$2("div", {
|
|
|
19054
19058
|
// Account for gaps between columns
|
|
19055
19059
|
const columnsPerRow = totalColumns > 4 ? 4 : totalColumns;
|
|
19056
19060
|
const gapCount = columnsPerRow - 1;
|
|
19057
|
-
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.
|
|
19061
|
+
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxxl}px)) / ${columnsPerRow})`;
|
|
19058
19062
|
return css$3 `
|
|
19059
19063
|
display: flex;
|
|
19060
19064
|
flex-direction: column;
|
|
@@ -19255,7 +19259,7 @@ const StyledHoverDrawerActions = styled$2("div", {
|
|
|
19255
19259
|
margin-top: ${spaces?.l}px;
|
|
19256
19260
|
padding-left: ${isNarrow
|
|
19257
19261
|
? `calc(${spaces?.l}px + ${spaces?.m}px)`
|
|
19258
|
-
: `calc(${spaces?.
|
|
19262
|
+
: `calc(${spaces?.xxxl}px + ${spaces?.xs}px)`};
|
|
19259
19263
|
flex-wrap: wrap;
|
|
19260
19264
|
`;
|
|
19261
19265
|
}}
|
|
@@ -20138,9 +20142,10 @@ function useNavigationState() {
|
|
|
20138
20142
|
};
|
|
20139
20143
|
}
|
|
20140
20144
|
|
|
20141
|
-
function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
|
|
20145
|
+
function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, onDrawerStyleNavItemHover, }) {
|
|
20142
20146
|
const theme = useTheme$4();
|
|
20143
20147
|
const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
|
|
20148
|
+
const [clickedDrawerKey, setClickedDrawerKey] = useState(null);
|
|
20144
20149
|
// Helper function to wrap dropdown items' onClick handlers
|
|
20145
20150
|
// This automatically sets the parent dropdown as active when an item is clicked
|
|
20146
20151
|
const wrapDropdownItemsWithActiveKey = (dropdownItems, parentKey) => {
|
|
@@ -20179,8 +20184,23 @@ function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, ite
|
|
|
20179
20184
|
const handleClick = (e) => {
|
|
20180
20185
|
onChange(key);
|
|
20181
20186
|
parentOnClick?.(e);
|
|
20187
|
+
if (drawerOpen) {
|
|
20188
|
+
setActiveDrawerKey(null);
|
|
20189
|
+
setContentKey(null);
|
|
20190
|
+
setClickedDrawerKey(key);
|
|
20191
|
+
}
|
|
20182
20192
|
};
|
|
20183
|
-
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () =>
|
|
20193
|
+
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
|
|
20194
|
+
onDrawerStyleNavItemHover?.(item);
|
|
20195
|
+
if (clickedDrawerKey !== key) {
|
|
20196
|
+
onDrawerOpen(key);
|
|
20197
|
+
}
|
|
20198
|
+
}, onMouseLeave: () => {
|
|
20199
|
+
if (clickedDrawerKey === key) {
|
|
20200
|
+
setClickedDrawerKey(null);
|
|
20201
|
+
}
|
|
20202
|
+
onDrawerClose();
|
|
20203
|
+
}, 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));
|
|
20184
20204
|
};
|
|
20185
20205
|
const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
|
|
20186
20206
|
const isDropdownOpen = open && activeDropdownKey === key;
|
|
@@ -20423,7 +20443,7 @@ const StyledTag = styled$2(Tag) `
|
|
|
20423
20443
|
margin: 0;
|
|
20424
20444
|
`;
|
|
20425
20445
|
|
|
20426
|
-
function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNarrow, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
|
|
20446
|
+
function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNarrow, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, onDrawerStyleNavItemHover, }) {
|
|
20427
20447
|
const theme = useTheme$4();
|
|
20428
20448
|
const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
|
|
20429
20449
|
function onClose() {
|
|
@@ -20447,7 +20467,10 @@ function NavigationHeaderSecondaryNav({ menuProps, items, hasInvertedStyle, isNa
|
|
|
20447
20467
|
const handleClick = (e) => {
|
|
20448
20468
|
parentOnClick?.(e);
|
|
20449
20469
|
};
|
|
20450
|
-
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () =>
|
|
20470
|
+
return (jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
|
|
20471
|
+
onDrawerStyleNavItemHover?.(item);
|
|
20472
|
+
onDrawerOpen(key);
|
|
20473
|
+
}, 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));
|
|
20451
20474
|
};
|
|
20452
20475
|
const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
|
|
20453
20476
|
const isDropdownOpen = open && activeDropdownKey === key;
|
|
@@ -20619,7 +20642,7 @@ const NavigationHeader = forwardRef((props, ref) => {
|
|
|
20619
20642
|
const { activePrimaryNavKey: controlledActivePrimaryNavKey, buttons, sdsStyle = "dropdown", menuProps = {
|
|
20620
20643
|
disableScrollLock: true,
|
|
20621
20644
|
disablePortal: true
|
|
20622
|
-
}, 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;
|
|
20645
|
+
}, 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;
|
|
20623
20646
|
const navRef = useRef(null);
|
|
20624
20647
|
const topSlotRef = useRef(null);
|
|
20625
20648
|
const [topOffset, setTopOffset] = useState(0);
|
|
@@ -20772,11 +20795,11 @@ const NavigationHeader = forwardRef((props, ref) => {
|
|
|
20772
20795
|
};
|
|
20773
20796
|
const renderPrimaryNav = () => {
|
|
20774
20797
|
return (primaryNavItems &&
|
|
20775
|
-
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) })));
|
|
20798
|
+
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 })));
|
|
20776
20799
|
};
|
|
20777
20800
|
const renderSecondaryNav = () => {
|
|
20778
20801
|
return (secondaryNavItems &&
|
|
20779
|
-
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) })));
|
|
20802
|
+
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 })));
|
|
20780
20803
|
};
|
|
20781
20804
|
const renderButtonsNode = () => {
|
|
20782
20805
|
if (!buttons || buttons.length === 0)
|
|
@@ -20856,7 +20879,7 @@ const NavigationHeader = forwardRef((props, ref) => {
|
|
|
20856
20879
|
const position = sdsStyle === "drawer" ? "sticky" : isSticky ? "sticky" : "relative";
|
|
20857
20880
|
// Disable elevation when drawer style is active and any drawer is open
|
|
20858
20881
|
const effectiveScrollElevation = scrollElevation && !(sdsStyle === "drawer" && isAnyDrawerOpen);
|
|
20859
|
-
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 && (
|
|
20882
|
+
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] }) }))] }));
|
|
20860
20883
|
});
|
|
20861
20884
|
|
|
20862
20885
|
/**
|
package/dist/tailwind.json
CHANGED
|
@@ -3134,14 +3134,15 @@
|
|
|
3134
3134
|
}
|
|
3135
3135
|
},
|
|
3136
3136
|
"spacing": {
|
|
3137
|
+
"sds-xxxs": "2px",
|
|
3138
|
+
"sds-xxs": "4px",
|
|
3139
|
+
"sds-xs": "6px",
|
|
3140
|
+
"sds-s": "8px",
|
|
3141
|
+
"sds-m": "12px",
|
|
3137
3142
|
"sds-default": "12px",
|
|
3138
3143
|
"sds-l": "16px",
|
|
3139
|
-
"sds-m": "12px",
|
|
3140
|
-
"sds-s": "8px",
|
|
3141
3144
|
"sds-xl": "24px",
|
|
3142
|
-
"sds-
|
|
3143
|
-
"sds-
|
|
3144
|
-
"sds-xxs": "4px",
|
|
3145
|
-
"sds-xxxs": "2px"
|
|
3145
|
+
"sds-xxl": "32px",
|
|
3146
|
+
"sds-xxxl": "40px"
|
|
3146
3147
|
}
|
|
3147
3148
|
}
|