@popsure/dirty-swan 0.66.12 → 0.66.13

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.
Files changed (48) hide show
  1. package/dist/cjs/index.js +49 -34
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/table/Table.d.ts +3 -1
  4. package/dist/cjs/lib/components/table/Table.stories.d.ts +10 -2
  5. package/dist/cjs/lib/components/table/components/TableCell/TableCell.d.ts +3 -1
  6. package/dist/cjs/lib/components/table/components/TableContents/TableContents.d.ts +2 -1
  7. package/dist/cjs/lib/components/table/components/TableSection/TableSection.d.ts +2 -1
  8. package/dist/cjs/lib/models/styles.d.ts +1 -1
  9. package/dist/esm/{TableSection-CEhD4eoy.js → TableSection-Cm50RX-V.js} +28 -9
  10. package/dist/esm/TableSection-Cm50RX-V.js.map +1 -0
  11. package/dist/esm/components/table/Table.js +10 -10
  12. package/dist/esm/components/table/Table.js.map +1 -1
  13. package/dist/esm/components/table/Table.stories.js +79 -4
  14. package/dist/esm/components/table/Table.stories.js.map +1 -1
  15. package/dist/esm/components/table/Table.test.js +7 -1
  16. package/dist/esm/components/table/Table.test.js.map +1 -1
  17. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js +1 -1
  18. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js.map +1 -1
  19. package/dist/esm/components/table/components/TableCell/TableCell.js +6 -4
  20. package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
  21. package/dist/esm/components/table/components/TableContents/TableContents.js +9 -15
  22. package/dist/esm/components/table/components/TableContents/TableContents.js.map +1 -1
  23. package/dist/esm/components/table/components/TableContents/TableContents.test.js +14 -2
  24. package/dist/esm/components/table/components/TableContents/TableContents.test.js.map +1 -1
  25. package/dist/esm/components/table/components/TableSection/TableSection.js +1 -1
  26. package/dist/esm/components/table/components/TableSection/TableSection.test.js +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/lib/components/table/Table.d.ts +3 -1
  29. package/dist/esm/lib/components/table/Table.stories.d.ts +10 -2
  30. package/dist/esm/lib/components/table/components/TableCell/TableCell.d.ts +3 -1
  31. package/dist/esm/lib/components/table/components/TableContents/TableContents.d.ts +2 -1
  32. package/dist/esm/lib/components/table/components/TableSection/TableSection.d.ts +2 -1
  33. package/dist/esm/lib/models/styles.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/src/lib/components/table/Table.module.scss +3 -0
  36. package/src/lib/components/table/Table.stories.tsx +92 -0
  37. package/src/lib/components/table/Table.test.tsx +15 -0
  38. package/src/lib/components/table/Table.tsx +27 -20
  39. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.tsx +1 -1
  40. package/src/lib/components/table/components/TableCell/TableCell.module.scss +9 -3
  41. package/src/lib/components/table/components/TableCell/TableCell.tsx +7 -1
  42. package/src/lib/components/table/components/TableContents/TableContents.module.scss +23 -24
  43. package/src/lib/components/table/components/TableContents/TableContents.test.tsx +22 -1
  44. package/src/lib/components/table/components/TableContents/TableContents.tsx +40 -31
  45. package/src/lib/components/table/components/TableSection/TableSection.module.scss +7 -0
  46. package/src/lib/components/table/components/TableSection/TableSection.tsx +32 -3
  47. package/src/lib/models/styles.ts +1 -0
  48. package/dist/esm/TableSection-CEhD4eoy.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -22624,8 +22624,8 @@ var Accordion = function (_a) {
22624
22624
  }) }));
22625
22625
  };
22626
22626
 
22627
- var css_248z$a = ".TableCell-module_th__2rjCU {\n vertical-align: middle;\n scroll-snap-align: end;\n width: 50%;\n}\n@media (min-width: 34rem) {\n .TableCell-module_th__2rjCU {\n width: auto;\n scroll-snap-align: unset;\n }\n}\n.TableCell-module_thNavigation__qZ2sY {\n width: 100%;\n}\n@media (min-width: 34rem) {\n .TableCell-module_thNavigation__qZ2sY {\n width: auto;\n }\n}\n\n.TableCell-module_fixedCell__cL3-m {\n position: sticky;\n left: 0;\n z-index: 2;\n}\n.TableCell-module_fixedCell__cL3-m:after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 1px;\n background-color: #f7f7fd;\n}\n@media (min-width: 34rem) {\n .TableCell-module_fixedCell__cL3-m {\n padding-left: 16px;\n }\n}\n\n.TableCell-module_fixedCard__2LO8s {\n position: sticky;\n left: 0;\n right: 0;\n z-index: 2;\n width: 100%;\n}";
22628
- var styles$a = {"th":"TableCell-module_th__2rjCU","thNavigation":"TableCell-module_thNavigation__qZ2sY","fixedCell":"TableCell-module_fixedCell__cL3-m","fixedCard":"TableCell-module_fixedCard__2LO8s"};
22627
+ var css_248z$a = ".TableCell-module_th__2rjCU {\n vertical-align: middle;\n scroll-snap-align: end;\n width: 50%;\n padding: 28px 24px;\n}\n@media (min-width: 34rem) {\n .TableCell-module_th__2rjCU {\n width: auto;\n scroll-snap-align: unset;\n }\n}\n.TableCell-module_thNavigation__qZ2sY {\n width: 100%;\n}\n@media (min-width: 34rem) {\n .TableCell-module_thNavigation__qZ2sY {\n width: auto;\n }\n}\n\n.TableCell-module_fixedCell__cL3-m {\n position: sticky;\n left: 0;\n z-index: 2;\n padding-left: 0;\n}\n.TableCell-module_fixedCell__cL3-m:after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 1px;\n background-color: #f7f7fd;\n}\n\n.TableCell-module_selectedColumnTop__1GcJz {\n border-radius: 16px 16px 0 0;\n}\n\n.TableCell-module_selectedColumnBottom__qiMke {\n border-radius: 0 0 16px 16px;\n}\n\n.TableCell-module_fixedCard__2LO8s {\n position: sticky;\n left: 0;\n right: 0;\n z-index: 2;\n width: 100%;\n}";
22628
+ var styles$a = {"th":"TableCell-module_th__2rjCU","thNavigation":"TableCell-module_thNavigation__qZ2sY","fixedCell":"TableCell-module_fixedCell__cL3-m","selectedColumnTop":"TableCell-module_selectedColumnTop__1GcJz","selectedColumnBottom":"TableCell-module_selectedColumnBottom__qiMke","fixedCard":"TableCell-module_fixedCard__2LO8s"};
22629
22629
  styleInject(css_248z$a);
22630
22630
 
22631
22631
  var css_248z$9 = "@media (max-width: 34rem) {\n .BaseCell-module_maxWidth__14Cly {\n max-width: calc(100% - 64px);\n }\n}\n\n.BaseCell-module_icon__1775U {\n margin: 2px;\n}\n\n.BaseCell-module_description__3_kfe {\n word-break: break-word;\n}";
@@ -22670,7 +22670,7 @@ var BaseCell = function (_a) {
22670
22670
  'jc-center': align === 'center',
22671
22671
  }), children: jsxRuntime.jsxs("div", { className: classNames('d-flex fd-column', alignClassName, (_b = {},
22672
22672
  _b[styles$9.maxWidth] = modalContent && align === 'center',
22673
- _b)), children: [jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [(rating === null || rating === void 0 ? void 0 : rating.value) && (jsxRuntime.jsx("span", { "data-testid": "table-cell-rating", title: "".concat(rating === null || rating === void 0 ? void 0 : rating.value, " out of 3"), children: validRatingValues.map(function (value) { return (jsxRuntime.jsx(SelectedIcon, { "aria-hidden": "true", color: value <= (rating === null || rating === void 0 ? void 0 : rating.value) ? 'neutral-900' : 'neutral-400', className: styles$9.icon, size: (rating === null || rating === void 0 ? void 0 : rating.type) === 'zap' ? 16 : 14 }, value)); }) })), checkmarkValue !== undefined && (jsxRuntime.jsx("span", { className: 'd-inline-block mx8', title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckThickIcon, { noMargin: true, "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "neutral-900" })) : (jsxRuntime.jsx(XIcon, { noMargin: true, "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "neutral-400" })) })), jsxRuntime.jsxs("div", { className: "d-inline", children: [text && fontVariant === 'NORMAL' && (jsxRuntime.jsx("div", { className: classNames("p-p d-inline", { 'ml8': align !== 'left' }), "data-testid": "table-cell-text", children: text })), text && fontVariant === 'PRICE' && (jsxRuntime.jsx("div", { className: "p-h1 p--serif tc-neutral-900", "data-testid": "table-cell-content", children: text })), text && fontVariant === 'TITLE' && (jsxRuntime.jsx("h2", { "aria-hidden": true, className: "tc-grey-800 p-h2 p--serif", children: text })), modalContent && openModal && (jsxRuntime.jsx("span", { className: "ml8", children: jsxRuntime.jsx(TableInfoButton, { onClick: function () {
22673
+ _b)), children: [jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [(rating === null || rating === void 0 ? void 0 : rating.value) && (jsxRuntime.jsx("span", { "data-testid": "table-cell-rating", title: "".concat(rating === null || rating === void 0 ? void 0 : rating.value, " out of 3"), children: validRatingValues.map(function (value) { return (jsxRuntime.jsx(SelectedIcon, { "aria-hidden": "true", color: value <= (rating === null || rating === void 0 ? void 0 : rating.value) ? 'neutral-900' : 'neutral-400', className: styles$9.icon, size: (rating === null || rating === void 0 ? void 0 : rating.type) === 'zap' ? 16 : 14 }, value)); }) })), checkmarkValue !== undefined && (jsxRuntime.jsx("span", { className: 'd-inline-block mx8', title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckThickIcon, { noMargin: true, "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "neutral-900" })) : (jsxRuntime.jsx(XIcon, { noMargin: true, "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "neutral-500" })) })), jsxRuntime.jsxs("div", { className: "d-inline", children: [text && fontVariant === 'NORMAL' && (jsxRuntime.jsx("div", { className: classNames("p-p d-inline", { 'ml8': align !== 'left' }), "data-testid": "table-cell-text", children: text })), text && fontVariant === 'PRICE' && (jsxRuntime.jsx("div", { className: "p-h1 p--serif tc-neutral-900", "data-testid": "table-cell-content", children: text })), text && fontVariant === 'TITLE' && (jsxRuntime.jsx("h2", { "aria-hidden": true, className: "tc-grey-800 p-h2 p--serif", children: text })), modalContent && openModal && (jsxRuntime.jsx("span", { className: "ml8", children: jsxRuntime.jsx(TableInfoButton, { onClick: function () {
22674
22674
  return openModal({
22675
22675
  title: modalTitle,
22676
22676
  body: modalContent,
@@ -22730,7 +22730,7 @@ var ButtonCell = function (_a) {
22730
22730
  var TableCell = React.memo(function (_a) {
22731
22731
  var _b;
22732
22732
  var _c;
22733
- var _d = _a.isFirstCellInRow, isFirstCellInRow = _d === void 0 ? false : _d, _e = _a.isHeader, isHeader = _e === void 0 ? false : _e, _f = _a.isNavigation, isNavigation = _f === void 0 ? false : _f, _g = _a.isTopLeftCell, isTopLeftCell = _g === void 0 ? false : _g, _h = _a.colSpan, colSpan = _h === void 0 ? 0 : _h, isBelowDesktop = _a.isBelowDesktop, cellProps = __rest$1(_a, ["isFirstCellInRow", "isHeader", "isNavigation", "isTopLeftCell", "colSpan", "isBelowDesktop"]);
22733
+ var _d = _a.isFirstCellInRow, isFirstCellInRow = _d === void 0 ? false : _d, _e = _a.isHeader, isHeader = _e === void 0 ? false : _e, _f = _a.isNavigation, isNavigation = _f === void 0 ? false : _f, _g = _a.isSelectedColumn, isSelectedColumn = _g === void 0 ? false : _g, selectedColumnPosition = _a.selectedColumnPosition, _h = _a.isTopLeftCell, isTopLeftCell = _h === void 0 ? false : _h, _j = _a.colSpan, colSpan = _j === void 0 ? 0 : _j, isBelowDesktop = _a.isBelowDesktop, cellProps = __rest$1(_a, ["isFirstCellInRow", "isHeader", "isNavigation", "isSelectedColumn", "selectedColumnPosition", "isTopLeftCell", "colSpan", "isBelowDesktop"]);
22734
22734
  // prettier-ignore
22735
22735
  var Tag = isNavigation
22736
22736
  ? 'div'
@@ -22742,23 +22742,25 @@ var TableCell = React.memo(function (_a) {
22742
22742
  var scope = {
22743
22743
  scope: thScope,
22744
22744
  };
22745
- return (jsxRuntime.jsxs(Tag, __assign({}, scope, { className: classNames('bg-white py24 px8', styles$a.th, (_b = {
22745
+ return (jsxRuntime.jsxs(Tag, __assign({}, scope, { className: classNames(isSelectedColumn ? 'bg-orange-50' : 'bg-white', styles$a.th, (_b = {
22746
22746
  'ta-left': isFirstCellInRow
22747
22747
  },
22748
22748
  _b[styles$a.thNavigation] = isNavigation,
22749
22749
  _b[styles$a.fixedCell] = isFirstCellInRow && colSpan < 1,
22750
22750
  _b[styles$a.fixedCard] = cellProps.type === 'CARD',
22751
+ _b[styles$a.selectedColumnTop] = selectedColumnPosition === 'top',
22752
+ _b[styles$a.selectedColumnBottom] = selectedColumnPosition === 'bottom',
22751
22753
  _b)), colSpan: isBelowDesktop && cellProps.type === 'CARD' ? 2 : colSpan, children: [!cellProps.type && (jsxRuntime.jsx(BaseCell, __assign({}, cellProps, { fontVariant: isTopLeftCell
22752
22754
  ? 'TITLE'
22753
22755
  : (_c = cellProps.fontVariant) !== null && _c !== void 0 ? _c : 'NORMAL' }))), cellProps.type === 'CTA' && jsxRuntime.jsx(CTACell, __assign({}, cellProps)), cellProps.type === 'BUTTON' && jsxRuntime.jsx(ButtonCell, __assign({}, cellProps)), cellProps.type === 'CARD' && jsxRuntime.jsx(CardCell, __assign({}, cellProps))] })));
22754
22756
  });
22755
22757
 
22756
- var css_248z$5 = ".Table-module_wrapper__2MMNq {\n position: relative;\n}\n\n.Table-module_container__3VFLP {\n overflow-x: auto;\n overflow-y: hidden;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n -webkit-overflow-scrolling: touch;\n scroll-snap-type: x mandatory;\n}\n.Table-module_container__3VFLP::-webkit-scrollbar {\n display: none;\n}\n@media (min-width: 34rem) {\n .Table-module_container__3VFLP {\n scroll-snap-type: unset;\n }\n}\n\n.Table-module_cardButton__3aMuL div {\n background-color: #FAF8F5;\n}\n.Table-module_cardButton__3aMuL:hover div {\n border-color: transparent !important;\n outline-color: transparent !important;\n box-shadow: none !important;\n background-color: #FCF7EF !important;\n}\n.Table-module_cardButton__3aMuL:focus-visible div {\n background-color: #FCF7EF !important;\n}\n\n.Table-module_stickyHeader__2uEpP {\n display: flex;\n position: sticky;\n z-index: 9;\n}\n\n@media (max-width: 34rem) {\n .Table-module_modalContent__1PNgv {\n min-width: initial;\n }\n}";
22758
+ var css_248z$5 = ".Table-module_wrapper__2MMNq {\n position: relative;\n border: 1px solid #f2f2f8;\n border-radius: 12px;\n padding: 24px 24px 0;\n}\n\n.Table-module_container__3VFLP {\n overflow-x: auto;\n overflow-y: hidden;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n -webkit-overflow-scrolling: touch;\n scroll-snap-type: x mandatory;\n}\n.Table-module_container__3VFLP::-webkit-scrollbar {\n display: none;\n}\n@media (min-width: 34rem) {\n .Table-module_container__3VFLP {\n scroll-snap-type: unset;\n }\n}\n\n.Table-module_cardButton__3aMuL div {\n background-color: #FAF8F5;\n}\n.Table-module_cardButton__3aMuL:hover div {\n border-color: transparent !important;\n outline-color: transparent !important;\n box-shadow: none !important;\n background-color: #FCF7EF !important;\n}\n.Table-module_cardButton__3aMuL:focus-visible div {\n background-color: #FCF7EF !important;\n}\n\n.Table-module_stickyHeader__2uEpP {\n display: flex;\n position: sticky;\n z-index: 9;\n}\n\n@media (max-width: 34rem) {\n .Table-module_modalContent__1PNgv {\n min-width: initial;\n }\n}";
22757
22759
  var styles$5 = {"wrapper":"Table-module_wrapper__2MMNq","container":"Table-module_container__3VFLP","cardButton":"Table-module_cardButton__3aMuL","stickyHeader":"Table-module_stickyHeader__2uEpP","modalContent":"Table-module_modalContent__1PNgv"};
22758
22760
  styleInject(css_248z$5);
22759
22761
 
22760
- var css_248z$4 = ".TableSection-module_table__sNbDq {\n border-collapse: collapse;\n table-layout: fixed;\n}\n@media (min-width: 34rem) {\n .TableSection-module_table__sNbDq {\n min-width: 845px;\n }\n}\n\n.TableSection-module_tr__UbkbE {\n min-height: 72px;\n}";
22761
- var styles$4 = {"table":"TableSection-module_table__sNbDq","tr":"TableSection-module_tr__UbkbE"};
22762
+ var css_248z$4 = ".TableSection-module_table__sNbDq {\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n@media (min-width: 34rem) {\n .TableSection-module_tableMultiplePlans__gaWQS {\n min-width: 845px;\n }\n}\n\n.TableSection-module_tr__UbkbE {\n min-height: 72px;\n border-bottom: 1px solid #e7e7ed;\n}\n.TableSection-module_tr__UbkbE:last-child {\n border-bottom: none;\n}";
22763
+ var styles$4 = {"table":"TableSection-module_table__sNbDq","tableMultiplePlans":"TableSection-module_tableMultiplePlans__gaWQS","tr":"TableSection-module_tr__UbkbE"};
22762
22764
  styleInject(css_248z$4);
22763
22765
 
22764
22766
  var isBaseCell = function (tableCellData) {
@@ -22766,9 +22768,15 @@ var isBaseCell = function (tableCellData) {
22766
22768
  };
22767
22769
 
22768
22770
  var TableSection = function (_a) {
22769
- var className = _a.className, tableCellRows = _a.tableCellRows, _b = _a.hideColumns, hideColumns = _b === void 0 ? [] : _b, _c = _a.hideRows, hideRows = _c === void 0 ? [] : _c, hideHeader = _a.hideHeader, openModal = _a.openModal, title = _a.title, width = _a.width, cellReplacements = _a.cellReplacements, imageComponent = _a.imageComponent;
22771
+ var _b;
22772
+ var _c;
22773
+ var className = _a.className, tableCellRows = _a.tableCellRows, _d = _a.hideColumns, hideColumns = _d === void 0 ? [] : _d, _e = _a.hideRows, hideRows = _e === void 0 ? [] : _e, hideHeader = _a.hideHeader, openModal = _a.openModal, title = _a.title, width = _a.width, cellReplacements = _a.cellReplacements, imageComponent = _a.imageComponent, selectedColumn = _a.selectedColumn;
22770
22774
  var headerRow = tableCellRows === null || tableCellRows === void 0 ? void 0 : tableCellRows[0];
22771
22775
  var isBelowDesktop = useMediaQuery('BELOW_DESKTOP');
22776
+ var firstVisibleBodyRowIndex = tableCellRows.findIndex(function (_, index) { return index > 0 && !hideRows.includes(index); });
22777
+ var lastVisibleRowIndex = tableCellRows.reduce(function (last, row, index) {
22778
+ return index > 0 && !hideRows.includes(index) && row.length > 1 ? index : last;
22779
+ }, -1);
22772
22780
  var getModalTitleFromColumnHeader = function (cellIndex) {
22773
22781
  var _a;
22774
22782
  var firstCellInColumn = (_a = tableCellRows === null || tableCellRows === void 0 ? void 0 : tableCellRows[0]) === null || _a === void 0 ? void 0 : _a[cellIndex];
@@ -22793,7 +22801,10 @@ var TableSection = function (_a) {
22793
22801
  };
22794
22802
  var isVisibleColumn = React.useCallback(function (cellIndex) { return !hideColumns.includes(cellIndex); }, [hideColumns]);
22795
22803
  var isVisibleRow = React.useCallback(function (rowIndex) { return !hideRows.includes(rowIndex); }, [hideRows]);
22796
- return (jsxRuntime.jsxs("table", { className: classNames(className, 'w100', styles$4.table), width: width, children: [jsxRuntime.jsx("caption", { className: "sr-only", children: title }), headerRow && (jsxRuntime.jsx("thead", { className: hideHeader ? 'sr-only' : '', children: jsxRuntime.jsx("tr", { children: headerRow.map(function (tableCellData, cellIndex) {
22804
+ var visibleColumnsLength = (_c = headerRow === null || headerRow === void 0 ? void 0 : headerRow.filter(function (_, cellIndex) { return isVisibleColumn(cellIndex); }).length) !== null && _c !== void 0 ? _c : 0;
22805
+ return (jsxRuntime.jsxs("table", { className: classNames(className, 'w100', styles$4.table, (_b = {},
22806
+ _b[styles$4.tableMultiplePlans] = visibleColumnsLength > 2,
22807
+ _b)), width: width, children: [jsxRuntime.jsx("caption", { className: "sr-only", children: title }), headerRow && (jsxRuntime.jsx("thead", { className: hideHeader ? 'sr-only' : '', children: jsxRuntime.jsx("tr", { children: headerRow.map(function (tableCellData, cellIndex) {
22797
22808
  var isFirstCellInRow = cellIndex === 0;
22798
22809
  var cellReplacementData = (tableCellData.cellId &&
22799
22810
  (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[tableCellData.cellId])) ||
@@ -22802,29 +22813,39 @@ var TableSection = function (_a) {
22802
22813
  openModal: openModal,
22803
22814
  modalTitle: (isBaseCell(tableCellData) && tableCellData.text) ||
22804
22815
  getModalTitleFromColumnHeader(cellIndex),
22805
- align: isFirstCellInRow ? 'left' : 'center',
22816
+ align: 'left',
22806
22817
  });
22807
- return (isVisibleColumn(cellIndex) && (jsxRuntime.jsx(TableCell, __assign({ isBelowDesktop: isBelowDesktop, isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow }, cellProps, { imageComponent: imageComponent }), cellIndex)));
22818
+ return (isVisibleColumn(cellIndex) && (jsxRuntime.jsx(TableCell, __assign({ isBelowDesktop: isBelowDesktop, isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow, isSelectedColumn: selectedColumn === cellIndex, selectedColumnPosition: selectedColumn === cellIndex ? 'top' : undefined }, cellProps, { imageComponent: imageComponent }), cellIndex)));
22808
22819
  }) }) })), jsxRuntime.jsx("tbody", { children: tableCellRows.map(function (row, rowIndex) {
22809
22820
  return rowIndex > 0 && isVisibleRow(rowIndex) && (jsxRuntime.jsx("tr", { className: styles$4.tr, children: row.map(function (tableCellData, cellIndex) {
22810
22821
  var key = "".concat(rowIndex, "-").concat(cellIndex);
22811
22822
  var isFirstCellInRow = cellIndex === 0;
22812
22823
  var titleFromRow = getModalTitleFromRowHeader(row);
22824
+ var isSelected = selectedColumn === cellIndex;
22825
+ var getSelectedColumnPosition = function () {
22826
+ if (!isSelected)
22827
+ return undefined;
22828
+ if (rowIndex === lastVisibleRowIndex)
22829
+ return 'bottom';
22830
+ if (hideHeader && rowIndex === firstVisibleBodyRowIndex)
22831
+ return 'top';
22832
+ return 'middle';
22833
+ };
22813
22834
  var cellReplacementData = (tableCellData.cellId &&
22814
22835
  (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[tableCellData.cellId])) ||
22815
22836
  {};
22816
22837
  var cellProps = __assign(__assign(__assign({}, tableCellData), cellReplacementData), {
22817
22838
  openModal: openModal,
22818
22839
  modalTitle: (tableCellData === null || tableCellData === void 0 ? void 0 : tableCellData.modalTitle) || titleFromRow,
22819
- align: isFirstCellInRow ? 'left' : 'center',
22840
+ align: 'left',
22820
22841
  });
22821
- return (!hideColumns.includes(cellIndex) && (jsxRuntime.jsx(TableCell, __assign({ isBelowDesktop: isBelowDesktop, isFirstCellInRow: isFirstCellInRow }, cellProps, { imageComponent: imageComponent }), key)));
22842
+ return (!hideColumns.includes(cellIndex) && (jsxRuntime.jsx(TableCell, __assign({ isBelowDesktop: isBelowDesktop, isFirstCellInRow: isFirstCellInRow, isSelectedColumn: isSelected, selectedColumnPosition: getSelectedColumnPosition() }, cellProps, { imageComponent: imageComponent }), key)));
22822
22843
  }) }, rowIndex));
22823
22844
  }) })] }));
22824
22845
  };
22825
22846
 
22826
- var css_248z$3 = ".TableContents-module_cardWrapper__2OVMv {\n height: 88px;\n}\n\n.TableContents-module_cardButton__1mVp_ div {\n background-color: #FAF8F5;\n}\n.TableContents-module_cardButton__1mVp_:hover div {\n border-color: transparent !important;\n outline-color: transparent !important;\n box-shadow: none !important;\n background-color: #FCF7EF !important;\n}\n.TableContents-module_cardButton__1mVp_:focus-visible div {\n background-color: #FCF7EF !important;\n}\n\n.TableContents-module_card__Mmz6h {\n position: absolute;\n left: 0;\n right: 0;\n z-index: 3;\n}\n\n.TableContents-module_cardIcon__2DXbp {\n width: 20px;\n margin-right: 8px;\n}";
22827
- var styles$3 = {"cardWrapper":"TableContents-module_cardWrapper__2OVMv","cardButton":"TableContents-module_cardButton__1mVp_","card":"TableContents-module_card__Mmz6h","cardIcon":"TableContents-module_cardIcon__2DXbp"};
22847
+ var css_248z$3 = ".TableContents-module_sectionButtonWrapper__12yA7 {\n height: 74px;\n}\n\n.TableContents-module_sectionButton__1pY12 {\n position: absolute;\n left: 24px;\n right: 24px;\n z-index: 3;\n height: 74px;\n border: none;\n border-bottom: 1px solid #e7e7ed;\n color: #26262e;\n padding: 0;\n}\n\nbutton.TableContents-module_sectionButton__1pY12 {\n cursor: pointer;\n}\nbutton.TableContents-module_sectionButton__1pY12:hover {\n color: #696971;\n}\nbutton.TableContents-module_sectionButton__1pY12:hover .p-h3 {\n color: #696971;\n}\n\ndiv:last-child > .TableContents-module_sectionButtonWrapper__12yA7 > .TableContents-module_sectionButton__1pY12 {\n border-bottom: none;\n}";
22848
+ var styles$3 = {"sectionButtonWrapper":"TableContents-module_sectionButtonWrapper__12yA7","sectionButton":"TableContents-module_sectionButton__1pY12"};
22828
22849
  styleInject(css_248z$3);
22829
22850
 
22830
22851
  var css_248z$2 = ".Collapsible-module_collapsible__2wWKs {\n transition: max-height 0.3s ease-in-out;\n overflow-y: clip;\n}";
@@ -22868,7 +22889,7 @@ var Collapsible = function (_a) {
22868
22889
 
22869
22890
  var TableContents = function (_a) {
22870
22891
  var _b, _c;
22871
- var className = _a.className, collapsibleSections = _a.collapsibleSections, scrollOnOpen = _a.scrollOnOpen, _d = _a.scrollTopOffset, scrollTopOffset = _d === void 0 ? 0 : _d, stickyHeaderRef = _a.stickyHeaderRef, tableData = _a.tableData, _e = _a.hideColumns, hideColumns = _e === void 0 ? [] : _e, hideDetails = _a.hideDetails, _f = _a.hideRows, hideRows = _f === void 0 ? [] : _f, isMobile = _a.isMobile, openModal = _a.openModal, shouldHideDetails = _a.shouldHideDetails, title = _a.title, cellReplacements = _a.cellReplacements, imageComponent = _a.imageComponent;
22892
+ var className = _a.className, collapsibleSections = _a.collapsibleSections, scrollOnOpen = _a.scrollOnOpen, _d = _a.scrollTopOffset, scrollTopOffset = _d === void 0 ? 0 : _d, stickyHeaderRef = _a.stickyHeaderRef, tableData = _a.tableData, _e = _a.hideColumns, hideColumns = _e === void 0 ? [] : _e, hideDetails = _a.hideDetails, _f = _a.hideRows, hideRows = _f === void 0 ? [] : _f, isMobile = _a.isMobile, openModal = _a.openModal, shouldHideDetails = _a.shouldHideDetails, title = _a.title, cellReplacements = _a.cellReplacements, imageComponent = _a.imageComponent, selectedColumn = _a.selectedColumn;
22872
22893
  var _g = React.useState(null), isSectionOpen = _g[0], setOpenSection = _g[1];
22873
22894
  var lastToggledSection = React.useRef(null);
22874
22895
  var sectionRefs = React.useRef({});
@@ -22905,15 +22926,9 @@ var TableContents = function (_a) {
22905
22926
  var sectionHideRows = hideRows
22906
22927
  .map(function (globalRowIndex) { return globalRowIndex - globalRowOffset; })
22907
22928
  .filter(function (localRowIndex) { return localRowIndex >= 0 && localRowIndex < rows.length; });
22908
- var result = (isFirstSection || isVisible) && (jsxRuntime.jsxs("div", { ref: function (el) { sectionRefs.current[index] = el; }, children: [(section === null || section === void 0 ? void 0 : section.title) && (jsxRuntime.jsx("div", { className: styles$3.cardWrapper, children: jsxRuntime.jsx("div", { className: classNames(styles$3.card, 'p0'), children: jsxRuntime.jsx(Card, __assign({ actionIcon: isExpanded ? (jsxRuntime.jsx(ChevronUpIcon, { size: 24 })) : (jsxRuntime.jsx(ChevronDownIcon, { size: 24 })), "aria-expanded": isExpanded ? 'true' : 'false', "aria-hidden": true, classNames: {
22909
- wrapper: 'pl16',
22910
- buttonWrapper: styles$3.cardButton,
22911
- icon: classNames(styles$3.cardIcon, 'tc-neutral-900'),
22912
- }, dropShadow: false, icon: renderedIcon, title: section.title, titleVariant: "medium", variant: "primary" }, (collapsibleSections
22913
- ? {
22914
- onClick: function () { return handleToggleSection(index); },
22915
- }
22916
- : {}))) }) })), jsxRuntime.jsx(Collapsible, { isExpanded: isExpanded, onTransitionEnd: function () { return handleScrollToSection(index); }, children: jsxRuntime.jsx(TableSection, { className: classNames(className, 'mb24'), tableCellRows: isFirstSection ? rows : __spreadArray([firstHeadRow], rows, true), hideColumns: hideColumns, hideRows: sectionHideRows, hideHeader: true, openModal: openModal, title: "".concat(title).concat((section === null || section === void 0 ? void 0 : section.title) ? " - ".concat(section.title) : ''), width: tableWidth, cellReplacements: cellReplacements, imageComponent: imageComponent }) })] }, index));
22929
+ var result = (isFirstSection || isVisible) && (jsxRuntime.jsxs("div", { ref: function (el) { sectionRefs.current[index] = el; }, children: [(section === null || section === void 0 ? void 0 : section.title) && (jsxRuntime.jsx("div", { className: styles$3.sectionButtonWrapper, children: collapsibleSections ? (jsxRuntime.jsxs("button", { type: "button", "aria-expanded": isExpanded, className: classNames('d-flex ai-center jc-between ta-left bg-white', styles$3.sectionButton), onClick: function () { return handleToggleSection(index); }, children: [jsxRuntime.jsxs("span", { className: "d-flex ai-center gap8", children: [renderedIcon, jsxRuntime.jsx("span", { className: "p-h3", children: section.title })] }), isExpanded ? (jsxRuntime.jsx(ChevronUpIcon, { size: 20 })) : (jsxRuntime.jsx(ChevronDownIcon, { size: 20 }))] })) : (jsxRuntime.jsx("div", { className: classNames('d-flex ai-center jc-between ta-left bg-white', styles$3.sectionButton), children: jsxRuntime.jsxs("span", { className: "d-flex ai-center gap8", children: [renderedIcon, jsxRuntime.jsx("span", { className: "p-h3", children: section.title })] }) })) })), jsxRuntime.jsx(Collapsible, { isExpanded: isExpanded, onTransitionEnd: function () { return handleScrollToSection(index); }, children: jsxRuntime.jsx(TableSection, { className: classNames(className, 'mb16', {
22930
+ mt16: !!(section === null || section === void 0 ? void 0 : section.title),
22931
+ }), tableCellRows: isFirstSection ? rows : __spreadArray([firstHeadRow], rows, true), hideColumns: hideColumns, hideRows: sectionHideRows, hideHeader: true, openModal: openModal, title: "".concat(title).concat((section === null || section === void 0 ? void 0 : section.title) ? " - ".concat(section.title) : ''), width: tableWidth, cellReplacements: cellReplacements, imageComponent: imageComponent, selectedColumn: selectedColumn }) })] }, index));
22917
22932
  // Update global offset for next section (excluding header row for non-first sections)
22918
22933
  globalRowOffset += rows.length;
22919
22934
  return result;
@@ -23014,24 +23029,24 @@ var defaultTextOverrides = {
23014
23029
  };
23015
23030
  var Table = function (_a) {
23016
23031
  var _b, _c, _d, _e, _f, _g, _h, _j;
23017
- var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _k = _a.hideColumns, hideColumns = _k === void 0 ? [] : _k, hideDetails = _a.hideDetails, _l = _a.hideRows, hideRows = _l === void 0 ? [] : _l, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, scrollOnOpen = _a.scrollOnOpen, _m = _a.scrollTopOffset, scrollTopOffset = _m === void 0 ? 0 : _m, _o = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _o === void 0 ? 0 : _o, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title, externalActiveSection = _a.activeSection, _p = _a.hideTableNavigation, hideTableNavigation = _p === void 0 ? false : _p;
23032
+ var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _k = _a.hideColumns, hideColumns = _k === void 0 ? [] : _k, hideDetails = _a.hideDetails, _l = _a.hideRows, hideRows = _l === void 0 ? [] : _l, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, scrollOnOpen = _a.scrollOnOpen, _m = _a.scrollTopOffset, scrollTopOffset = _m === void 0 ? 0 : _m, _o = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _o === void 0 ? 0 : _o, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title, externalActiveSection = _a.activeSection, _p = _a.hideTableNavigation, hideTableNavigation = _p === void 0 ? false : _p, _q = _a.hideStickyHeader, hideStickyHeader = _q === void 0 ? false : _q, _r = _a.showSelectedColumn, showSelectedColumn = _r === void 0 ? false : _r;
23018
23033
  var textOverrides = __assign(__assign({}, defaultTextOverrides), definedTextOverrides);
23019
23034
  var isMobile = useMediaQuery('BELOW_MOBILE');
23020
- var _q = React.useState(null), infoModalData = _q[0], setInfoModalData = _q[1];
23021
- var _r = React.useState(true), shouldHideDetails = _r[0], setShouldHideDetails = _r[1];
23035
+ var _s = React.useState(null), infoModalData = _s[0], setInfoModalData = _s[1];
23036
+ var _t = React.useState(true), shouldHideDetails = _t[0], setShouldHideDetails = _t[1];
23022
23037
  var containerRef = React.useRef(null);
23023
23038
  var headerRef = React.useRef(null);
23024
23039
  var stickyHeaderRef = React.useRef(null);
23025
23040
  var columnsLength = tableData[0].rows[0].length;
23026
23041
  useScrollSync(headerRef, containerRef, !isMobile);
23027
- var _s = useTableNavigation({
23042
+ var _u = useTableNavigation({
23028
23043
  enabled: isMobile,
23029
23044
  containerRef: containerRef,
23030
23045
  onSelectionChanged: onSelectionChanged,
23031
- }), activeSection = _s.activeSection, navigateTable = _s.navigateTable, setActiveSection = _s.setActiveSection;
23046
+ }), activeSection = _u.activeSection, navigateTable = _u.navigateTable, setActiveSection = _u.setActiveSection;
23032
23047
  var titleCell = __assign({ text: '' }, (((_d = (_c = (_b = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _b === void 0 ? void 0 : _b.rows) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d[0]) || {}));
23033
23048
  var currentActiveSection = (_g = (_f = (_e = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _e === void 0 ? void 0 : _e.rows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g[activeSection];
23034
- var currentActiveSectionReplacements = (currentActiveSection.cellId &&
23049
+ var currentActiveSectionReplacements = ((currentActiveSection === null || currentActiveSection === void 0 ? void 0 : currentActiveSection.cellId) &&
23035
23050
  (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[currentActiveSection.cellId])) ||
23036
23051
  {};
23037
23052
  var activeCellProps = __assign(__assign({}, currentActiveSection), currentActiveSectionReplacements);
@@ -23045,7 +23060,7 @@ var Table = function (_a) {
23045
23060
  setActiveSection(externalActiveSection - 1);
23046
23061
  }
23047
23062
  }, [externalActiveSection]);
23048
- return (jsxRuntime.jsxs("div", { className: classNames(styles$5.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(titleCell === null || titleCell === void 0 ? void 0 : titleCell.text) && (jsxRuntime.jsx(TableCell, __assign({}, titleCell, { align: "left", isNavigation: true, isTopLeftCell: true, type: undefined }))), !hideTableNavigation && (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, (isBaseCell(currentActiveSection)
23063
+ return (jsxRuntime.jsxs("div", { className: classNames(styles$5.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(titleCell === null || titleCell === void 0 ? void 0 : titleCell.text) && (jsxRuntime.jsx(TableCell, __assign({}, titleCell, { align: "left", isNavigation: true, isTopLeftCell: true, type: undefined }))), !hideTableNavigation && currentActiveSection && (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, (isBaseCell(currentActiveSection)
23049
23064
  ? {
23050
23065
  openModal: function (body) {
23051
23066
  return handleOpenModal({
@@ -23054,7 +23069,7 @@ var Table = function (_a) {
23054
23069
  });
23055
23070
  },
23056
23071
  }
23057
- : {}), activeCellProps, { imageComponent: imageComponent, isNavigation: true })) }))] })) : (jsxRuntime.jsx("div", { ref: stickyHeaderRef, "aria-hidden": true, className: styles$5.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsxRuntime.jsx("div", { className: styles$5.container, ref: headerRef, children: jsxRuntime.jsx(TableSection, { cellReplacements: cellReplacements, className: className, hideColumns: hideColumns, hideRows: hideRows, openModal: handleOpenModal, tableCellRows: [(_j = (_h = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _h === void 0 ? void 0 : _h.rows) === null || _j === void 0 ? void 0 : _j[0]], title: title, imageComponent: imageComponent }) }) })), jsxRuntime.jsx("div", { ref: containerRef, className: classNames(styles$5.container, 'pb8'), children: jsxRuntime.jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, scrollOnOpen: scrollOnOpen, scrollTopOffset: scrollTopOffset, stickyHeaderRef: stickyHeaderRef, hideColumns: hideColumns, hideDetails: hideDetails, hideRows: hideRows, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal, cellReplacements: cellReplacements, imageComponent: imageComponent }) }), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 1 && hideDetails && (jsxRuntime.jsx(Card, { "data-testid": "show-hide-details", classNames: {
23072
+ : {}), activeCellProps, { imageComponent: imageComponent, isNavigation: true })) }))] })) : (!hideStickyHeader && (jsxRuntime.jsx("div", { ref: stickyHeaderRef, "aria-hidden": true, className: styles$5.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsxRuntime.jsx("div", { className: styles$5.container, ref: headerRef, children: jsxRuntime.jsx(TableSection, { cellReplacements: cellReplacements, className: className, hideColumns: hideColumns, hideRows: hideRows, openModal: handleOpenModal, tableCellRows: [(_j = (_h = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _h === void 0 ? void 0 : _h.rows) === null || _j === void 0 ? void 0 : _j[0]], title: title, imageComponent: imageComponent }) }) }))), jsxRuntime.jsx("div", { ref: containerRef, className: classNames(styles$5.container, 'pb8'), children: jsxRuntime.jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, scrollOnOpen: scrollOnOpen, scrollTopOffset: scrollTopOffset, stickyHeaderRef: stickyHeaderRef, hideColumns: hideColumns, hideDetails: hideDetails, hideRows: hideRows, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal, cellReplacements: cellReplacements, imageComponent: imageComponent, selectedColumn: showSelectedColumn ? activeSection : undefined }) }), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 1 && hideDetails && (jsxRuntime.jsx(Card, { "data-testid": "show-hide-details", classNames: {
23058
23073
  buttonWrapper: classNames(styles$5.cardButton, 'm8 mt32'),
23059
23074
  title: 'd-flex gap8 ai-center jc-center fw-bold',
23060
23075
  }, title: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [shouldHideDetails