@czi-sds/components 23.5.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,7 +1,7 @@
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
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';
@@ -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
  /**
@@ -9356,18 +9362,31 @@ const TableRow = forwardRef((props, ref) => {
9356
9362
 
9357
9363
  const StyledTableHeader$1 = styled("thead") `
9358
9364
  ${(props) => {
9365
+ const { hasFilterRow } = props;
9359
9366
  const semanticColors = getSemanticColors(props);
9360
9367
  return `
9361
9368
  border-bottom: solid 2px ${semanticColors?.base?.borderSecondary};
9362
9369
  margin: 0;
9363
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
+ : ""}
9364
9383
  `;
9365
9384
  }}
9366
9385
  `;
9367
9386
 
9368
9387
  const TableHeader = forwardRef((props, ref) => {
9369
- const { children } = props;
9370
- 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] })));
9371
9390
  });
9372
9391
 
9373
9392
  const contentPositionMapping = {
@@ -9411,7 +9430,6 @@ const ShouldTruncate$1 = () => {
9411
9430
  };
9412
9431
  const StyledTableHeader = styled.div `
9413
9432
  ${fontHeaderS}
9414
- ${focusVisibleA11yStyle}
9415
9433
 
9416
9434
  ${(props) => {
9417
9435
  const { active = false, horizontalAlign = "left", hover = true } = props;
@@ -9424,6 +9442,7 @@ const StyledTableHeader = styled.div `
9424
9442
  ? semanticColors?.accent?.foregroundInteraction
9425
9443
  : semanticColors?.base?.textPrimary;
9426
9444
  return `
9445
+ outline: none;
9427
9446
  color: ${defaultColor};
9428
9447
  padding: ${spaces?.m}px !important;
9429
9448
  text-align: ${horizontalAlign};
@@ -9994,12 +10013,12 @@ const InputCheckbox = (props) => {
9994
10013
 
9995
10014
  const StyledCellComponentData = styled.div `
9996
10015
  ${fontBodyS$1}
9997
- ${focusVisibleA11yStyle}
9998
10016
 
9999
10017
  ${(props) => {
10000
10018
  const spaces = getSpaces(props);
10001
10019
  const { horizontalAlign = "left", verticalAlign = "top" } = props;
10002
10020
  return `
10021
+ outline: none;
10003
10022
  align-items: center;
10004
10023
  text-align: ${horizontalAlign};
10005
10024
  vertical-align: ${verticalAlign};
@@ -10111,6 +10130,104 @@ const StyledTableWrapper = styled.div `
10111
10130
  }
10112
10131
  }
10113
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
+ }
10114
10231
  `;
10115
10232
  }}
10116
10233
  `;
@@ -10162,6 +10279,38 @@ const StyledPaginationWrapper = styled.div `
10162
10279
  const StyledSelectionCell = styled(CellComponent) `
10163
10280
  line-height: 22px !important;
10164
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
+ `;
10165
10314
 
10166
10315
  const SELECT_COLUMN_ID = "SdsTableSelectColumn";
10167
10316
  function getSize(size = 100, max = Number.MAX_SAFE_INTEGER, min = 40) {
@@ -10257,11 +10406,78 @@ const getCommonPinningStyles = (column, table) => {
10257
10406
  };
10258
10407
  };
10259
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
+
10260
10476
  // Create context for row hover state
10261
10477
  const RowHoverContext = createContext({
10262
10478
  isRowHovered: false
10263
10479
  });
10264
- 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) => {
10265
10481
  const [sorting, setSorting] = useState([]);
10266
10482
  const [rowSelection, setRowSelection] = useState({});
10267
10483
  const [columnVisibility, setColumnVisibility] = useState({});
@@ -10333,10 +10549,35 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10333
10549
  ...columnsWithoutSelection,
10334
10550
  ];
10335
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]);
10336
10577
  const table = useReactTable({
10578
+ ...tableOptions,
10337
10579
  columns: tableColumns,
10338
10580
  data,
10339
- debugTable: true,
10340
10581
  enableColumnFilters: enableColumnFiltering,
10341
10582
  enableGlobalFilter: enableGlobalFiltering,
10342
10583
  enableRowSelection: enableRowSelection,
@@ -10345,21 +10586,23 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10345
10586
  getFilteredRowModel: getFilteredRowModel(),
10346
10587
  getPaginationRowModel: getPaginationRowModel(),
10347
10588
  getSortedRowModel: getSortedRowModel(),
10348
- onColumnPinningChange: setColumnPinning,
10349
- onColumnVisibilityChange: setColumnVisibility,
10350
- onGlobalFilterChange: setGlobalFilter,
10351
- onPaginationChange: setPagination,
10352
- onRowSelectionChange: setRowSelection,
10353
- onSortingChange: setSorting,
10589
+ onColumnPinningChange: handleColumnPinningChange,
10590
+ onColumnVisibilityChange: handleColumnVisibilityChange,
10591
+ onGlobalFilterChange: handleGlobalFilterChange,
10592
+ onPaginationChange: handlePaginationChange,
10593
+ onRowSelectionChange: handleRowSelectionChange,
10594
+ onSortingChange: handleSortingChange,
10354
10595
  state: {
10355
10596
  columnPinning,
10356
10597
  columnVisibility,
10357
10598
  globalFilter,
10358
10599
  pagination,
10359
10600
  rowSelection,
10360
- sorting
10601
+ sorting,
10602
+ ...tableOptions?.state
10361
10603
  }
10362
10604
  });
10605
+ useImperativeHandle(ref, () => ({ table }), [table]);
10363
10606
  const createInitialPinning = useCallback(() => {
10364
10607
  const initialPinning = {};
10365
10608
  tableColumns.forEach((column) => {
@@ -10412,6 +10655,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10412
10655
  resizeObserver.disconnect();
10413
10656
  };
10414
10657
  }, [headers, table]);
10658
+ const { tableWrapperRef, getPinnedEdge } = usePinnedColumnGradient(table, tableColumns);
10415
10659
  const renderCell = (cell, row) => {
10416
10660
  const isRowHovered = hoveredRowId === row.id;
10417
10661
  const isPinned = cell.column.columnDef.meta?.pinning;
@@ -10442,7 +10686,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10442
10686
  : cell.column.columnDef.meta?.verticalAlign }));
10443
10687
  }
10444
10688
  if (isPinned) {
10445
- 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: {
10446
10690
  ...pinnedStyle,
10447
10691
  width: `${cell.column.getSize()}px`,
10448
10692
  verticalAlign: cell.column.columnDef.meta?.verticalAlign
@@ -10453,16 +10697,41 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10453
10697
  width: `${cell.column.getSize()}px`
10454
10698
  }, children: cellContent }) }, cell.id));
10455
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
+ };
10456
10724
  const renderHeader = (header) => {
10457
10725
  const isSortable = enableSorting && header.column.getCanSort();
10458
10726
  const isSorted = header.column.getIsSorted();
10459
10727
  const sortDirection = header.column.getIsSorted();
10460
10728
  const isPinned = header.column.columnDef.meta?.pinning;
10461
10729
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10462
- const { ref, ...headerCellProps } = header.column.columnDef.meta?.headerCellProps || {};
10730
+ const { ref: headerCellRef, ...headerCellProps } = header.column.columnDef.meta?.headerCellProps || {};
10463
10731
  const pinnedStyle = getCommonPinningStyles(header.column, table);
10732
+ const pinnedEdge = isPinned ? getPinnedEdge(header.column.id) : undefined;
10464
10733
  if (typeof header.column.columnDef.header === "string") {
10465
- return (jsx(CellHeader, __assign({ colSpan: header.colSpan, style: {
10734
+ return (jsx(CellHeader, __assign({ colSpan: header.colSpan, "data-pinned-edge": pinnedEdge, style: {
10466
10735
  ...(isPinned ? pinnedStyle : {}),
10467
10736
  width: `${header.getSize()}px`
10468
10737
  }, active: !!isSorted, direction: sortDirection || undefined, hover: isSortable, onClick: header.column.getToggleSortingHandler() }, headerCellProps, { children: header.isPlaceholder ? null : header.column.columnDef.header }), header.id));
@@ -10470,6 +10739,7 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10470
10739
  else if (header.column.columnDef.header) {
10471
10740
  return flexRender(header.column.columnDef.header, {
10472
10741
  ...header.getContext(),
10742
+ "data-pinned-edge": pinnedEdge,
10473
10743
  key: header.id,
10474
10744
  style: {
10475
10745
  ...(isPinned ? pinnedStyle : {}),
@@ -10479,20 +10749,21 @@ const PreComposedTable = ({ data, columns, border = true, enableSorting = false,
10479
10749
  }
10480
10750
  else {
10481
10751
  // Fallback for undefined header content
10482
- return (jsx(CellHeader, { colSpan: header.colSpan, style: {
10752
+ return (jsx(CellHeader, { colSpan: header.colSpan, "data-pinned-edge": pinnedEdge, style: {
10483
10753
  ...(isPinned ? pinnedStyle : {}),
10484
10754
  width: `${header.getSize()}px`
10485
10755
  }, active: !!isSorted, direction: sortDirection || undefined, hover: isSortable, onClick: header.column.getToggleSortingHandler(), children: header.column.id || "Header" }, header.id));
10486
10756
  }
10487
10757
  };
10488
- 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) => {
10489
10759
  return (jsx(Fragment$1, { children: headerGroup.headers.map((header) => {
10490
10760
  return renderHeader(header);
10491
10761
  }) }, headerGroup.id));
10492
- }) }), 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) => {
10493
10763
  return renderCell(cell, row);
10494
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("-")}`));
10495
10765
  };
10766
+ const PreComposedTable = forwardRef(PreComposedTableInner);
10496
10767
 
10497
10768
  const doNotForwardProps$v = [
10498
10769
  "icon",
@@ -10581,6 +10852,7 @@ const PrimaryText = styled("div", {
10581
10852
  return `
10582
10853
  display: block;
10583
10854
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10855
+ white-space: pre-wrap;
10584
10856
 
10585
10857
  ${props.shouldTextWrap
10586
10858
  ? ShouldWrap(primaryTextWrapLineCount)
@@ -10601,6 +10873,7 @@ const SecondaryText = styled("span", {
10601
10873
  color: ${semanticColors?.base?.textSecondary};
10602
10874
  padding-top: 0px;
10603
10875
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10876
+ white-space: pre-wrap;
10604
10877
 
10605
10878
  ${props.shouldTextWrap
10606
10879
  ? ShouldWrap(secondaryTextWrapLineCount)
@@ -10622,6 +10895,7 @@ const TertiaryText = styled("span", {
10622
10895
  color: ${semanticColors?.base?.textSecondary};
10623
10896
  padding-top: ${spaces?.xxxs}px;
10624
10897
  font-variant-numeric: ${tabularNums ? TABULAR_NUMS : "normal"};
10898
+ white-space: pre-wrap;
10625
10899
 
10626
10900
  ${props.shouldTextWrap
10627
10901
  ? ShouldWrap(tertiaryTextWrapLineCount)
@@ -10647,7 +10921,6 @@ const PrimaryTextComponentSlotRightWrapper = styled("div") `
10647
10921
  `;
10648
10922
  const StyledTableData = styled.div `
10649
10923
  ${fontBodyS$1}
10650
- ${focusVisibleA11yStyle}
10651
10924
 
10652
10925
  ${(props) => {
10653
10926
  const { horizontalAlign = "left", verticalAlign = "top", shouldShowUnderlineOnHover = false, isRowHovered = false, extraRightPadding = 0, } = props;
@@ -10656,6 +10929,7 @@ const StyledTableData = styled.div `
10656
10929
  ? (spaces?.m ?? 0) + extraRightPadding
10657
10930
  : spaces?.m;
10658
10931
  return `
10932
+ outline: none;
10659
10933
  padding: ${spaces?.m}px ${paddingRight}px ${spaces?.m}px ${spaces?.m}px !important;
10660
10934
  text-align: ${horizontalAlign};
10661
10935
  vertical-align: ${verticalAlignCSSMap[verticalAlign]};
@@ -10663,12 +10937,12 @@ const StyledTableData = styled.div `
10663
10937
 
10664
10938
  &:hover {
10665
10939
  ${PrimaryText} {
10666
- ${shouldShowUnderlineOnHover ? "text-decoration: underline;" : ""}
10940
+ ${shouldShowUnderlineOnHover ? "text-decoration: underline !important;" : ""}
10667
10941
  }
10668
10942
  }
10669
10943
 
10670
10944
  ${PrimaryText} {
10671
- ${isRowHovered && shouldShowUnderlineOnHover ? "text-decoration: underline;" : ""}
10945
+ ${isRowHovered && shouldShowUnderlineOnHover ? "text-decoration: underline !important;" : ""}
10672
10946
  }
10673
10947
  `;
10674
10948
  }}
@@ -18520,11 +18794,28 @@ const StyledHeaderComponent = styled("div") `
18520
18794
  top: 0;
18521
18795
  z-index: 1000;
18522
18796
  background-color: ${semanticColors?.base?.backgroundPrimary};
18523
- padding-bottom: ${spaces?.xl}px;
18797
+ padding-bottom: ${spaces?.m}px;
18798
+ margin-bottom: ${spaces?.m}px;
18524
18799
  padding-top: ${spaces?.xl}px;
18525
18800
  display: flex;
18526
18801
  justify-content: space-between;
18527
- 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
+ }
18528
18819
  `;
18529
18820
  }}
18530
18821
  `;
@@ -18554,6 +18845,8 @@ const StyledPanelHeaderClose = styled("div") `
18554
18845
  align-items: center;
18555
18846
 
18556
18847
  button {
18848
+ height: auto !important;
18849
+
18557
18850
  svg {
18558
18851
  width: ${iconSizes?.l?.width}px;
18559
18852
  height: ${iconSizes?.l?.height}px;