@czi-sds/components 23.4.0 → 23.6.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.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
- import React__default, { forwardRef, Children, isValidElement, useEffect, useRef, useState, useCallback, createElement, cloneElement, useMemo, createContext, Fragment as Fragment$1, useContext, memo } from 'react';
4
+ import React__default, { forwardRef, Children, isValidElement, useEffect, useRef, useState, useCallback, createElement, cloneElement, useMemo, createContext, useImperativeHandle, Fragment as Fragment$1, useContext, memo } from 'react';
5
5
  import { css as css$1 } from '@emotion/react';
6
- import { createTheme, AccordionDetails as AccordionDetails$1, accordionSummaryClasses, AccordionSummary, SvgIcon, accordionClasses, accordionDetailsClasses, Accordion as Accordion$1, Alert as Alert$2, Button as Button$1, buttonClasses, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, TextField, InputAdornment, menuItemClasses, MenuItem as MenuItem$1, autocompleteClasses, Autocomplete as Autocomplete$1, Paper, useTheme, Popper, styled as styled$1, ClickAwayListener, ButtonGroup as ButtonGroup$1, buttonGroupClasses, IconButton, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, menuClasses, Menu as Menu$1, checkboxClasses, Checkbox, FormControlLabel, Link as Link$1, Chip as Chip$1, alpha, darken as darken$1, Card, CardContent, CardActions, css as css$3, CardMedia, DialogTitle as DialogTitle$1, Typography, dialogActionsClasses, DialogActions as DialogActions$1, Dialog as Dialog$1, DialogContent, radioClasses, Radio, Slider, sliderClasses, Switch, switchClasses, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Divider, useMediaQuery, AppBar, Toolbar, Drawer, useScrollTrigger, tabsClasses, Tabs as Tabs$1, Tab as Tab$1, Slide, Box, drawerClasses, toggleButtonClasses, ToggleButtonGroup, ToggleButton, TableContainer, TableCell, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
6
+ import { createTheme, AccordionDetails as AccordionDetails$1, accordionSummaryClasses, AccordionSummary, SvgIcon, accordionClasses, accordionDetailsClasses, Accordion as Accordion$1, Alert as Alert$2, Button as Button$1, buttonClasses, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, TextField, InputAdornment, menuItemClasses, MenuItem as MenuItem$1, autocompleteClasses, Autocomplete as Autocomplete$1, Paper, useTheme, Popper, styled as styled$1, ClickAwayListener, ButtonGroup as ButtonGroup$1, buttonGroupClasses, IconButton, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, menuClasses, Menu as Menu$1, checkboxClasses, Checkbox, FormControlLabel, Link as Link$1, Chip as Chip$1, alpha, darken as darken$1, Card, CardContent, CardActions, css as css$3, CardMedia, DialogTitle as DialogTitle$1, Typography, dialogActionsClasses, DialogActions as DialogActions$1, Dialog as Dialog$1, DialogContent, radioClasses, Radio, Slider, sliderClasses, Switch, switchClasses, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Divider, useMediaQuery, AppBar, Toolbar, Drawer, useScrollTrigger, tabsClasses, Tabs as Tabs$1, Tab as Tab$1, Slide, Box, drawerClasses, popoverClasses, Popover as Popover$1, toggleButtonClasses, ToggleButtonGroup, ToggleButton, TableContainer, TableCell, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
7
7
  export { CardMedia as ContentCardMedia } from '@mui/material';
8
8
  import styled from '@emotion/styled';
9
9
  import { Remove, Clear } from '@mui/icons-material';
@@ -421,12 +421,12 @@ const createAppThemeBorders = (colors, isDarkMode) => {
421
421
  default: createBorder("indigo", isDarkMode ? 600 : 500, "solid", "default"),
422
422
  focused: createBorder("indigo", isDarkMode ? 600 : 500, "solid", "default"),
423
423
  hover: createBorder("indigo", isDarkMode ? 700 : 600, "solid", "default"),
424
- open: createBorder("indigo", isDarkMode ? 600 : 500, "solid", "default"),
424
+ open: createBorder("indigo", isDarkMode ? 800 : 700, "solid", "default"),
425
425
  pressed: createBorder("indigo", isDarkMode ? 800 : 700, "solid", "default"),
426
- selected: createBorder("indigo", isDarkMode ? 600 : 500, "solid", "default")
426
+ selected: createBorder("indigo", isDarkMode ? 800 : 700, "solid", "default")
427
427
  },
428
428
  base: {
429
- default: createBorder("gray", 500, "solid", "default"),
429
+ default: createBorder("gray", 600, "solid", "default"),
430
430
  disabled: createBorder("gray", 300, "solid", "default"),
431
431
  divider: createBorder("gray", 200, "solid", "default"),
432
432
  dividerOnDark: createBorder("gray", isDarkMode ? 200 : 700, "solid", "default"),
@@ -456,9 +456,9 @@ const createAppThemeBorders = (colors, isDarkMode) => {
456
456
  thick: createBorder("red", 600, "solid", "thick")
457
457
  },
458
458
  neutral: {
459
- default: createBorder("gray", 500, "solid", "default"),
460
- extraThick: createBorder("gray", 500, "solid", "extraThick"),
461
- thick: createBorder("gray", 500, "solid", "thick")
459
+ default: createBorder("gray", 700, "solid", "default"),
460
+ extraThick: createBorder("gray", 700, "solid", "extraThick"),
461
+ thick: createBorder("gray", 700, "solid", "thick")
462
462
  },
463
463
  none: "none",
464
464
  notice: {
@@ -6450,7 +6450,7 @@ const useDetectUserTabbing = (ref) => {
6450
6450
  * @see https://mui.com/material-ui/react-text-field/
6451
6451
  */
6452
6452
  const InputSearch = forwardRef(function InputSearch(props, ref) {
6453
- const { label, id, placeholder, sdsStyle = "square", intent = "default", handleSubmit, onChange, disabled, classes = EMPTY_OBJECT, className, ...rest } = props;
6453
+ const { label, id, placeholder, sdsStyle = "square", intent = "default", handleSubmit, onChange, disabled, classes = EMPTY_OBJECT, className, value: propValue, ...rest } = props;
6454
6454
  const { root: rootClassName, label: labelClassName, input: inputClassName, endAdornment: endAdornmentClassName, startAdornment: startAdornmentClassName, clearButton: clearButtonClassName, searchButton: searchButtonClassName, } = classes;
6455
6455
  /**
6456
6456
  * (masoudmanson): In case that the ref is not provided, we will create a new one.
@@ -6465,14 +6465,20 @@ const InputSearch = forwardRef(function InputSearch(props, ref) {
6465
6465
  * user is tabbing, we can apply different styles for :focus and :focus-visible states.
6466
6466
  */
6467
6467
  useDetectUserTabbing((ref ? ref : inputRef));
6468
- const [value, setValue] = useState("");
6468
+ const [internalValue, setInternalValue] = useState("");
6469
+ const isControlled = propValue !== undefined;
6470
+ const value = isControlled ? String(propValue ?? "") : internalValue;
6469
6471
  const handleChange = (event) => {
6470
- setValue(event.target.value);
6472
+ if (!isControlled) {
6473
+ setInternalValue(event.target.value);
6474
+ }
6471
6475
  if (onChange)
6472
6476
  onChange(event);
6473
6477
  };
6474
6478
  const clearInput = () => {
6475
- setValue("");
6479
+ if (!isControlled) {
6480
+ setInternalValue("");
6481
+ }
6476
6482
  if (handleSubmit)
6477
6483
  handleSubmit("");
6478
6484
  /**
@@ -7373,6 +7379,9 @@ var SDSWarningTypes;
7373
7379
  SDSWarningTypes["TooltipInvertStyle"] = "tooltipInvertStyle";
7374
7380
  SDSWarningTypes["ContentCardActionsOnlyButtons"] = "contentCardActionsOnlyButtons";
7375
7381
  SDSWarningTypes["ClickableContentCardNumberOfButtons"] = "clickableContentCardNumberOfButtons";
7382
+ SDSWarningTypes["SegmentedControlTooltipTextDeprecated"] = "segmentedControlTooltipTextDeprecated";
7383
+ SDSWarningTypes["SegmentedControlMissingIconOrLabel"] = "segmentedControlMissingIconOrLabel";
7384
+ SDSWarningTypes["SegmentedControlIconAndLabelConflict"] = "segmentedControlIconAndLabelConflict";
7376
7385
  })(SDSWarningTypes || (SDSWarningTypes = {}));
7377
7386
  const SDS_WARNINGS = {
7378
7387
  [SDSWarningTypes.ButtonMinimalIsAllCaps]: {
@@ -7430,6 +7439,21 @@ const SDS_WARNINGS = {
7430
7439
  [SDSWarningTypes.ClickableContentCardNumberOfButtons]: {
7431
7440
  hasWarned: false,
7432
7441
  message: "Warning: Clickable Content Cards can only have one or no buttons!"
7442
+ },
7443
+ [SDSWarningTypes.SegmentedControlTooltipTextDeprecated]: {
7444
+ hasWarned: false,
7445
+ message: 'Warning: "tooltipText" in SegmentedControl buttonDefinition is deprecated. ' +
7446
+ 'Please use "tooltipProps" instead. Example: { tooltipProps: { title: "My tooltip" } }'
7447
+ },
7448
+ [SDSWarningTypes.SegmentedControlMissingIconOrLabel]: {
7449
+ hasWarned: false,
7450
+ message: 'Warning: Each SegmentedControl button must have either an "icon" or a "label" prop. ' +
7451
+ "A button was found with neither."
7452
+ },
7453
+ [SDSWarningTypes.SegmentedControlIconAndLabelConflict]: {
7454
+ hasWarned: false,
7455
+ message: 'Warning: Each SegmentedControl button should have either an "icon" or a "label", ' +
7456
+ "not both. Please use only one per button."
7433
7457
  }
7434
7458
  };
7435
7459
  const showWarningIfFirstOccurence = (warningType) => {
@@ -7477,6 +7501,10 @@ const GeneralButtonGroupStyles = (props) => {
7477
7501
  min-width: fit-content;
7478
7502
  z-index: 1;
7479
7503
 
7504
+ &::before {
7505
+ border-radius: inherit;
7506
+ }
7507
+
7480
7508
  &:hover,
7481
7509
  &:active,
7482
7510
  &:focus {
@@ -7583,10 +7611,11 @@ const LargeButtonGroupStyles = (props) => {
7583
7611
  }
7584
7612
  }
7585
7613
 
7586
- /* Icon-only buttons: has svg but no startIcon/endIcon slots */
7614
+ /* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
7587
7615
  .${buttonGroupClasses.grouped}:has(svg):not(
7588
7616
  :has(.${buttonClasses.startIcon})
7589
- ):not(:has(.${buttonClasses.endIcon})) {
7617
+ ):not(:has(.${buttonClasses.endIcon})),
7618
+ .${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
7590
7619
  padding: ${iconOnlyPaddingWide};
7591
7620
 
7592
7621
  ${theme?.breakpoints?.down("md")} {
@@ -7594,8 +7623,10 @@ const LargeButtonGroupStyles = (props) => {
7594
7623
  }
7595
7624
  }
7596
7625
 
7597
- /* Text + icon buttons: has startIcon or endIcon */
7598
- .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}),
7626
+ /* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
7627
+ .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
7628
+ :has(> .${buttonClasses.startIcon}:only-child)
7629
+ ),
7599
7630
  .${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
7600
7631
  ${theme?.breakpoints?.down("md")} {
7601
7632
  padding: 0 14px;
@@ -7661,10 +7692,11 @@ const MediumButtonGroupStyles = (props) => {
7661
7692
  }
7662
7693
  }
7663
7694
 
7664
- /* Icon-only buttons: has svg but no startIcon/endIcon slots */
7695
+ /* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
7665
7696
  .${buttonGroupClasses.grouped}:has(svg):not(
7666
7697
  :has(.${buttonClasses.startIcon})
7667
- ):not(:has(.${buttonClasses.endIcon})) {
7698
+ ):not(:has(.${buttonClasses.endIcon})),
7699
+ .${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
7668
7700
  padding: ${iconOnlyPaddingWide};
7669
7701
 
7670
7702
  ${theme?.breakpoints?.down("md")} {
@@ -7672,8 +7704,10 @@ const MediumButtonGroupStyles = (props) => {
7672
7704
  }
7673
7705
  }
7674
7706
 
7675
- /* Text + icon buttons: has startIcon or endIcon - ensure spaceS (8px) padding on wide screen */
7676
- .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}),
7707
+ /* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
7708
+ .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
7709
+ :has(> .${buttonClasses.startIcon}:only-child)
7710
+ ),
7677
7711
  .${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
7678
7712
  padding: 0 10px;
7679
7713
  }
@@ -7737,10 +7771,11 @@ const SmallButtonGroupStyles = (props) => {
7737
7771
  }
7738
7772
  }
7739
7773
 
7740
- /* Icon-only buttons: has svg but no startIcon/endIcon slots */
7774
+ /* Icon-only buttons: has svg but no startIcon/endIcon slots, or startIcon is the only child (e.g. ButtonToggle) */
7741
7775
  .${buttonGroupClasses.grouped}:has(svg):not(
7742
7776
  :has(.${buttonClasses.startIcon})
7743
- ):not(:has(.${buttonClasses.endIcon})) {
7777
+ ):not(:has(.${buttonClasses.endIcon})),
7778
+ .${buttonGroupClasses.grouped}:has(> .${buttonClasses.startIcon}:only-child) {
7744
7779
  padding: ${iconOnlyPaddingWide};
7745
7780
 
7746
7781
  ${theme?.breakpoints?.down("md")} {
@@ -7748,8 +7783,10 @@ const SmallButtonGroupStyles = (props) => {
7748
7783
  }
7749
7784
  }
7750
7785
 
7751
- /* Text + icon buttons: has startIcon or endIcon - ensure spaceS (8px) padding on wide screen */
7752
- .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}),
7786
+ /* Text + icon buttons: has startIcon or endIcon (excluding icon-only ButtonToggle) */
7787
+ .${buttonGroupClasses.grouped}:has(.${buttonClasses.startIcon}):not(
7788
+ :has(> .${buttonClasses.startIcon}:only-child)
7789
+ ),
7753
7790
  .${buttonGroupClasses.grouped}:has(.${buttonClasses.endIcon}) {
7754
7791
  padding: 0 ${spaces?.s}px;
7755
7792
  }
@@ -7798,6 +7835,7 @@ const PrimaryButtonGroupStyles = (props) => {
7798
7835
  && .${buttonGroupClasses.grouped} {
7799
7836
  background-color: transparent;
7800
7837
  border: 1px solid ${defaultColor};
7838
+ box-shadow: none;
7801
7839
  color: ${defaultColor};
7802
7840
 
7803
7841
  svg {
@@ -7809,6 +7847,7 @@ const PrimaryButtonGroupStyles = (props) => {
7809
7847
  color: ${hoverColor};
7810
7848
  background-color: ${hoverBgColor};
7811
7849
  border: 1px solid ${hoverColor};
7850
+ box-shadow: none;
7812
7851
 
7813
7852
  svg {
7814
7853
  color: ${hoverColor};
@@ -7819,6 +7858,7 @@ const PrimaryButtonGroupStyles = (props) => {
7819
7858
  color: ${pressedColor};
7820
7859
  background-color: ${hoverBgColor};
7821
7860
  border: 1px solid ${pressedColor};
7861
+ box-shadow: none;
7822
7862
 
7823
7863
  svg {
7824
7864
  color: ${pressedColor};
@@ -7833,6 +7873,7 @@ const PrimaryButtonGroupStyles = (props) => {
7833
7873
  color: ${textDisabledColor};
7834
7874
  background-color: transparent;
7835
7875
  border: 1px solid ${disabledColor};
7876
+ box-shadow: none;
7836
7877
 
7837
7878
  svg {
7838
7879
  color: ${ornamentDisabledColor};
@@ -7886,6 +7927,7 @@ const SecondaryButtonGroupStyles = (props) => {
7886
7927
  && .${buttonGroupClasses.grouped} {
7887
7928
  background-color: transparent;
7888
7929
  border: 1px solid ${defaultColor};
7930
+ box-shadow: none;
7889
7931
  color: ${textColor};
7890
7932
 
7891
7933
  svg {
@@ -7897,6 +7939,7 @@ const SecondaryButtonGroupStyles = (props) => {
7897
7939
  color: ${textColor};
7898
7940
  background-color: ${hoverBgColor};
7899
7941
  border: 1px solid ${defaultColor};
7942
+ box-shadow: none;
7900
7943
 
7901
7944
  svg {
7902
7945
  color: ${ornamentColor};
@@ -7907,6 +7950,7 @@ const SecondaryButtonGroupStyles = (props) => {
7907
7950
  color: ${textColor};
7908
7951
  background-color: ${pressedBgColor};
7909
7952
  border: 1px solid ${defaultColor};
7953
+ box-shadow: none;
7910
7954
 
7911
7955
  svg {
7912
7956
  color: ${ornamentColor};
@@ -7921,6 +7965,7 @@ const SecondaryButtonGroupStyles = (props) => {
7921
7965
  color: ${textDisabledColor};
7922
7966
  background-color: transparent;
7923
7967
  border: 1px solid ${disabledColor};
7968
+ box-shadow: none;
7924
7969
 
7925
7970
  svg {
7926
7971
  color: ${ornamentDisabledColor};
@@ -8259,29 +8304,44 @@ const StageOnStyles = (props) => {
8259
8304
  // So we need to apply the "on" state background to ::before as well
8260
8305
  const isSecondary = sdsType === "secondary";
8261
8306
  if (isSecondary) {
8307
+ /**
8308
+ * Specificity boost via Emotion's `&&&&` technique.
8309
+ *
8310
+ * Each `&` repeats the component's generated class, producing a selector
8311
+ * like `.css-abc123.css-abc123.css-abc123.css-abc123` — specificity (0,4,0).
8312
+ *
8313
+ * This is needed because ButtonGroup styles its children with
8314
+ * `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
8315
+ * Without the boost, the sdsStage="on" styles would always lose
8316
+ * the cascade to the ButtonGroup's parent-level overrides.
8317
+ */
8262
8318
  return css$1 `
8263
- color: ${contentColor};
8319
+ &&&& {
8320
+ color: ${contentColor};
8264
8321
 
8265
- svg {
8266
- color: ${ornamentColor};
8267
- }
8322
+ svg {
8323
+ color: ${ornamentColor};
8324
+ }
8268
8325
 
8269
- /* Apply "on" state background via ::before to match Button's hover pattern */
8270
- &::before {
8271
- background-color: ${sdsStyle === "minimal" && !backgroundOnHover
8326
+ /* Apply "on" state background via ::before to match Button's hover pattern */
8327
+ &::before {
8328
+ background-color: ${sdsStyle === "minimal" && !backgroundOnHover
8272
8329
  ? "transparent"
8273
8330
  : backgroundColor};
8331
+ }
8274
8332
  }
8275
8333
  `;
8276
8334
  }
8277
8335
  return css$1 `
8278
- background-color: ${sdsStyle === "minimal" && !backgroundOnHover
8336
+ &&&& {
8337
+ background-color: ${sdsStyle === "minimal" && !backgroundOnHover
8279
8338
  ? "transparent"
8280
8339
  : backgroundColor};
8281
- color: ${contentColor};
8340
+ color: ${contentColor};
8282
8341
 
8283
- svg {
8284
- color: ${ornamentColor};
8342
+ svg {
8343
+ color: ${ornamentColor};
8344
+ }
8285
8345
  }
8286
8346
  `;
8287
8347
  };
@@ -9302,18 +9362,31 @@ const TableRow = forwardRef((props, ref) => {
9302
9362
 
9303
9363
  const StyledTableHeader$1 = styled("thead") `
9304
9364
  ${(props) => {
9365
+ const { hasFilterRow } = props;
9305
9366
  const semanticColors = getSemanticColors(props);
9306
9367
  return `
9307
9368
  border-bottom: solid 2px ${semanticColors?.base?.borderSecondary};
9308
9369
  margin: 0;
9309
9370
  padding: 0;
9371
+
9372
+ ${hasFilterRow
9373
+ ? `
9374
+ > tr:first-of-type {
9375
+ border-bottom: none;
9376
+
9377
+ :after {
9378
+ display: none !important;
9379
+ }
9380
+ }
9381
+ `
9382
+ : ""}
9310
9383
  `;
9311
9384
  }}
9312
9385
  `;
9313
9386
 
9314
9387
  const TableHeader = forwardRef((props, ref) => {
9315
- const { children } = props;
9316
- return (jsx(StyledTableHeader$1, __assign({ ref: ref }, props, { children: jsx(TableRow, { hover: false, shouldShowTooltipOnHover: false, children: children }) })));
9388
+ const { children, filterRow } = props;
9389
+ return (jsxs(StyledTableHeader$1, __assign({ ref: ref, hasFilterRow: !!filterRow }, props, { children: [jsx(TableRow, { hover: false, shouldShowTooltipOnHover: false, children: children }), filterRow] })));
9317
9390
  });
9318
9391
 
9319
9392
  const contentPositionMapping = {
@@ -9357,7 +9430,6 @@ const ShouldTruncate$1 = () => {
9357
9430
  };
9358
9431
  const StyledTableHeader = styled.div `
9359
9432
  ${fontHeaderS}
9360
- ${focusVisibleA11yStyle}
9361
9433
 
9362
9434
  ${(props) => {
9363
9435
  const { active = false, horizontalAlign = "left", hover = true } = props;
@@ -9370,6 +9442,7 @@ const StyledTableHeader = styled.div `
9370
9442
  ? semanticColors?.accent?.foregroundInteraction
9371
9443
  : semanticColors?.base?.textPrimary;
9372
9444
  return `
9445
+ outline: none;
9373
9446
  color: ${defaultColor};
9374
9447
  padding: ${spaces?.m}px !important;
9375
9448
  text-align: ${horizontalAlign};
@@ -9940,12 +10013,12 @@ const InputCheckbox = (props) => {
9940
10013
 
9941
10014
  const StyledCellComponentData = styled.div `
9942
10015
  ${fontBodyS$1}
9943
- ${focusVisibleA11yStyle}
9944
10016
 
9945
10017
  ${(props) => {
9946
10018
  const spaces = getSpaces(props);
9947
10019
  const { horizontalAlign = "left", verticalAlign = "top" } = props;
9948
10020
  return `
10021
+ outline: none;
9949
10022
  align-items: center;
9950
10023
  text-align: ${horizontalAlign};
9951
10024
  vertical-align: ${verticalAlign};
@@ -10057,6 +10130,104 @@ const StyledTableWrapper = styled.div `
10057
10130
  }
10058
10131
  }
10059
10132
  }
10133
+
10134
+ td,
10135
+ th {
10136
+ --pinned-gradient-base: transparent;
10137
+ --pinned-gradient-bg: ${semanticColors?.base?.backgroundPrimary};
10138
+ --pinned-gradient-overlay: transparent;
10139
+ }
10140
+
10141
+ tbody tr:hover td,
10142
+ tbody tr:hover th {
10143
+ --pinned-gradient-overlay: ${semanticColors?.base
10144
+ ?.fillPrimaryInteraction};
10145
+ }
10146
+
10147
+ tbody tr[aria-selected="true"] td,
10148
+ tbody tr[aria-selected="true"] th {
10149
+ --pinned-gradient-bg: ${semanticColors?.accent?.surfaceSecondary};
10150
+ }
10151
+
10152
+ ${sdsStyle === "striped" &&
10153
+ `
10154
+ tbody tr:nth-of-type(odd) td,
10155
+ tbody tr:nth-of-type(odd) th {
10156
+ --pinned-gradient-base: ${semanticColors?.base?.backgroundPrimary};
10157
+ --pinned-gradient-bg: ${semanticColors?.base?.backgroundSecondary};
10158
+ }
10159
+
10160
+ tbody tr:nth-of-type(odd):hover td,
10161
+ tbody tr:nth-of-type(odd):hover th {
10162
+ --pinned-gradient-base: transparent;
10163
+ --pinned-gradient-bg: ${semanticColors?.base?.backgroundPrimary};
10164
+ }
10165
+
10166
+ tbody tr[aria-selected="true"]:nth-of-type(odd) td,
10167
+ tbody tr[aria-selected="true"]:nth-of-type(odd) th {
10168
+ --pinned-gradient-base: transparent;
10169
+ --pinned-gradient-bg: ${semanticColors?.accent?.surfaceSecondary};
10170
+ }
10171
+
10172
+ tbody tr[aria-selected="true"]:nth-of-type(odd):hover td,
10173
+ tbody tr[aria-selected="true"]:nth-of-type(odd):hover th {
10174
+ --pinned-gradient-base: transparent;
10175
+ --pinned-gradient-bg: ${semanticColors?.accent?.surfaceSecondary};
10176
+ }
10177
+ `}
10178
+
10179
+ [data-pinned-edge]::after {
10180
+ content: "";
10181
+ position: absolute;
10182
+ top: 0;
10183
+ bottom: 0;
10184
+ width: 24px;
10185
+ pointer-events: none;
10186
+ opacity: 0;
10187
+ transition: opacity 0.3s ease;
10188
+ }
10189
+
10190
+ [data-pinned-edge="left"]::after {
10191
+ right: 0;
10192
+ transform: translateX(100%);
10193
+ background:
10194
+ linear-gradient(
10195
+ var(--pinned-gradient-overlay),
10196
+ var(--pinned-gradient-overlay)
10197
+ ),
10198
+ linear-gradient(var(--pinned-gradient-bg), var(--pinned-gradient-bg)),
10199
+ linear-gradient(
10200
+ var(--pinned-gradient-base),
10201
+ var(--pinned-gradient-base)
10202
+ );
10203
+ -webkit-mask-image: linear-gradient(to right, black, transparent);
10204
+ mask-image: linear-gradient(to right, black, transparent);
10205
+ }
10206
+
10207
+ [data-pinned-edge="right"]::after {
10208
+ left: 0;
10209
+ transform: translateX(-100%);
10210
+ background:
10211
+ linear-gradient(
10212
+ var(--pinned-gradient-overlay),
10213
+ var(--pinned-gradient-overlay)
10214
+ ),
10215
+ linear-gradient(var(--pinned-gradient-bg), var(--pinned-gradient-bg)),
10216
+ linear-gradient(
10217
+ var(--pinned-gradient-base),
10218
+ var(--pinned-gradient-base)
10219
+ );
10220
+ -webkit-mask-image: linear-gradient(to left, black, transparent);
10221
+ mask-image: linear-gradient(to left, black, transparent);
10222
+ }
10223
+
10224
+ &[data-scrolled-left="true"] [data-pinned-edge="left"]::after {
10225
+ opacity: 1;
10226
+ }
10227
+
10228
+ &[data-scrolled-right="true"] [data-pinned-edge="right"]::after {
10229
+ opacity: 1;
10230
+ }
10060
10231
  `;
10061
10232
  }}
10062
10233
  `;
@@ -10108,6 +10279,38 @@ const StyledPaginationWrapper = styled.div `
10108
10279
  const StyledSelectionCell = styled(CellComponent) `
10109
10280
  line-height: 22px !important;
10110
10281
  `;
10282
+ const StyledFilterRow = styled("tr") `
10283
+ ${(props) => {
10284
+ const semanticColors = getSemanticColors(props);
10285
+ return `
10286
+ background-color: ${semanticColors?.base?.backgroundPrimary};
10287
+ border: none;
10288
+ box-shadow: none;
10289
+
10290
+ td, th {
10291
+ background-color: ${semanticColors?.base?.backgroundPrimary};
10292
+ }
10293
+
10294
+ &:after {
10295
+ display: none !important;
10296
+ }
10297
+
10298
+ &:hover {
10299
+ background-color: ${semanticColors?.base?.backgroundPrimary};
10300
+ }
10301
+ `;
10302
+ }}
10303
+ `;
10304
+ const StyledFilterCell = styled("th") `
10305
+ ${(props) => {
10306
+ const spaces = getSpaces(props);
10307
+ return `
10308
+ padding: 0 ${spaces?.s}px ${spaces?.s}px;
10309
+ vertical-align: middle;
10310
+ width: 100%;
10311
+ `;
10312
+ }}
10313
+ `;
10111
10314
 
10112
10315
  const SELECT_COLUMN_ID = "SdsTableSelectColumn";
10113
10316
  function getSize(size = 100, max = Number.MAX_SAFE_INTEGER, min = 40) {
@@ -10203,11 +10406,78 @@ const getCommonPinningStyles = (column, table) => {
10203
10406
  };
10204
10407
  };
10205
10408
 
10409
+ /**
10410
+ * Manages gradient vignettes on the inner edges of pinned columns.
10411
+ *
10412
+ * Identifies which columns sit at the boundary of left/right pinned groups
10413
+ * and toggles scroll-aware data attributes on the wrapper so the CSS
10414
+ * gradients in StyledTableWrapper only appear while content scrolls
10415
+ * underneath the pinned columns.
10416
+ */
10417
+ function usePinnedColumnGradient(table, columns) {
10418
+ const tableWrapperRef = useRef(null);
10419
+ const { lastLeftPinnedColumnId, firstRightPinnedColumnId } = useMemo(() => {
10420
+ const allCols = table.getAllColumns();
10421
+ const leftPinned = allCols.filter((col) => col.columnDef.meta?.pinning === "left");
10422
+ const rightPinned = allCols.filter((col) => col.columnDef.meta?.pinning === "right");
10423
+ return {
10424
+ firstRightPinnedColumnId: rightPinned.length > 0 ? rightPinned[0].id : null,
10425
+ lastLeftPinnedColumnId: leftPinned.length > 0 ? leftPinned[leftPinned.length - 1].id : null
10426
+ };
10427
+ // (masoudmanson): `columns` is included as a dependency even though only
10428
+ // `table.getAllColumns()`is called inside the callback. The TanStack
10429
+ // Table `table` object can be a stable reference that doesn't change
10430
+ // identity when column definitions change, so `columns` acts as a
10431
+ // reactivity signal to ensure this memo recomputes.
10432
+ //
10433
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10434
+ }, [table, columns]);
10435
+ const getPinnedEdge = useCallback((columnId) => {
10436
+ if (columnId === lastLeftPinnedColumnId)
10437
+ return "left";
10438
+ if (columnId === firstRightPinnedColumnId)
10439
+ return "right";
10440
+ return undefined;
10441
+ }, [lastLeftPinnedColumnId, firstRightPinnedColumnId]);
10442
+ useEffect(() => {
10443
+ const wrapper = tableWrapperRef.current;
10444
+ if (!wrapper)
10445
+ return;
10446
+ if (!lastLeftPinnedColumnId && !firstRightPinnedColumnId)
10447
+ return;
10448
+ const updateScrollState = () => {
10449
+ const { scrollLeft, scrollWidth, clientWidth } = wrapper;
10450
+ const hasHorizontalScroll = scrollWidth > clientWidth;
10451
+ if (scrollLeft > 0) {
10452
+ wrapper.setAttribute("data-scrolled-left", "true");
10453
+ }
10454
+ else {
10455
+ wrapper.removeAttribute("data-scrolled-left");
10456
+ }
10457
+ if (hasHorizontalScroll && scrollLeft < scrollWidth - clientWidth - 1) {
10458
+ wrapper.setAttribute("data-scrolled-right", "true");
10459
+ }
10460
+ else {
10461
+ wrapper.removeAttribute("data-scrolled-right");
10462
+ }
10463
+ };
10464
+ updateScrollState();
10465
+ wrapper.addEventListener("scroll", updateScrollState, { passive: true });
10466
+ const resizeObserver = new ResizeObserver(() => updateScrollState());
10467
+ resizeObserver.observe(wrapper);
10468
+ return () => {
10469
+ wrapper.removeEventListener("scroll", updateScrollState);
10470
+ resizeObserver.disconnect();
10471
+ };
10472
+ }, [lastLeftPinnedColumnId, firstRightPinnedColumnId]);
10473
+ return { getPinnedEdge, tableWrapperRef };
10474
+ }
10475
+
10206
10476
  // Create context for row hover state
10207
10477
  const RowHoverContext = createContext({
10208
10478
  isRowHovered: false
10209
10479
  });
10210
- const PreComposedTable = ({ data, columns, border = true, enableSorting = false, enableRowSelection = false, shouldPinSelectRowToLeft = true, enablePagination = false, enableColumnFiltering = false, enableGlobalFiltering = false, paginationConfig, className, style, tableWidth = "100%", onRowSelect, tableRowProps, sdsStyle = "lined", }) => {
10480
+ const PreComposedTableInner = ({ data, columns, border = true, enableSorting = false, enableRowSelection = false, shouldPinSelectRowToLeft = true, enablePagination = false, enableColumnFiltering = false, enableGlobalFiltering = false, paginationConfig, className, style, tableWidth = "100%", onRowSelect, tableRowProps, sdsStyle = "lined", tableOptions, }, ref) => {
10211
10481
  const [sorting, setSorting] = useState([]);
10212
10482
  const [rowSelection, setRowSelection] = useState({});
10213
10483
  const [columnVisibility, setColumnVisibility] = useState({});
@@ -10279,10 +10549,35 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10279
10549
  ...columnsWithoutSelection,
10280
10550
  ];
10281
10551
  }, [columns, enableRowSelection, shouldPinSelectRowToLeft]);
10552
+ const { onSortingChange: externalOnSortingChange, onRowSelectionChange: externalOnRowSelectionChange, onColumnVisibilityChange: externalOnColumnVisibilityChange, onColumnPinningChange: externalOnColumnPinningChange, onGlobalFilterChange: externalOnGlobalFilterChange, onPaginationChange: externalOnPaginationChange, } = tableOptions ?? {};
10553
+ const handleSortingChange = useCallback((updater) => {
10554
+ setSorting(updater);
10555
+ externalOnSortingChange?.(updater);
10556
+ }, [externalOnSortingChange]);
10557
+ const handleRowSelectionChange = useCallback((updater) => {
10558
+ setRowSelection(updater);
10559
+ externalOnRowSelectionChange?.(updater);
10560
+ }, [externalOnRowSelectionChange]);
10561
+ const handleColumnVisibilityChange = useCallback((updater) => {
10562
+ setColumnVisibility(updater);
10563
+ externalOnColumnVisibilityChange?.(updater);
10564
+ }, [externalOnColumnVisibilityChange]);
10565
+ const handleColumnPinningChange = useCallback((updater) => {
10566
+ setColumnPinning(updater);
10567
+ externalOnColumnPinningChange?.(updater);
10568
+ }, [externalOnColumnPinningChange]);
10569
+ const handleGlobalFilterChange = useCallback((updater) => {
10570
+ setGlobalFilter(updater);
10571
+ externalOnGlobalFilterChange?.(updater);
10572
+ }, [externalOnGlobalFilterChange]);
10573
+ const handlePaginationChange = useCallback((updater) => {
10574
+ setPagination(updater);
10575
+ externalOnPaginationChange?.(updater);
10576
+ }, [externalOnPaginationChange]);
10282
10577
  const table = useReactTable({
10578
+ ...tableOptions,
10283
10579
  columns: tableColumns,
10284
10580
  data,
10285
- debugTable: true,
10286
10581
  enableColumnFilters: enableColumnFiltering,
10287
10582
  enableGlobalFilter: enableGlobalFiltering,
10288
10583
  enableRowSelection: enableRowSelection,
@@ -10291,21 +10586,23 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10291
10586
  getFilteredRowModel: getFilteredRowModel(),
10292
10587
  getPaginationRowModel: getPaginationRowModel(),
10293
10588
  getSortedRowModel: getSortedRowModel(),
10294
- onColumnPinningChange: setColumnPinning,
10295
- onColumnVisibilityChange: setColumnVisibility,
10296
- onGlobalFilterChange: setGlobalFilter,
10297
- onPaginationChange: setPagination,
10298
- onRowSelectionChange: setRowSelection,
10299
- onSortingChange: setSorting,
10589
+ onColumnPinningChange: handleColumnPinningChange,
10590
+ onColumnVisibilityChange: handleColumnVisibilityChange,
10591
+ onGlobalFilterChange: handleGlobalFilterChange,
10592
+ onPaginationChange: handlePaginationChange,
10593
+ onRowSelectionChange: handleRowSelectionChange,
10594
+ onSortingChange: handleSortingChange,
10300
10595
  state: {
10301
10596
  columnPinning,
10302
10597
  columnVisibility,
10303
10598
  globalFilter,
10304
10599
  pagination,
10305
10600
  rowSelection,
10306
- sorting
10601
+ sorting,
10602
+ ...tableOptions?.state
10307
10603
  }
10308
10604
  });
10605
+ useImperativeHandle(ref, () => ({ table }), [table]);
10309
10606
  const createInitialPinning = useCallback(() => {
10310
10607
  const initialPinning = {};
10311
10608
  tableColumns.forEach((column) => {
@@ -10358,6 +10655,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10358
10655
  resizeObserver.disconnect();
10359
10656
  };
10360
10657
  }, [headers, table]);
10658
+ const { tableWrapperRef, getPinnedEdge } = usePinnedColumnGradient(table, tableColumns);
10361
10659
  const renderCell = (cell, row) => {
10362
10660
  const isRowHovered = hoveredRowId === row.id;
10363
10661
  const isPinned = cell.column.columnDef.meta?.pinning;
@@ -10388,7 +10686,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10388
10686
  : cell.column.columnDef.meta?.verticalAlign }));
10389
10687
  }
10390
10688
  if (isPinned) {
10391
- return (jsx(RowHoverContext.Provider, { value: { isRowHovered }, children: jsx("td", { style: {
10689
+ return (jsx(RowHoverContext.Provider, { value: { isRowHovered }, children: jsx("td", { "data-pinned-edge": getPinnedEdge(cell.column.id), style: {
10392
10690
  ...pinnedStyle,
10393
10691
  width: `${cell.column.getSize()}px`,
10394
10692
  verticalAlign: cell.column.columnDef.meta?.verticalAlign
@@ -10399,16 +10697,41 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10399
10697
  width: `${cell.column.getSize()}px`
10400
10698
  }, children: cellContent }) }, cell.id));
10401
10699
  };
10700
+ const renderFilterCell = (header) => {
10701
+ const column = header.column;
10702
+ const isPinned = column.columnDef.meta?.pinning;
10703
+ const pinnedStyle = getCommonPinningStyles(column, table);
10704
+ const isSelectionColumn = column.id === SELECT_COLUMN_ID;
10705
+ const cellStyle = {
10706
+ ...(isPinned ? pinnedStyle : {}),
10707
+ width: `${column.getSize()}px`
10708
+ };
10709
+ const pinnedEdge = isPinned ? getPinnedEdge(column.id) : undefined;
10710
+ const customFilter = column.columnDef.meta?.filterComponent;
10711
+ if (customFilter && !isSelectionColumn) {
10712
+ return (jsx(StyledFilterCell, { "data-pinned-edge": pinnedEdge, style: cellStyle, children: customFilter({ column, table }) }, `filter-${header.id}`));
10713
+ }
10714
+ const canFilter = column.getCanFilter() && !isSelectionColumn;
10715
+ if (!canFilter) {
10716
+ return (jsx(StyledFilterCell, { "data-pinned-edge": pinnedEdge, style: cellStyle }, `filter-${header.id}`));
10717
+ }
10718
+ return (jsx(StyledFilterCell, { "data-pinned-edge": pinnedEdge, style: cellStyle, children: jsx(InputSearch, { id: `filter-${column.id}`, label: `Filter ${typeof column.columnDef.header === "string" ? column.columnDef.header : column.id}`, placeholder: "Search", sdsStyle: "square", value: column.getFilterValue() ?? "", onChange: (e) => column.setFilterValue(e.target.value || undefined) }) }, `filter-${header.id}`));
10719
+ };
10720
+ const renderFilterRow = () => {
10721
+ const flatHeaders = table.getFlatHeaders();
10722
+ return (jsx(StyledFilterRow, { children: flatHeaders.map((header) => renderFilterCell(header)) }));
10723
+ };
10402
10724
  const renderHeader = (header) => {
10403
10725
  const isSortable = enableSorting && header.column.getCanSort();
10404
10726
  const isSorted = header.column.getIsSorted();
10405
10727
  const sortDirection = header.column.getIsSorted();
10406
10728
  const isPinned = header.column.columnDef.meta?.pinning;
10407
10729
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10408
- const { ref, ...headerCellProps } = header.column.columnDef.meta?.headerCellProps || {};
10730
+ const { ref: headerCellRef, ...headerCellProps } = header.column.columnDef.meta?.headerCellProps || {};
10409
10731
  const pinnedStyle = getCommonPinningStyles(header.column, table);
10732
+ const pinnedEdge = isPinned ? getPinnedEdge(header.column.id) : undefined;
10410
10733
  if (typeof header.column.columnDef.header === "string") {
10411
- return (jsx(CellHeader, __assign({ colSpan: header.colSpan, style: {
10734
+ return (jsx(CellHeader, __assign({ colSpan: header.colSpan, "data-pinned-edge": pinnedEdge, style: {
10412
10735
  ...(isPinned ? pinnedStyle : {}),
10413
10736
  width: `${header.getSize()}px`
10414
10737
  }, active: !!isSorted, direction: sortDirection || undefined, hover: isSortable, onClick: header.column.getToggleSortingHandler() }, headerCellProps, { children: header.isPlaceholder ? null : header.column.columnDef.header }), header.id));
@@ -10416,6 +10739,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10416
10739
  else if (header.column.columnDef.header) {
10417
10740
  return flexRender(header.column.columnDef.header, {
10418
10741
  ...header.getContext(),
10742
+ "data-pinned-edge": pinnedEdge,
10419
10743
  key: header.id,
10420
10744
  style: {
10421
10745
  ...(isPinned ? pinnedStyle : {}),
@@ -10425,20 +10749,21 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10425
10749
  }
10426
10750
  else {
10427
10751
  // Fallback for undefined header content
10428
- return (jsx(CellHeader, { colSpan: header.colSpan, style: {
10752
+ return (jsx(CellHeader, { colSpan: header.colSpan, "data-pinned-edge": pinnedEdge, style: {
10429
10753
  ...(isPinned ? pinnedStyle : {}),
10430
10754
  width: `${header.getSize()}px`
10431
10755
  }, active: !!isSorted, direction: sortDirection || undefined, hover: isSortable, onClick: header.column.getToggleSortingHandler(), children: header.column.id || "Header" }, header.id));
10432
10756
  }
10433
10757
  };
10434
- return (jsxs(StyledTableContainer$1, { ref: tableContainerRef, className: className, style: { width: tableWidth, ...style }, children: [enableGlobalFiltering && (jsx("div", { style: { marginBottom: "16px" }, children: jsx(StyledInputSearch, { id: "global-search", label: "Search", placeholder: "Search all columns...", value: globalFilter, onChange: (e) => setGlobalFilter(e.target.value) }) })), jsx(StyledTableWrapper, { border: border, sdsStyle: sdsStyle, children: jsxs(Table, { children: [jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => {
10758
+ return (jsxs(StyledTableContainer$1, { ref: tableContainerRef, className: className, style: { width: tableWidth, ...style }, children: [enableGlobalFiltering && (jsx("div", { style: { marginBottom: "16px" }, children: jsx(StyledInputSearch, { id: "global-search", label: "Search", placeholder: "Search all columns...", value: globalFilter, onChange: (e) => setGlobalFilter(e.target.value) }) })), jsx(StyledTableWrapper, { ref: tableWrapperRef, border: border, sdsStyle: sdsStyle, children: jsxs(Table, { children: [jsx(TableHeader, { filterRow: enableColumnFiltering ? renderFilterRow() : undefined, children: table.getHeaderGroups().map((headerGroup) => {
10435
10759
  return (jsx(Fragment$1, { children: headerGroup.headers.map((header) => {
10436
10760
  return renderHeader(header);
10437
10761
  }) }, headerGroup.id));
10438
- }) }), jsx("tbody", { children: table.getRowModel().rows.map((row) => (jsx(TableRow, __assign({ onMouseEnter: () => setHoveredRowId(row.id), onMouseLeave: () => setHoveredRowId(null), selected: row.getIsSelected(), "aria-selected": row.getIsSelected() }, tableRowProps, { children: row.getVisibleCells().map((cell) => {
10762
+ }) }), jsx("tbody", { children: table.getRowModel().rows.map((row) => (jsx(TableRow, __assign({ onMouseEnter: () => setHoveredRowId(row.id), onMouseLeave: () => setHoveredRowId(null), selected: row.getIsSelected(), "aria-selected": row.getIsSelected(), className: "group" }, tableRowProps, { children: row.getVisibleCells().map((cell) => {
10439
10763
  return renderCell(cell, row);
10440
10764
  }) }), row.id))) })] }) }), enablePagination && (jsx(StyledPaginationWrapper, { placement: paginationConfig?.placement, children: jsx(Pagination, __assign({ currentPage: table.getState().pagination.pageIndex + 1, onPageChange: (page) => table.setPageIndex(page - 1), onNextPage: () => table.nextPage(), onPreviousPage: () => table.previousPage(), pageSize: table.getState().pagination.pageSize, totalCount: table.getFilteredRowModel().rows.length }, paginationConfig)) }))] }, `table-${columns.length}-${columns.map((col) => col.id || "col").join("-")}`));
10441
10765
  };
10766
+ const PreComposedTable = forwardRef(PreComposedTableInner);
10442
10767
 
10443
10768
  const doNotForwardProps$v = [
10444
10769
  "icon",
@@ -10527,6 +10852,7 @@ const PrimaryText = styled("div", {
10527
10852
  return `
10528
10853
  display: block;
10529
10854
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10855
+ white-space: pre-wrap;
10530
10856
 
10531
10857
  ${props.shouldTextWrap
10532
10858
  ? ShouldWrap(primaryTextWrapLineCount)
@@ -10547,6 +10873,7 @@ const SecondaryText = styled("span", {
10547
10873
  color: ${semanticColors?.base?.textSecondary};
10548
10874
  padding-top: 0px;
10549
10875
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10876
+ white-space: pre-wrap;
10550
10877
 
10551
10878
  ${props.shouldTextWrap
10552
10879
  ? ShouldWrap(secondaryTextWrapLineCount)
@@ -10568,6 +10895,7 @@ const TertiaryText = styled("span", {
10568
10895
  color: ${semanticColors?.base?.textSecondary};
10569
10896
  padding-top: ${spaces?.xxxs}px;
10570
10897
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10898
+ white-space: pre-wrap;
10571
10899
 
10572
10900
  ${props.shouldTextWrap
10573
10901
  ? ShouldWrap(tertiaryTextWrapLineCount)
@@ -10593,7 +10921,6 @@ const PrimaryTextComponentSlotRightWrapper = styled("div") `
10593
10921
  `;
10594
10922
  const StyledTableData = styled.div `
10595
10923
  ${fontBodyS$1}
10596
- ${focusVisibleA11yStyle}
10597
10924
 
10598
10925
  ${(props) => {
10599
10926
  const { horizontalAlign = "left", verticalAlign = "top", shouldShowUnderlineOnHover = false, isRowHovered = false, extraRightPadding = 0, } = props;
@@ -10602,6 +10929,7 @@ const StyledTableData = styled.div `
10602
10929
  ? (spaces?.m ?? 0) + extraRightPadding
10603
10930
  : spaces?.m;
10604
10931
  return `
10932
+ outline: none;
10605
10933
  padding: ${spaces?.m}px ${paddingRight}px ${spaces?.m}px ${spaces?.m}px !important;
10606
10934
  text-align: ${horizontalAlign};
10607
10935
  vertical-align: ${verticalAlignCSSMap[verticalAlign]};
@@ -10609,12 +10937,12 @@ const StyledTableData = styled.div `
10609
10937
 
10610
10938
  &:hover {
10611
10939
  ${PrimaryText} {
10612
- ${shouldShowUnderlineOnHover ? "text-decoration: underline;" : ""}
10940
+ ${shouldShowUnderlineOnHover ? "text-decoration: underline !important;" : ""}
10613
10941
  }
10614
10942
  }
10615
10943
 
10616
10944
  ${PrimaryText} {
10617
- ${isRowHovered && shouldShowUnderlineOnHover ? "text-decoration: underline;" : ""}
10945
+ ${isRowHovered && shouldShowUnderlineOnHover ? "text-decoration: underline !important;" : ""}
10618
10946
  }
10619
10947
  `;
10620
10948
  }}
@@ -18466,11 +18794,28 @@ const StyledHeaderComponent = styled("div") `
18466
18794
  top: 0;
18467
18795
  z-index: 1000;
18468
18796
  background-color: ${semanticColors?.base?.backgroundPrimary};
18469
- padding-bottom: ${spaces?.xl}px;
18797
+ padding-bottom: ${spaces?.m}px;
18798
+ margin-bottom: ${spaces?.m}px;
18470
18799
  padding-top: ${spaces?.xl}px;
18471
18800
  display: flex;
18472
18801
  justify-content: space-between;
18473
- align-items: start;
18802
+ align-items: center;
18803
+
18804
+ &::after {
18805
+ content: "";
18806
+ position: absolute;
18807
+ bottom: 0;
18808
+ left: 0;
18809
+ right: 0;
18810
+ height: ${spaces?.xl}px;
18811
+ transform: translateY(100%);
18812
+ background: linear-gradient(
18813
+ to bottom,
18814
+ ${semanticColors?.base?.backgroundPrimary},
18815
+ transparent
18816
+ );
18817
+ pointer-events: none;
18818
+ }
18474
18819
  `;
18475
18820
  }}
18476
18821
  `;
@@ -18500,6 +18845,8 @@ const StyledPanelHeaderClose = styled("div") `
18500
18845
  align-items: center;
18501
18846
 
18502
18847
  button {
18848
+ height: auto !important;
18849
+
18503
18850
  svg {
18504
18851
  width: ${iconSizes?.l?.width}px;
18505
18852
  height: ${iconSizes?.l?.height}px;
@@ -18566,6 +18913,41 @@ const Panel = React__default.forwardRef((props, ref) => {
18566
18913
  }, slotProps: SLOT_PROPS, hideBackdrop: !isBackdropClickEnabled, children: [isOverlayPanelProps(props) && (jsxs(StyledHeaderComponent, { children: [props?.HeaderComponent && (jsx(PanelHeader, { children: props?.HeaderComponent })), jsx(PanelHeaderClose, { onClick: props?.closeButtonOnClick, CloseButtonComponent: props?.CloseButtonComponent })] })), children] })));
18567
18914
  });
18568
18915
 
18916
+ const StyledPopover = styled(Popover$1) `
18917
+ & .${popoverClasses.paper} {
18918
+ ${(props) => {
18919
+ const corners = getCorners(props);
18920
+ const shadows = getShadows(props);
18921
+ const semanticColors = getSemanticColors(props);
18922
+ const borders = getBorders(props);
18923
+ const spaces = getSpaces(props);
18924
+ return `
18925
+ background-color: ${semanticColors?.base?.surfacePrimary};
18926
+ background-image: none;
18927
+ border-radius: ${corners?.l}px;
18928
+ padding: ${spaces?.xs}px ${spaces?.m}px;
18929
+ border: ${borders?.none};
18930
+ outline: 1px solid ${addOpacityToHex(semanticColors?.base?.borderSecondary || "#000000", 15)};
18931
+ box-shadow: ${shadows?.m};
18932
+ box-sizing: border-box;
18933
+ z-index: ${props?.theme?.zIndex?.tooltip ?? 1400};
18934
+ `;
18935
+ }}
18936
+ }
18937
+ `;
18938
+
18939
+ /**
18940
+ * @see https://mui.com/material-ui/react-popover/
18941
+ */
18942
+ const Popover = forwardRef(function Popover(props, ref) {
18943
+ const theme = useTheme();
18944
+ const spaces = getSpaces({ theme });
18945
+ return (jsx(StyledPopover, __assign({ ref: ref, anchorOrigin: {
18946
+ horizontal: "left",
18947
+ vertical: "bottom"
18948
+ }, transformOrigin: { vertical: -(spaces?.s || 8), horizontal: 0 } }, props)));
18949
+ });
18950
+
18569
18951
  const doNotForwardProps = ["buttonDefinition"];
18570
18952
  const StyledSegmentedControl = styled(ToggleButtonGroup, {
18571
18953
  shouldForwardProp: (prop) => !doNotForwardProps.includes(prop)
@@ -18607,7 +18989,6 @@ const StyledSegmentedControl = styled(ToggleButtonGroup, {
18607
18989
  ${focusVisibleA11yStyle(props)}
18608
18990
  background-color: transparent;
18609
18991
  border: none;
18610
- line-height: 0px;
18611
18992
  color: ${semanticColors?.base?.ornamentSecondary};
18612
18993
  padding: ${spaces?.xxs}px ${spaces?.m}px;
18613
18994
  border-radius: ${corners?.m}px;
@@ -18636,6 +19017,14 @@ const StyledToggleButton = styled(ToggleButton, {
18636
19017
  `;
18637
19018
  }}
18638
19019
  `;
19020
+ const StyledToggleButtonIcon = styled("div") `
19021
+ line-height: 0px;
19022
+ `;
19023
+ const StyledToggleButtonLabel = styled("div") `
19024
+ ${fontBodyMediumS}
19025
+ white-space: nowrap;
19026
+ line-height: 16px !important;
19027
+ `;
18639
19028
 
18640
19029
  /**
18641
19030
  * @see https://mui.com/material-ui/react-toggle-button/
@@ -18655,13 +19044,27 @@ const SegmentedControl = (props) => {
18655
19044
  onChangeProp(event, newActive);
18656
19045
  }
18657
19046
  };
18658
- return (jsxs(StyledSegmentedControl, __assign({ "aria-label": "Segmented Control", size: "small", value: value, exclusive: true, onChange: handleActive }, restProps, { children: [buttonDefinition.map((button) => {
18659
- const { icon, tooltipText, value: buttonValue, disabled = false, } = button;
18660
- const iconItem = icon ? (typeof icon !== "string" ? (icon) : (jsx(Icon, { sdsIcon: icon, sdsSize: "s" }))) : null;
18661
- const toggleButton = (jsx(StyledToggleButton, { "aria-label": tooltipText ?? buttonValue, value: buttonValue, disabled: disabled, children: jsx("span", { tabIndex: -1, children: iconItem }) }, buttonValue));
18662
- // (masoudmanson): If the button is disabled, we don't want to show the tooltip.
18663
- return disabled ? (toggleButton) : (jsx(Tooltip, { title: tooltipText ?? buttonValue, sdsStyle: "dark", arrow: true, children: toggleButton }, buttonValue));
18664
- }), ";"] })));
19047
+ return (jsx(StyledSegmentedControl, __assign({ "aria-label": "Segmented Control", size: "small", value: value, exclusive: true, onChange: handleActive }, restProps, { children: buttonDefinition.map((button) => {
19048
+ const { icon, label, shouldShowTooltip = true, tooltipProps, tooltipText, value: buttonValue, disabled = false, } = button;
19049
+ if (tooltipText) {
19050
+ showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlTooltipTextDeprecated);
19051
+ }
19052
+ if (!icon && !label) {
19053
+ showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlMissingIconOrLabel);
19054
+ }
19055
+ if (icon && label) {
19056
+ showWarningIfFirstOccurence(SDSWarningTypes.SegmentedControlIconAndLabelConflict);
19057
+ }
19058
+ const iconItem = icon ? (typeof icon !== "string" ? (icon) : (jsx(Icon, { sdsIcon: icon, sdsSize: "s" }))) : null;
19059
+ const buttonContent = label ? (jsx(StyledToggleButtonLabel, { children: label })) : iconItem ? (jsx(StyledToggleButtonIcon, { children: iconItem })) : (jsx(StyledToggleButtonLabel, { children: buttonValue }));
19060
+ const toggleButton = (jsx(StyledToggleButton, { "aria-label": tooltipText ?? label ?? buttonValue, value: buttonValue, disabled: disabled, children: jsx("span", { tabIndex: -1, children: buttonContent }) }, buttonValue));
19061
+ // Resolve the tooltip title: tooltipText takes priority,
19062
+ // then tooltipProps.title, then label, then falls back to buttonValue.
19063
+ const resolvedTitle = tooltipText ?? tooltipProps?.title ?? label ?? buttonValue;
19064
+ // (masoudmanson): If the button is disabled or shouldShowTooltip
19065
+ // is false, we don't render the tooltip.
19066
+ return disabled || !shouldShowTooltip ? (toggleButton) : (createElement(Tooltip, __assign({ arrow: true }, tooltipProps, { title: resolvedTitle, key: buttonValue }), toggleButton));
19067
+ }) })));
18665
19068
  };
18666
19069
 
18667
19070
  const TabsContext = createContext({ sdsSize: "large" });
@@ -22490,4 +22893,4 @@ const generateDiscreteColors = (count, options = {}) => {
22490
22893
  return isDarkMode ? colors.reverse() : colors;
22491
22894
  };
22492
22895
 
22493
- export { Accordion, AccordionDetails, AccordionHeader, Alert$1 as Alert, Autocomplete, StyledPopper$2 as AutocompleteMultiColumnStyledPopper, StyledPaper$3 as AutocompleteSingleColumnStyledPaper, Banner, Button, ButtonDropdown, ButtonDropdownLegacy, ButtonGroup, ButtonIcon, ButtonLegacy, ButtonToggle, ButtonToggleLegacy, Callout, CalloutTitle, CellBasic, CellComponent, CellHeader, Chip, ComplexFilter, InputDropdown as ComplexFilterInputDropdown, StyledPopper as ComplexFilterPopper, ContentCard, ContentCardActions, StyledContentCardBody as ContentCardBody, StyledMetadataText as ContentCardMetadata, StyledOverlineText as ContentCardOverline, StyledSubtitleText as ContentCardSubtitle, StyledTitleText as ContentCardTitle, Dialog, DialogActions, index$1 as DialogContent, DialogPaper, DialogTitle, Overline as DialogTitleOverline, Subtitle as DialogTitleSubtitle, Title as DialogTitleTitle, Dropdown, InputDropdown as DropdownInputDropdown, DropdownMenu, StyledPaper$1 as DropdownPaper, StyledPopper as DropdownPopper, Hero, Icon, InputCheckbox, InputDropdown, InputRadio, InputSearch, InputSlider, InputText, InputToggle, IntentMessage, Legend, Link, List, ListItem, ListItemLabel, ListSubheader, LoadingIndicator, MINIMUM_DROPDOWN_MENU_POPPER_WIDTH, Menu, MenuItem, MenuSelect, NavigationFooter, NavigationHeader, NavigationJumpTo, Notification, Pagination, Panel, PreComposedTable, RowHoverContext, SDSChooseTheme, SDSDarkAppTheme, SDSDarkThemeColors, SDSLightAppTheme, SDSLightThemeColors, SDSPaletteDark, SDSPaletteLight, SegmentedControl, Tab, Table, TableHeader, TableRow, Tabs, Tag, TagFilter, Theme, Tooltip, TooltipCondensed, TooltipTableContent as TooltipTable, defaultAppTheme, defaultTheme, focusVisibleA11yStyle, fontBody, fontBodyL$1 as fontBodyL, fontBodyM$1 as fontBodyM, fontBodyMediumL, fontBodyMediumM, fontBodyMediumS, fontBodyMediumXs, fontBodyMediumXxs, fontBodyMediumXxxs, fontBodyMediumXxxxs, fontBodyS$1 as fontBodyS, fontBodySemiboldL, fontBodySemiboldM, fontBodySemiboldS, fontBodySemiboldXs, fontBodySemiboldXxs, fontBodySemiboldXxxs, fontBodySemiboldXxxxs, fontBodyXs$2 as fontBodyXs, fontBodyXxs$1 as fontBodyXxs, fontBodyXxxs$1 as fontBodyXxxs, fontBodyXxxxs, fontCaps, fontCapsXxs, fontCapsXxxs, fontCapsXxxxs, fontCode, fontCodeMediumS, fontCodeMediumXs, fontCodeS, fontCodeSemiboldS, fontCodeSemiboldXs, fontCodeXs, fontHeader, fontHeaderL, fontHeaderM$1 as fontHeaderM, fontHeaderS, fontHeaderXl, fontHeaderXs, fontHeaderXxl, fontHeaderXxs, fontHeaderXxxs, fontLink, fontLinkL, fontLinkM, fontLinkMediumL, fontLinkMediumM, fontLinkMediumS, fontLinkMediumXs, fontLinkMediumXxs, fontLinkMediumXxxs, fontLinkMediumXxxxs, fontLinkS, fontLinkSemiboldL, fontLinkSemiboldM, fontLinkSemiboldS, fontLinkSemiboldXs, fontLinkSemiboldXxs, fontLinkSemiboldXxxs, fontLinkSemiboldXxxxs, fontLinkXs, fontLinkXxs, fontLinkXxxs, fontLinkXxxxs, fontTabular, fontTabularMediumS, fontTabularMediumXs, fontTabularMediumXxs, fontTabularMediumXxxs, fontTabularMediumXxxxs, fontTabularS, fontTabularSemiboldS, fontTabularSemiboldXs, fontTabularSemiboldXxs, fontTabularSemiboldXxxs, fontTabularSemiboldXxxxs, fontTabularXs, fontTabularXxs, fontTabularXxxs, fontTabularXxxxs, fontTitle, fontTitleBoldL, fontTitleBoldM, fontTitleBoldS, generateDiscreteColors, getBorders, getBreakpoints, getColors, getCorners, getFontWeights, getIconSizes, getMode, getPalette, getSemanticColors, getShadows, getSpaces, getSpacings, getTypography, isIconOnlyButton, makeSdsSemanticAppTheme, makeThemeOptions };
22896
+ export { Accordion, AccordionDetails, AccordionHeader, Alert$1 as Alert, Autocomplete, StyledPopper$2 as AutocompleteMultiColumnStyledPopper, StyledPaper$3 as AutocompleteSingleColumnStyledPaper, Banner, Button, ButtonDropdown, ButtonDropdownLegacy, ButtonGroup, ButtonIcon, ButtonLegacy, ButtonToggle, ButtonToggleLegacy, Callout, CalloutTitle, CellBasic, CellComponent, CellHeader, Chip, ComplexFilter, InputDropdown as ComplexFilterInputDropdown, StyledPopper as ComplexFilterPopper, ContentCard, ContentCardActions, StyledContentCardBody as ContentCardBody, StyledMetadataText as ContentCardMetadata, StyledOverlineText as ContentCardOverline, StyledSubtitleText as ContentCardSubtitle, StyledTitleText as ContentCardTitle, Dialog, DialogActions, index$1 as DialogContent, DialogPaper, DialogTitle, Overline as DialogTitleOverline, Subtitle as DialogTitleSubtitle, Title as DialogTitleTitle, Dropdown, InputDropdown as DropdownInputDropdown, DropdownMenu, StyledPaper$1 as DropdownPaper, StyledPopper as DropdownPopper, Hero, Icon, InputCheckbox, InputDropdown, InputRadio, InputSearch, InputSlider, InputText, InputToggle, IntentMessage, Legend, Link, List, ListItem, ListItemLabel, ListSubheader, LoadingIndicator, MINIMUM_DROPDOWN_MENU_POPPER_WIDTH, Menu, MenuItem, MenuSelect, NavigationFooter, NavigationHeader, NavigationJumpTo, Notification, Pagination, Panel, Popover, PreComposedTable, RowHoverContext, SDSChooseTheme, SDSDarkAppTheme, SDSDarkThemeColors, SDSLightAppTheme, SDSLightThemeColors, SDSPaletteDark, SDSPaletteLight, SegmentedControl, Tab, Table, TableHeader, TableRow, Tabs, Tag, TagFilter, Theme, Tooltip, TooltipCondensed, TooltipTableContent as TooltipTable, defaultAppTheme, defaultTheme, focusVisibleA11yStyle, fontBody, fontBodyL$1 as fontBodyL, fontBodyM$1 as fontBodyM, fontBodyMediumL, fontBodyMediumM, fontBodyMediumS, fontBodyMediumXs, fontBodyMediumXxs, fontBodyMediumXxxs, fontBodyMediumXxxxs, fontBodyS$1 as fontBodyS, fontBodySemiboldL, fontBodySemiboldM, fontBodySemiboldS, fontBodySemiboldXs, fontBodySemiboldXxs, fontBodySemiboldXxxs, fontBodySemiboldXxxxs, fontBodyXs$2 as fontBodyXs, fontBodyXxs$1 as fontBodyXxs, fontBodyXxxs$1 as fontBodyXxxs, fontBodyXxxxs, fontCaps, fontCapsXxs, fontCapsXxxs, fontCapsXxxxs, fontCode, fontCodeMediumS, fontCodeMediumXs, fontCodeS, fontCodeSemiboldS, fontCodeSemiboldXs, fontCodeXs, fontHeader, fontHeaderL, fontHeaderM$1 as fontHeaderM, fontHeaderS, fontHeaderXl, fontHeaderXs, fontHeaderXxl, fontHeaderXxs, fontHeaderXxxs, fontLink, fontLinkL, fontLinkM, fontLinkMediumL, fontLinkMediumM, fontLinkMediumS, fontLinkMediumXs, fontLinkMediumXxs, fontLinkMediumXxxs, fontLinkMediumXxxxs, fontLinkS, fontLinkSemiboldL, fontLinkSemiboldM, fontLinkSemiboldS, fontLinkSemiboldXs, fontLinkSemiboldXxs, fontLinkSemiboldXxxs, fontLinkSemiboldXxxxs, fontLinkXs, fontLinkXxs, fontLinkXxxs, fontLinkXxxxs, fontTabular, fontTabularMediumS, fontTabularMediumXs, fontTabularMediumXxs, fontTabularMediumXxxs, fontTabularMediumXxxxs, fontTabularS, fontTabularSemiboldS, fontTabularSemiboldXs, fontTabularSemiboldXxs, fontTabularSemiboldXxxs, fontTabularSemiboldXxxxs, fontTabularXs, fontTabularXxs, fontTabularXxxs, fontTabularXxxxs, fontTitle, fontTitleBoldL, fontTitleBoldM, fontTitleBoldS, generateDiscreteColors, getBorders, getBreakpoints, getColors, getCorners, getFontWeights, getIconSizes, getMode, getPalette, getSemanticColors, getShadows, getSpaces, getSpacings, getTypography, isIconOnlyButton, makeSdsSemanticAppTheme, makeThemeOptions };