@czi-sds/components 22.17.0 → 23.0.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 -6
- package/dist/index.cjs.js +62 -44
- package/dist/index.esm.d.ts +7 -6
- package/dist/index.esm.js +62 -44
- package/dist/tailwind.json +16 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/variables.css +948 -328
- package/dist/variables.scss +1744 -177
- package/package.json +3 -3
package/dist/index.cjs.d.ts
CHANGED
|
@@ -379,6 +379,7 @@ interface Spaces {
|
|
|
379
379
|
l: number;
|
|
380
380
|
xl: number;
|
|
381
381
|
xxl: number;
|
|
382
|
+
xxxl: number;
|
|
382
383
|
}
|
|
383
384
|
/**
|
|
384
385
|
* @deprecated
|
|
@@ -1087,7 +1088,7 @@ interface BannerExtraProps extends CommonThemeProps {
|
|
|
1087
1088
|
type ButtonType$0 = ButtonProps & {
|
|
1088
1089
|
bannerType: string;
|
|
1089
1090
|
} & CommonThemeProps;
|
|
1090
|
-
type BannerIntentType = "info" | "negative" | "notice" | "positive";
|
|
1091
|
+
type BannerIntentType = "accent" | "info" | "negative" | "notice" | "positive";
|
|
1091
1092
|
interface BannerProps extends BannerExtraProps {
|
|
1092
1093
|
children: React.ReactNode;
|
|
1093
1094
|
icon?: keyof IconNameToSizes | React.ReactElement<CustomSVGProps>;
|
|
@@ -1165,7 +1166,7 @@ interface ButtonToggleProps extends ButtonProps$0 {
|
|
|
1165
1166
|
declare const ButtonToggle: React.ForwardRefExoticComponent<Omit<ButtonToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1166
1167
|
declare const SDS_STAGE_OPEN = "open";
|
|
1167
1168
|
declare const SDS_STAGE_CLOSED = "closed";
|
|
1168
|
-
type CalloutIntentType = "info" | "negative" | "notice" | "positive";
|
|
1169
|
+
type CalloutIntentType = "accent" | "info" | "negative" | "notice" | "positive";
|
|
1169
1170
|
type CalloutSdsStyleType = "persistent" | "expandable" | "dismissible";
|
|
1170
1171
|
interface CalloutProps {
|
|
1171
1172
|
autoDismiss?: boolean | number;
|
|
@@ -2052,7 +2053,7 @@ interface NavigationJumpToProps extends NavigationJumpToExtraProps {
|
|
|
2052
2053
|
width?: CSSProperties["width"];
|
|
2053
2054
|
}
|
|
2054
2055
|
declare const NavigationJumpTo: React.ForwardRefExoticComponent<Omit<NavigationJumpToProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2055
|
-
type NotificationIntentType = "info" | "negative" | "positive" | "notice";
|
|
2056
|
+
type NotificationIntentType = "accent" | "info" | "negative" | "positive" | "notice";
|
|
2056
2057
|
interface NotificationProps {
|
|
2057
2058
|
autoDismiss?: boolean | number;
|
|
2058
2059
|
buttonOnClick?: (event: React.SyntheticEvent) => void;
|
|
@@ -2215,12 +2216,12 @@ interface DiscreteColorGeneratorOptions {
|
|
|
2215
2216
|
isDarkMode?: boolean;
|
|
2216
2217
|
/**
|
|
2217
2218
|
* Starting hue in degrees (0-360)
|
|
2218
|
-
* @default
|
|
2219
|
+
* @default 250
|
|
2219
2220
|
*/
|
|
2220
2221
|
start?: number;
|
|
2221
2222
|
/**
|
|
2222
2223
|
* Number of rotations around the color wheel
|
|
2223
|
-
* @default
|
|
2224
|
+
* @default 0.85
|
|
2224
2225
|
*/
|
|
2225
2226
|
rotations?: number;
|
|
2226
2227
|
/**
|
|
@@ -2230,7 +2231,7 @@ interface DiscreteColorGeneratorOptions {
|
|
|
2230
2231
|
gamma?: number;
|
|
2231
2232
|
/**
|
|
2232
2233
|
* Lightness range [min, max] (0-1)
|
|
2233
|
-
* @default [0.
|
|
2234
|
+
* @default [0.4, 0.7]
|
|
2234
2235
|
*/
|
|
2235
2236
|
lightness?: [
|
|
2236
2237
|
number,
|
package/dist/index.cjs.js
CHANGED
|
@@ -521,15 +521,16 @@ const Shadows = {
|
|
|
521
521
|
};
|
|
522
522
|
|
|
523
523
|
const Spaces = {
|
|
524
|
+
xxxs: 2,
|
|
525
|
+
xxs: 4,
|
|
526
|
+
xs: 6,
|
|
527
|
+
s: 8,
|
|
528
|
+
m: 12,
|
|
524
529
|
default: 12,
|
|
525
530
|
l: 16,
|
|
526
|
-
m: 12,
|
|
527
|
-
s: 8,
|
|
528
531
|
xl: 24,
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
xxs: 4,
|
|
532
|
-
xxxs: 2
|
|
532
|
+
xxl: 32,
|
|
533
|
+
xxxl: 40
|
|
533
534
|
};
|
|
534
535
|
|
|
535
536
|
const SDSLightThemeColors = {
|
|
@@ -579,7 +580,7 @@ const SDSLightThemeColors = {
|
|
|
579
580
|
purple: {
|
|
580
581
|
"100": "#efeafe",
|
|
581
582
|
"200": "#e4dbfc",
|
|
582
|
-
"300": "#
|
|
583
|
+
"300": "#cbbaf8",
|
|
583
584
|
"400": "#b296f2",
|
|
584
585
|
"500": "#8b54e2",
|
|
585
586
|
"600": "#6526b5",
|
|
@@ -761,7 +762,7 @@ const percentToHex = (percentOpacity) => {
|
|
|
761
762
|
// Convert percentage to 0-255 range
|
|
762
763
|
const alphaValue = Math.round((clampedPercent / 100) * 255);
|
|
763
764
|
// Convert to hex and pad with leading zero if needed
|
|
764
|
-
return alphaValue.toString(16).padStart(2, "0").
|
|
765
|
+
return alphaValue.toString(16).padStart(2, "0").toLowerCase();
|
|
765
766
|
};
|
|
766
767
|
/**
|
|
767
768
|
* Adds opacity to a hex color by appending the hex opacity value.
|
|
@@ -9866,9 +9867,9 @@ const StyledPaper = styled__default.default(material.Paper, {
|
|
|
9866
9867
|
background-color: ${semanticColors?.base?.surface};
|
|
9867
9868
|
background-image: none;
|
|
9868
9869
|
box-shadow: ${shadows?.l};
|
|
9869
|
-
max-height: calc(100vh - ${2 * (spaces?.
|
|
9870
|
+
max-height: calc(100vh - ${2 * (spaces?.xxxl || 40)}px);
|
|
9870
9871
|
border-radius: ${corners?.xl}px;
|
|
9871
|
-
padding: ${isSmall ? spaces?.xl : spaces?.
|
|
9872
|
+
padding: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
9872
9873
|
outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
|
|
9873
9874
|
`;
|
|
9874
9875
|
}}
|
|
@@ -9918,7 +9919,7 @@ const StyledButton$1 = styled__default.default(Button) `
|
|
|
9918
9919
|
const { sdsSize } = props;
|
|
9919
9920
|
const isSmall = sdsSize === "small" || sdsSize === "medium";
|
|
9920
9921
|
const spaces = getSpaces(props);
|
|
9921
|
-
const right = isSmall ? spaces?.xl : spaces?.
|
|
9922
|
+
const right = isSmall ? spaces?.xl : spaces?.xxxl;
|
|
9922
9923
|
return `
|
|
9923
9924
|
right: ${right}px;
|
|
9924
9925
|
`;
|
|
@@ -10018,7 +10019,7 @@ const StyledDialogActions = styled__default.default(material.DialogActions, {
|
|
|
10018
10019
|
return `
|
|
10019
10020
|
justify-content: ${buttonPosition === "right" ? "flex-end" : "flex-start"};;
|
|
10020
10021
|
|
|
10021
|
-
margin-top: ${isSmall ? spaces?.xl : spaces?.
|
|
10022
|
+
margin-top: ${isSmall ? spaces?.xl : spaces?.xxxl}px;
|
|
10022
10023
|
|
|
10023
10024
|
&.${material.dialogActionsClasses.spacing} > :not(:first-of-type) {
|
|
10024
10025
|
margin-left: ${spaces?.m}px;
|
|
@@ -10125,16 +10126,16 @@ const getResponsivePadding = (props) => {
|
|
|
10125
10126
|
const spaces = getSpaces(props);
|
|
10126
10127
|
const breakpoints = getBreakpoints(props);
|
|
10127
10128
|
return react.css `
|
|
10128
|
-
padding: ${spaces?.
|
|
10129
|
+
padding: ${spaces?.xxxl}px
|
|
10129
10130
|
${overlayContainerMinMargin?.small || HeroMargins.SMALL};
|
|
10130
10131
|
|
|
10131
10132
|
${breakpoints?.up("md")} {
|
|
10132
|
-
padding: ${spaces?.
|
|
10133
|
+
padding: ${spaces?.xxxl}px
|
|
10133
10134
|
${overlayContainerMinMargin?.medium || HeroMargins.MEDIUM};
|
|
10134
10135
|
}
|
|
10135
10136
|
|
|
10136
10137
|
${breakpoints?.up("lg")} {
|
|
10137
|
-
padding: ${spaces?.
|
|
10138
|
+
padding: ${spaces?.xxxl}px
|
|
10138
10139
|
${overlayContainerMinMargin?.large || HeroMargins.LARGE};
|
|
10139
10140
|
}
|
|
10140
10141
|
`;
|
|
@@ -11315,7 +11316,7 @@ const LegendContainer = styled__default.default("div") `
|
|
|
11315
11316
|
`;
|
|
11316
11317
|
const LegendItem = styled__default.default("div") `
|
|
11317
11318
|
${(props) => {
|
|
11318
|
-
const { isSelected, disabled } = props;
|
|
11319
|
+
const { isSelected, disabled, isHovered } = props;
|
|
11319
11320
|
const spaces = getSpaces(props);
|
|
11320
11321
|
const semanticColors = getSemanticColors(props);
|
|
11321
11322
|
const corners = getCorners(props);
|
|
@@ -11324,9 +11325,9 @@ const LegendItem = styled__default.default("div") `
|
|
|
11324
11325
|
align-items: center;
|
|
11325
11326
|
cursor: ${disabled ? "not-allowed" : "pointer"} !important;
|
|
11326
11327
|
transition: background-color 0.2s ease-in-out;
|
|
11327
|
-
padding:
|
|
11328
|
+
padding: ${spaces?.xxxs}px ${spaces?.xxs}px;
|
|
11328
11329
|
border-radius: ${corners?.s}px;
|
|
11329
|
-
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : "transparent"};
|
|
11330
|
+
background-color: ${isSelected ? semanticColors?.base?.backgroundTertiary : isHovered ? semanticColors?.base?.backgroundSecondary : "transparent"};
|
|
11330
11331
|
pointer-events: ${disabled ? "none" : "auto"};
|
|
11331
11332
|
|
|
11332
11333
|
&:hover {
|
|
@@ -11341,8 +11342,8 @@ const LegendIcon = styled__default.default("div") `
|
|
|
11341
11342
|
const spaces = getSpaces(props);
|
|
11342
11343
|
const corners = getCorners(props);
|
|
11343
11344
|
return `
|
|
11344
|
-
width:
|
|
11345
|
-
height:
|
|
11345
|
+
width: ${spaces?.m}px;
|
|
11346
|
+
height: ${spaces?.m}px;
|
|
11346
11347
|
border-radius: ${corners?.s}px;
|
|
11347
11348
|
background-color: ${color};
|
|
11348
11349
|
flex-shrink: 0;
|
|
@@ -11353,7 +11354,7 @@ const LegendIcon = styled__default.default("div") `
|
|
|
11353
11354
|
}}
|
|
11354
11355
|
`;
|
|
11355
11356
|
const LegendLabel = styled__default.default("span") `
|
|
11356
|
-
${
|
|
11357
|
+
${fontBodyMediumXxxs}
|
|
11357
11358
|
${(props) => {
|
|
11358
11359
|
const semanticColors = getSemanticColors(props);
|
|
11359
11360
|
return `
|
|
@@ -11362,13 +11363,13 @@ const LegendLabel = styled__default.default("span") `
|
|
|
11362
11363
|
}}
|
|
11363
11364
|
`;
|
|
11364
11365
|
const LegendValue = styled__default.default("span") `
|
|
11365
|
-
${
|
|
11366
|
+
${fontBodyMediumXxxs}
|
|
11366
11367
|
${(props) => {
|
|
11367
11368
|
const semanticColors = getSemanticColors(props);
|
|
11368
11369
|
const spaces = getSpaces(props);
|
|
11369
11370
|
return `
|
|
11370
11371
|
color: ${semanticColors?.base?.textSecondary};
|
|
11371
|
-
margin-left: ${spaces?.
|
|
11372
|
+
margin-left: ${spaces?.xxs}px;
|
|
11372
11373
|
`;
|
|
11373
11374
|
}}
|
|
11374
11375
|
`;
|
|
@@ -11425,7 +11426,7 @@ const Legend = (props) => {
|
|
|
11425
11426
|
: hasSelection && !isSelected;
|
|
11426
11427
|
// Determine color: use colors prop, then item color, then fallback to gray
|
|
11427
11428
|
const itemColor = colors?.[index] || item.color || fallbackColor;
|
|
11428
|
-
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"
|
|
11429
|
+
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"
|
|
11429
11430
|
? item.value.toLocaleString()
|
|
11430
11431
|
: item.value }))] }, `${item.name}-${index}`));
|
|
11431
11432
|
}) })));
|
|
@@ -18346,6 +18347,7 @@ function NavigationFooter({ backgroundAppearance = "matchBackground", images, lo
|
|
|
18346
18347
|
|
|
18347
18348
|
/* eslint-disable sonarjs/cognitive-complexity */
|
|
18348
18349
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
18350
|
+
const TOOLBAR_HEIGHT = 48;
|
|
18349
18351
|
const doNotForwardProps$a = [
|
|
18350
18352
|
"hasInvertedStyle",
|
|
18351
18353
|
"isNarrow",
|
|
@@ -18361,7 +18363,7 @@ const doNotForwardProps$a = [
|
|
|
18361
18363
|
const StyledTopComponentSlot = styled__default.default("div") `
|
|
18362
18364
|
position: sticky;
|
|
18363
18365
|
top: 0;
|
|
18364
|
-
z-index:
|
|
18366
|
+
z-index: 2100;
|
|
18365
18367
|
`;
|
|
18366
18368
|
const StyledAppBar = styled__default.default(material.AppBar, {
|
|
18367
18369
|
shouldForwardProp: (prop) => ![...doNotForwardProps$a, "sdsStyle"].includes(prop)
|
|
@@ -18373,7 +18375,7 @@ const StyledAppBar = styled__default.default(material.AppBar, {
|
|
|
18373
18375
|
background-image: none;
|
|
18374
18376
|
max-width: 100%;
|
|
18375
18377
|
overflow-x: auto;
|
|
18376
|
-
z-index:
|
|
18378
|
+
z-index: 2100;
|
|
18377
18379
|
`;
|
|
18378
18380
|
}}
|
|
18379
18381
|
`;
|
|
@@ -18402,8 +18404,8 @@ const StyledToolbar = styled__default.default(material.Toolbar, {
|
|
|
18402
18404
|
const spaces = getSpaces(props);
|
|
18403
18405
|
return material.css `
|
|
18404
18406
|
&.MuiToolbar-root {
|
|
18405
|
-
min-height:
|
|
18406
|
-
max-height:
|
|
18407
|
+
min-height: ${TOOLBAR_HEIGHT}px;
|
|
18408
|
+
max-height: ${TOOLBAR_HEIGHT}px;
|
|
18407
18409
|
padding: ${spaces?.s}px ${spaces?.l}px;
|
|
18408
18410
|
|
|
18409
18411
|
${isNarrow && NarrowToolbar(props)}
|
|
@@ -18566,7 +18568,7 @@ const StyledTitleContainer = styled__default.default("div", {
|
|
|
18566
18568
|
color: ${props.hasInvertedStyle
|
|
18567
18569
|
? colors?.base.textPrimaryOnDark
|
|
18568
18570
|
: colors?.base.textPrimary};
|
|
18569
|
-
margin-right: ${spaces?.
|
|
18571
|
+
margin-right: ${spaces?.xxxl}px;
|
|
18570
18572
|
width: 100%;
|
|
18571
18573
|
|
|
18572
18574
|
${isNarrow && NarrowTitleContainer()}
|
|
@@ -18608,8 +18610,8 @@ const StyledPrimaryNavContainer = styled__default.default("div", {
|
|
|
18608
18610
|
const primaryNavPositionWithoutSearch = primaryNavPosition === "left" ? "flex-start" : "flex-end";
|
|
18609
18611
|
return material.css `
|
|
18610
18612
|
flex-direction: ${isNarrow ? "column" : "row"};
|
|
18611
|
-
gap: ${spaces?.
|
|
18612
|
-
margin-right: ${spaces?.
|
|
18613
|
+
gap: ${spaces?.xxxl}px;
|
|
18614
|
+
margin-right: ${spaces?.xxxl}px;
|
|
18613
18615
|
flex: 1;
|
|
18614
18616
|
justify-content: ${showSearch
|
|
18615
18617
|
? primaryNavPositionWithSearch
|
|
@@ -18736,14 +18738,14 @@ const NarrowButtonStyles = (props) => {
|
|
|
18736
18738
|
&::before {
|
|
18737
18739
|
content: "";
|
|
18738
18740
|
position: absolute;
|
|
18739
|
-
height: ${spaces?.
|
|
18741
|
+
height: ${spaces?.xxxl}px;
|
|
18740
18742
|
width: 100%;
|
|
18741
18743
|
background: linear-gradient(
|
|
18742
18744
|
to top,
|
|
18743
18745
|
${backgroundColor} 0%,
|
|
18744
18746
|
${backgroundColor}00 100%
|
|
18745
18747
|
);
|
|
18746
|
-
top: -${spaces?.
|
|
18748
|
+
top: -${spaces?.xxxl}px;
|
|
18747
18749
|
}
|
|
18748
18750
|
|
|
18749
18751
|
.MuiButton-icon .MuiSvgIcon-root {
|
|
@@ -18764,7 +18766,7 @@ const StyledButtonSection = styled__default.default("section", {
|
|
|
18764
18766
|
const spaces = getSpaces(props);
|
|
18765
18767
|
return material.css `
|
|
18766
18768
|
gap: ${spaces?.m}px;
|
|
18767
|
-
margin-left: ${spaces?.
|
|
18769
|
+
margin-left: ${spaces?.xxxl}px;
|
|
18768
18770
|
|
|
18769
18771
|
${isNarrow && NarrowButtonStyles(props)}
|
|
18770
18772
|
`;
|
|
@@ -18784,8 +18786,8 @@ const StyledDrawer$1 = styled__default.default(material.Drawer, {
|
|
|
18784
18786
|
width: 100%;
|
|
18785
18787
|
display: flex;
|
|
18786
18788
|
flex-direction: column;
|
|
18787
|
-
top: ${topOffset}px;
|
|
18788
|
-
height: calc(100% - ${topOffset}px);
|
|
18789
|
+
top: ${topOffset + TOOLBAR_HEIGHT}px;
|
|
18790
|
+
height: calc(100% - ${topOffset + TOOLBAR_HEIGHT}px);
|
|
18789
18791
|
justify-content: space-between;
|
|
18790
18792
|
}
|
|
18791
18793
|
`;
|
|
@@ -18835,7 +18837,7 @@ const DrawerAccordionStyles = (props) => {
|
|
|
18835
18837
|
&[aria-expanded="true"] {
|
|
18836
18838
|
position: sticky;
|
|
18837
18839
|
border-radius: 0;
|
|
18838
|
-
top:
|
|
18840
|
+
top: ${spaces?.s}px;
|
|
18839
18841
|
z-index: 11;
|
|
18840
18842
|
backdrop-filter: blur(0px);
|
|
18841
18843
|
color: ${textOpenColor};
|
|
@@ -19020,6 +19022,7 @@ const StyledMegaMenuDrawer = styled__default.default(material.Drawer, {
|
|
|
19020
19022
|
return material.css `
|
|
19021
19023
|
pointer-events: none;
|
|
19022
19024
|
top: ${topOffset}px;
|
|
19025
|
+
z-index: 2000;
|
|
19023
19026
|
|
|
19024
19027
|
.MuiDrawer-paper {
|
|
19025
19028
|
background-color: ${hasInvertedStyle
|
|
@@ -19032,7 +19035,7 @@ const StyledMegaMenuDrawer = styled__default.default(material.Drawer, {
|
|
|
19032
19035
|
box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.1);
|
|
19033
19036
|
background-image: none;
|
|
19034
19037
|
padding: ${spaces?.xl ? spaces?.xl + 48 : 48}px ${spaces?.xl}px
|
|
19035
|
-
${spaces?.
|
|
19038
|
+
${spaces?.xxxl}px;
|
|
19036
19039
|
transform: translateY(48px);
|
|
19037
19040
|
top: ${topOffset}px;
|
|
19038
19041
|
}
|
|
@@ -19058,7 +19061,7 @@ const StyledMegaMenuContent = styled__default.default("div", {
|
|
|
19058
19061
|
: semanticColors?.base.backgroundPrimary};
|
|
19059
19062
|
display: flex;
|
|
19060
19063
|
flex-wrap: wrap;
|
|
19061
|
-
gap: ${spaces?.
|
|
19064
|
+
gap: ${spaces?.xxxl}px;
|
|
19062
19065
|
width: 100%;
|
|
19063
19066
|
max-width: 1200px;
|
|
19064
19067
|
margin: 0 auto;
|
|
@@ -19077,7 +19080,7 @@ const StyledHoverDrawerColumn = styled__default.default("div", {
|
|
|
19077
19080
|
// Account for gaps between columns
|
|
19078
19081
|
const columnsPerRow = totalColumns > 4 ? 4 : totalColumns;
|
|
19079
19082
|
const gapCount = columnsPerRow - 1;
|
|
19080
|
-
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.
|
|
19083
|
+
const columnWidth = `calc((100% - (${gapCount} * ${spaces?.xxxl}px)) / ${columnsPerRow})`;
|
|
19081
19084
|
return material.css `
|
|
19082
19085
|
display: flex;
|
|
19083
19086
|
flex-direction: column;
|
|
@@ -19278,7 +19281,7 @@ const StyledHoverDrawerActions = styled__default.default("div", {
|
|
|
19278
19281
|
margin-top: ${spaces?.l}px;
|
|
19279
19282
|
padding-left: ${isNarrow
|
|
19280
19283
|
? `calc(${spaces?.l}px + ${spaces?.m}px)`
|
|
19281
|
-
: `calc(${spaces?.
|
|
19284
|
+
: `calc(${spaces?.xxxl}px + ${spaces?.xs}px)`};
|
|
19282
19285
|
flex-wrap: wrap;
|
|
19283
19286
|
`;
|
|
19284
19287
|
}}
|
|
@@ -20164,6 +20167,7 @@ function useNavigationState() {
|
|
|
20164
20167
|
function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, items, onChange, value, sdsStyle = "dropdown", expandedAccordion, setExpandedAccordion, accordionRefs, scrollToAccordion, onDrawerStateChange, topOffset = 0, onClose: onCloseProp, }) {
|
|
20165
20168
|
const theme = material.useTheme();
|
|
20166
20169
|
const { anchorEl, activeDropdownKey, activeDrawerKey, contentKey, isContentFading, open, drawerOpen, buttonRef, menuWidth, setAnchorEl, setActiveDropdownKey, setActiveDrawerKey, setContentKey, onClose: handleClose, onDrawerClose, onDrawerOpen, cancelDrawerClose, } = useNavigationState();
|
|
20170
|
+
const [clickedDrawerKey, setClickedDrawerKey] = React.useState(null);
|
|
20167
20171
|
// Helper function to wrap dropdown items' onClick handlers
|
|
20168
20172
|
// This automatically sets the parent dropdown as active when an item is clicked
|
|
20169
20173
|
const wrapDropdownItemsWithActiveKey = (dropdownItems, parentKey) => {
|
|
@@ -20202,8 +20206,22 @@ function NavigationHeaderPrimaryNav({ menuProps, hasInvertedStyle, isNarrow, ite
|
|
|
20202
20206
|
const handleClick = (e) => {
|
|
20203
20207
|
onChange(key);
|
|
20204
20208
|
parentOnClick?.(e);
|
|
20209
|
+
if (drawerOpen) {
|
|
20210
|
+
setActiveDrawerKey(null);
|
|
20211
|
+
setContentKey(null);
|
|
20212
|
+
setClickedDrawerKey(key);
|
|
20213
|
+
}
|
|
20205
20214
|
};
|
|
20206
|
-
return (jsxRuntime.jsx(StyledHoverDrawerContainer, { onMouseEnter: () =>
|
|
20215
|
+
return (jsxRuntime.jsx(StyledHoverDrawerContainer, { onMouseEnter: () => {
|
|
20216
|
+
if (clickedDrawerKey !== key) {
|
|
20217
|
+
onDrawerOpen(key);
|
|
20218
|
+
}
|
|
20219
|
+
}, onMouseLeave: () => {
|
|
20220
|
+
if (clickedDrawerKey === key) {
|
|
20221
|
+
setClickedDrawerKey(null);
|
|
20222
|
+
}
|
|
20223
|
+
onDrawerClose();
|
|
20224
|
+
}, 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));
|
|
20207
20225
|
};
|
|
20208
20226
|
const renderDropdownItem = (item, key, label, parentOnClick, rest) => {
|
|
20209
20227
|
const isDropdownOpen = open && activeDropdownKey === key;
|
|
@@ -20879,7 +20897,7 @@ const NavigationHeader = React.forwardRef((props, ref) => {
|
|
|
20879
20897
|
const position = sdsStyle === "drawer" ? "sticky" : isSticky ? "sticky" : "relative";
|
|
20880
20898
|
// Disable elevation when drawer style is active and any drawer is open
|
|
20881
20899
|
const effectiveScrollElevation = scrollElevation && !(sdsStyle === "drawer" && isAnyDrawerOpen);
|
|
20882
|
-
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.
|
|
20900
|
+
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] }) }))] }));
|
|
20883
20901
|
});
|
|
20884
20902
|
|
|
20885
20903
|
/**
|
|
@@ -25795,7 +25813,7 @@ Object.assign(chroma, {
|
|
|
25795
25813
|
const generateDiscreteColors = (count, options = {}) => {
|
|
25796
25814
|
if (count === 0)
|
|
25797
25815
|
return [];
|
|
25798
|
-
const { isDarkMode = false, start =
|
|
25816
|
+
const { isDarkMode = false, start = 250, rotations = 0.85, gamma = 0.7, lightness = [0.4, 0.7], correctLightness = true, } = options;
|
|
25799
25817
|
let scale = chroma
|
|
25800
25818
|
.cubehelix()
|
|
25801
25819
|
.start(start)
|
package/dist/index.esm.d.ts
CHANGED
|
@@ -379,6 +379,7 @@ interface Spaces {
|
|
|
379
379
|
l: number;
|
|
380
380
|
xl: number;
|
|
381
381
|
xxl: number;
|
|
382
|
+
xxxl: number;
|
|
382
383
|
}
|
|
383
384
|
/**
|
|
384
385
|
* @deprecated
|
|
@@ -1087,7 +1088,7 @@ interface BannerExtraProps extends CommonThemeProps {
|
|
|
1087
1088
|
type ButtonType$0 = ButtonProps & {
|
|
1088
1089
|
bannerType: string;
|
|
1089
1090
|
} & CommonThemeProps;
|
|
1090
|
-
type BannerIntentType = "info" | "negative" | "notice" | "positive";
|
|
1091
|
+
type BannerIntentType = "accent" | "info" | "negative" | "notice" | "positive";
|
|
1091
1092
|
interface BannerProps extends BannerExtraProps {
|
|
1092
1093
|
children: React.ReactNode;
|
|
1093
1094
|
icon?: keyof IconNameToSizes | React.ReactElement<CustomSVGProps>;
|
|
@@ -1165,7 +1166,7 @@ interface ButtonToggleProps extends ButtonProps$0 {
|
|
|
1165
1166
|
declare const ButtonToggle: React.ForwardRefExoticComponent<Omit<ButtonToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1166
1167
|
declare const SDS_STAGE_OPEN = "open";
|
|
1167
1168
|
declare const SDS_STAGE_CLOSED = "closed";
|
|
1168
|
-
type CalloutIntentType = "info" | "negative" | "notice" | "positive";
|
|
1169
|
+
type CalloutIntentType = "accent" | "info" | "negative" | "notice" | "positive";
|
|
1169
1170
|
type CalloutSdsStyleType = "persistent" | "expandable" | "dismissible";
|
|
1170
1171
|
interface CalloutProps {
|
|
1171
1172
|
autoDismiss?: boolean | number;
|
|
@@ -2052,7 +2053,7 @@ interface NavigationJumpToProps extends NavigationJumpToExtraProps {
|
|
|
2052
2053
|
width?: CSSProperties["width"];
|
|
2053
2054
|
}
|
|
2054
2055
|
declare const NavigationJumpTo: React.ForwardRefExoticComponent<Omit<NavigationJumpToProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2055
|
-
type NotificationIntentType = "info" | "negative" | "positive" | "notice";
|
|
2056
|
+
type NotificationIntentType = "accent" | "info" | "negative" | "positive" | "notice";
|
|
2056
2057
|
interface NotificationProps {
|
|
2057
2058
|
autoDismiss?: boolean | number;
|
|
2058
2059
|
buttonOnClick?: (event: React.SyntheticEvent) => void;
|
|
@@ -2215,12 +2216,12 @@ interface DiscreteColorGeneratorOptions {
|
|
|
2215
2216
|
isDarkMode?: boolean;
|
|
2216
2217
|
/**
|
|
2217
2218
|
* Starting hue in degrees (0-360)
|
|
2218
|
-
* @default
|
|
2219
|
+
* @default 250
|
|
2219
2220
|
*/
|
|
2220
2221
|
start?: number;
|
|
2221
2222
|
/**
|
|
2222
2223
|
* Number of rotations around the color wheel
|
|
2223
|
-
* @default
|
|
2224
|
+
* @default 0.85
|
|
2224
2225
|
*/
|
|
2225
2226
|
rotations?: number;
|
|
2226
2227
|
/**
|
|
@@ -2230,7 +2231,7 @@ interface DiscreteColorGeneratorOptions {
|
|
|
2230
2231
|
gamma?: number;
|
|
2231
2232
|
/**
|
|
2232
2233
|
* Lightness range [min, max] (0-1)
|
|
2233
|
-
* @default [0.
|
|
2234
|
+
* @default [0.4, 0.7]
|
|
2234
2235
|
*/
|
|
2235
2236
|
lightness?: [
|
|
2236
2237
|
number,
|