@popsure/dirty-swan 0.54.4 → 0.54.5

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 (67) hide show
  1. package/dist/cjs/index.js +58 -46
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/table/Table.d.ts +3 -2
  4. package/dist/cjs/lib/components/table/Table.stories.d.ts +1 -1
  5. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +7 -3
  6. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +2 -2
  7. package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +1 -0
  8. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +3 -1
  9. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +3 -2
  10. package/dist/cjs/lib/components/table/components/TableCell/TableCell.d.ts +4 -3
  11. package/dist/cjs/lib/components/table/components/TableContents/TableContents.d.ts +3 -2
  12. package/dist/cjs/lib/components/table/components/TableSection/TableSection.d.ts +3 -2
  13. package/dist/cjs/lib/components/table/types.d.ts +1 -3
  14. package/dist/esm/{TableSection-f6d0028e.js → TableSection-1d481798.js} +26 -30
  15. package/dist/esm/TableSection-1d481798.js.map +1 -0
  16. package/dist/esm/components/table/Table.js +11 -7
  17. package/dist/esm/components/table/Table.js.map +1 -1
  18. package/dist/esm/components/table/Table.stories.js +26 -4
  19. package/dist/esm/components/table/Table.stories.js.map +1 -1
  20. package/dist/esm/components/table/Table.test.js +15 -2
  21. package/dist/esm/components/table/Table.test.js.map +1 -1
  22. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js +19 -7
  23. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js.map +1 -1
  24. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js +2 -2
  25. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js.map +1 -1
  26. package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -1
  27. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js +2 -2
  28. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js.map +1 -1
  29. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js +8 -3
  30. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js.map +1 -1
  31. package/dist/esm/components/table/components/TableCell/TableCell.js +3 -3
  32. package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
  33. package/dist/esm/components/table/components/TableCell/TableCell.test.js +4 -1
  34. package/dist/esm/components/table/components/TableCell/TableCell.test.js.map +1 -1
  35. package/dist/esm/components/table/components/TableContents/TableContents.js +3 -3
  36. package/dist/esm/components/table/components/TableContents/TableContents.js.map +1 -1
  37. package/dist/esm/components/table/components/TableContents/TableContents.test.js +1 -1
  38. package/dist/esm/components/table/components/TableSection/TableSection.js +1 -1
  39. package/dist/esm/components/table/components/TableSection/TableSection.test.js +1 -1
  40. package/dist/esm/index.js +1 -1
  41. package/dist/esm/lib/components/table/Table.d.ts +3 -2
  42. package/dist/esm/lib/components/table/Table.stories.d.ts +1 -1
  43. package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +7 -3
  44. package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +2 -2
  45. package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +1 -0
  46. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +3 -1
  47. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +3 -2
  48. package/dist/esm/lib/components/table/components/TableCell/TableCell.d.ts +4 -3
  49. package/dist/esm/lib/components/table/components/TableContents/TableContents.d.ts +3 -2
  50. package/dist/esm/lib/components/table/components/TableSection/TableSection.d.ts +3 -2
  51. package/dist/esm/lib/components/table/types.d.ts +1 -3
  52. package/package.json +1 -1
  53. package/src/lib/components/table/Table.stories.tsx +48 -11
  54. package/src/lib/components/table/Table.test.tsx +23 -1
  55. package/src/lib/components/table/Table.tsx +25 -6
  56. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.module.scss +7 -5
  57. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.tsx +2 -0
  58. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.tsx +71 -32
  59. package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +1 -0
  60. package/src/lib/components/table/components/TableCell/CTACell/CTACell.stories.tsx +5 -1
  61. package/src/lib/components/table/components/TableCell/CTACell/CTACell.tsx +13 -6
  62. package/src/lib/components/table/components/TableCell/TableCell.test.tsx +4 -1
  63. package/src/lib/components/table/components/TableCell/TableCell.tsx +44 -41
  64. package/src/lib/components/table/components/TableContents/TableContents.tsx +4 -1
  65. package/src/lib/components/table/components/TableSection/TableSection.tsx +44 -35
  66. package/src/lib/components/table/types.ts +5 -3
  67. package/dist/esm/TableSection-f6d0028e.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -14269,8 +14269,8 @@ var css_248z$8 = ".TableCell-module_th__2rjCU {\n vertical-align: middle;\n sc
14269
14269
  var styles$8 = {"th":"TableCell-module_th__2rjCU","fixedCell":"TableCell-module_fixedCell__cL3-m"};
14270
14270
  styleInject(css_248z$8);
14271
14271
 
14272
- var css_248z$7 = ".BaseCell-module_infoButton__VCstV {\n min-height: initial;\n height: initial;\n width: initial;\n padding: 0;\n}\n\n.BaseCell-module_icon__1775U {\n margin: 2px;\n}\n\n.BaseCell-module_bigWithUnderline__2xx5X {\n position: relative;\n display: none;\n}\n.BaseCell-module_bigWithUnderline__2xx5X:after {\n content: \"\";\n display: block;\n position: absolute;\n top: calc( 50% + 16px );\n height: 4px;\n width: 100%;\n max-width: 140px;\n background-color: #8e8cee;\n}\n@media (min-width: 34rem) {\n .BaseCell-module_bigWithUnderline__2xx5X {\n display: flex;\n }\n}";
14273
- var styles$7 = {"infoButton":"BaseCell-module_infoButton__VCstV","icon":"BaseCell-module_icon__1775U","bigWithUnderline":"BaseCell-module_bigWithUnderline__2xx5X"};
14272
+ var css_248z$7 = ".BaseCell-module_relative__1v2X0 {\n position: relative;\n}\n\n.BaseCell-module_infoButtonAbsolute__Mpjrz {\n position: absolute;\n right: -32px;\n}\n\n.BaseCell-module_icon__1775U {\n margin: 2px;\n}\n\n.BaseCell-module_bigWithUnderline__2xx5X {\n position: relative;\n display: none;\n}\n.BaseCell-module_bigWithUnderline__2xx5X:after {\n content: \"\";\n display: block;\n position: absolute;\n top: calc( 50% + 16px );\n height: 4px;\n width: 100%;\n max-width: 140px;\n background-color: #8e8cee;\n}\n@media (min-width: 34rem) {\n .BaseCell-module_bigWithUnderline__2xx5X {\n display: flex;\n }\n}";
14273
+ var styles$7 = {"relative":"BaseCell-module_relative__1v2X0","infoButtonAbsolute":"BaseCell-module_infoButtonAbsolute__Mpjrz","icon":"BaseCell-module_icon__1775U","bigWithUnderline":"BaseCell-module_bigWithUnderline__2xx5X"};
14274
14274
  styleInject(css_248z$7);
14275
14275
 
14276
14276
  var css_248z$6 = ".MiniProgressBar-module_progressBar__2K07F {\n margin-bottom: 4px;\n}\n.MiniProgressBar-module_progressBar__2K07F rect {\n fill: #ebebff;\n}\n\n.MiniProgressBar-module_filledBars1__ZhQbV rect:first-child {\n fill: #91919c;\n}\n\n.MiniProgressBar-module_filledBars2__2lH_z rect:nth-child(-n+2) {\n fill: #91919c;\n}\n\n.MiniProgressBar-module_filledBars3__1OKUj rect:nth-child(-n+3) {\n fill: #b0cdf3;\n}\n\n.MiniProgressBar-module_filledBars4__T9kuj rect:nth-child(-n+4) {\n fill: #b0cdf3;\n}\n\n.MiniProgressBar-module_filledBars5__WxVpb rect {\n fill: #8e8cee;\n}";
@@ -14295,7 +14295,7 @@ var progressLookup = {
14295
14295
  '100%': 5,
14296
14296
  };
14297
14297
  var BaseCell = function (_a) {
14298
- var _b = _a.align, align = _b === void 0 ? 'center' : _b, checkmarkValue = _a.checkmarkValue, _c = _a.fontVariant, fontVariant = _c === void 0 ? 'NORMAL' : _c, _d = _a.description, description = _d === void 0 ? '' : _d, _e = _a.modalContent, modalContent = _e === void 0 ? '' : _e, openModal = _a.openModal, rating = _a.rating, _f = _a.text, text = _f === void 0 ? '' : _f;
14298
+ var _b = _a.align, align = _b === void 0 ? 'center' : _b, checkmarkValue = _a.checkmarkValue, _c = _a.description, description = _c === void 0 ? '' : _c, _d = _a.fontVariant, fontVariant = _d === void 0 ? 'NORMAL' : _d, _e = _a.hideProgressBar, hideProgressBar = _e === void 0 ? false : _e, _f = _a.modalTitle, modalTitle = _f === void 0 ? '' : _f, _g = _a.modalContent, modalContent = _g === void 0 ? '' : _g, openModal = _a.openModal, rating = _a.rating, _h = _a.text, text = _h === void 0 ? '' : _h;
14299
14299
  var alignClassName = {
14300
14300
  center: 'ta-center jc-center ai-center',
14301
14301
  left: 'ta-left jc-start',
@@ -14303,10 +14303,22 @@ var BaseCell = function (_a) {
14303
14303
  }[align];
14304
14304
  var validRatingValues = [1, 2, 3];
14305
14305
  var SelectedIcon = (rating === null || rating === void 0 ? void 0 : rating.type) === 'zap' ? ZapFilledIcon : StarFilledIcon;
14306
- var progressBarValue = typeof text === 'string' ? progressLookup[text] : undefined;
14307
- return (jsxRuntime.jsxs("div", { className: classNames$1('d-flex gap8 ai-center', {
14306
+ var progressBarValue = !hideProgressBar && typeof text === 'string'
14307
+ ? progressLookup[text]
14308
+ : undefined;
14309
+ return (jsxRuntime.jsx("div", { className: classNames$1('d-flex gap8 ai-center', {
14308
14310
  'jc-center': align === 'center',
14309
- }), children: [jsxRuntime.jsxs("div", { className: classNames$1('d-flex fd-column', alignClassName), children: [progressBarValue !== undefined && (jsxRuntime.jsx(MiniProgressBar, { nFilledBars: progressBarValue })), (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) ? 'primary-500' : 'grey-400', className: styles$7.icon }, value)); }) })), jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [checkmarkValue !== undefined && (jsxRuntime.jsx("span", { title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckIcon, { "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "primary-500" })) : (jsxRuntime.jsx(XIcon, { "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "grey-400" })) })), text && fontVariant === 'NORMAL' && (jsxRuntime.jsx("div", { className: "p-p", "data-testid": "table-cell-text", children: text })), text && fontVariant === 'PRICE' && (jsxRuntime.jsx("div", { className: "p-h1 p--serif tc-primary-500", "data-testid": "table-cell-content", children: text })), text && fontVariant === 'BIG_WITH_UNDERLINE' && (jsxRuntime.jsx("div", { "aria-hidden": true, className: classNames$1('tc-grey-800 p-h2 p--serif', styles$7.bigWithUnderline), children: text }))] }), description && (jsxRuntime.jsx("div", { className: classNames$1('d-flex p-p--small tc-grey-500', alignClassName), children: description }))] }), modalContent && openModal && (jsxRuntime.jsx(TableInfoButton, { onClick: function () { return openModal(modalContent); } }))] }));
14311
+ }), children: jsxRuntime.jsxs("div", { className: classNames$1('d-flex fd-column', alignClassName, styles$7.relative), children: [progressBarValue !== undefined && (jsxRuntime.jsx(MiniProgressBar, { nFilledBars: progressBarValue })), (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) ? 'primary-500' : 'grey-400', className: styles$7.icon }, value)); }) })), jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [checkmarkValue !== undefined && (jsxRuntime.jsx("span", { title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckIcon, { "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "primary-500" })) : (jsxRuntime.jsx(XIcon, { "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "grey-400" })) })), jsxRuntime.jsxs("div", { className: "d-inline", children: [text && fontVariant === 'NORMAL' && (jsxRuntime.jsx("div", { className: "p-p d-inline", "data-testid": "table-cell-text", children: text })), text && fontVariant === 'PRICE' && (jsxRuntime.jsx("div", { className: "p-h1 p--serif tc-primary-500", "data-testid": "table-cell-content", children: text })), text && fontVariant === 'BIG_WITH_UNDERLINE' && (jsxRuntime.jsx("div", { "aria-hidden": true, className: classNames$1('tc-grey-800 p-h2 p--serif', styles$7.bigWithUnderline), children: text })), modalContent && openModal && align == 'left' && (jsxRuntime.jsx("span", { className: "ml8", children: jsxRuntime.jsx(TableInfoButton, { onClick: function () {
14312
+ return openModal({
14313
+ title: modalTitle,
14314
+ body: modalContent,
14315
+ });
14316
+ } }) }))] })] }), description && (jsxRuntime.jsx("div", { className: classNames$1('d-flex p-p--small tc-grey-500', alignClassName), children: description })), modalContent && openModal && align == 'center' && (jsxRuntime.jsx("span", { className: styles$7.infoButtonAbsolute, children: jsxRuntime.jsx(TableInfoButton, { onClick: function () {
14317
+ return openModal({
14318
+ title: modalTitle,
14319
+ body: modalContent,
14320
+ });
14321
+ } }) }))] }) }));
14310
14322
  };
14311
14323
 
14312
14324
  var css_248z$5 = ".CTACell-module_narrow__1EPPT {\n height: 40px;\n}";
@@ -14315,8 +14327,8 @@ styleInject(css_248z$5);
14315
14327
 
14316
14328
  var CTACell = function (_a) {
14317
14329
  var _b;
14318
- var title = _a.title, price = _a.price, grey = _a.grey, narrow = _a.narrow, href = _a.href, buttonCaption = _a.buttonCaption;
14319
- return (jsxRuntime.jsxs("div", { className: "wmn3 ta-center", children: [jsxRuntime.jsxs("p", { className: "p-h3", children: [title, price && jsxRuntime.jsxs("span", { className: "tc-purple-500", children: [" ", price] })] }), jsxRuntime.jsx("a", { className: classNames$1('mt16', (_b = {
14330
+ var title = _a.title, price = _a.price, icon = _a.icon, grey = _a.grey, narrow = _a.narrow, href = _a.href, buttonCaption = _a.buttonCaption;
14331
+ return (jsxRuntime.jsxs("div", { className: "ta-center", children: [jsxRuntime.jsxs("div", { className: "d-flex jc-center ai-center gap8", children: [icon, jsxRuntime.jsxs("p", { className: "p-h3", children: [title, price && jsxRuntime.jsxs("span", { className: "tc-purple-500", children: [" ", price] })] })] }), jsxRuntime.jsx("a", { className: classNames$1('mt16 w100 wmx3', (_b = {
14320
14332
  'p-btn--primary': !grey,
14321
14333
  'p-btn--secondary-grey': grey
14322
14334
  },
@@ -14338,7 +14350,7 @@ var ButtonCell = function (_a) {
14338
14350
  _b)), variant: "filledWhite", type: "submit", onClick: onClick, disabled: disabled, children: [buttonCaption, price && jsxRuntime.jsx("span", { className: "p-p tc-purple-500", children: price })] }) }));
14339
14351
  };
14340
14352
 
14341
- var TableCell = function (_a) {
14353
+ var TableCell = require$$0__default['default'].memo(function (_a) {
14342
14354
  var _b;
14343
14355
  var _c;
14344
14356
  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, cellProps = __rest$1(_a, ["isFirstCellInRow", "isHeader", "isNavigation", "isTopLeftCell"]);
@@ -14361,7 +14373,7 @@ var TableCell = function (_a) {
14361
14373
  _b)), children: [!cellProps.type && (jsxRuntime.jsx(BaseCell, __assign({}, cellProps, { fontVariant: isTopLeftCell
14362
14374
  ? 'BIG_WITH_UNDERLINE'
14363
14375
  : (_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))] })));
14364
- };
14376
+ });
14365
14377
 
14366
14378
  var css_248z$3 = ".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;\n /* IE and Edge */\n scrollbar-width: none;\n /* 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_stickyHeader__2uEpP {\n display: flex;\n position: sticky;\n z-index: 9;\n}";
14367
14379
  var styles$3 = {"wrapper":"Table-module_wrapper__2MMNq","container":"Table-module_container__3VFLP","stickyHeader":"Table-module_stickyHeader__2uEpP"};
@@ -14427,7 +14439,7 @@ var isBaseCell = function (tableCellData) {
14427
14439
  };
14428
14440
 
14429
14441
  var TableSection = function (_a) {
14430
- var className = _a.className, tableCellRows = _a.tableCellRows, hideHeader = _a.hideHeader, openModal = _a.openModal, title = _a.title, width = _a.width;
14442
+ var className = _a.className, tableCellRows = _a.tableCellRows, hideHeader = _a.hideHeader, openModal = _a.openModal, title = _a.title, width = _a.width, cellReplacements = _a.cellReplacements;
14431
14443
  var headerRow = tableCellRows === null || tableCellRows === void 0 ? void 0 : tableCellRows[0];
14432
14444
  var getModalTitleFromColumnHeader = function (cellIndex) {
14433
14445
  var _a;
@@ -14453,39 +14465,35 @@ var TableSection = function (_a) {
14453
14465
  };
14454
14466
  return (jsxRuntime.jsxs("table", { className: classNames$1(className, 'w100', styles$2.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) {
14455
14467
  var isFirstCellInRow = cellIndex === 0;
14456
- return (jsxRuntime.jsx(TableCell, __assign({ isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow }, tableCellData, (isBaseCell(tableCellData)
14457
- ? {
14458
- openModal: function (body) {
14459
- return openModal === null || openModal === void 0 ? void 0 : openModal({
14460
- body: body,
14461
- title: tableCellData.text ||
14462
- getModalTitleFromColumnHeader(cellIndex),
14463
- });
14464
- },
14465
- align: isFirstCellInRow ? 'left' : 'center',
14466
- }
14467
- : {})), cellIndex));
14468
+ var cellReplacementData = (tableCellData.cellId &&
14469
+ (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[tableCellData.cellId])) ||
14470
+ {};
14471
+ var cellProps = __assign(__assign(__assign({}, tableCellData), cellReplacementData), {
14472
+ openModal: openModal,
14473
+ modalTitle: (isBaseCell(tableCellData) && tableCellData.text) ||
14474
+ getModalTitleFromColumnHeader(cellIndex),
14475
+ align: isFirstCellInRow ? 'left' : 'center',
14476
+ });
14477
+ return (jsxRuntime.jsx(TableCell, __assign({ isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow }, cellProps), cellIndex));
14468
14478
  }) }) })), jsxRuntime.jsx("tbody", { children: tableCellRows.map(function (row, rowIndex) {
14469
14479
  row.length === 1;
14470
14480
  return (rowIndex > 0 && (jsxRuntime.jsx("tr", { className: styles$2.tr, children: row.map(function (tableCellData, cellIndex) {
14471
14481
  var key = "".concat(rowIndex, "-").concat(cellIndex);
14472
14482
  var isFirstCellInRow = cellIndex === 0;
14473
- return (jsxRuntime.jsx(TableCell, __assign({ isFirstCellInRow: isFirstCellInRow }, tableCellData, (isBaseCell(tableCellData)
14474
- ? {
14475
- openModal: function (body) {
14476
- var titleFromRow = getModalTitleFromRowHeader(row);
14477
- var titleFromColumnOrRow = getModalTitleFromColumnHeader(cellIndex) ||
14478
- getModalTitleFromRowHeader(row);
14479
- return openModal === null || openModal === void 0 ? void 0 : openModal({
14480
- body: body,
14481
- title: isFirstCellInRow
14482
- ? titleFromRow
14483
- : titleFromColumnOrRow,
14484
- });
14485
- },
14486
- align: isFirstCellInRow ? 'left' : 'center',
14487
- }
14488
- : {})), key));
14483
+ var titleFromRow = getModalTitleFromRowHeader(row);
14484
+ var titleFromColumnOrRow = getModalTitleFromColumnHeader(cellIndex) ||
14485
+ getModalTitleFromRowHeader(row);
14486
+ var cellReplacementData = (tableCellData.cellId &&
14487
+ (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[tableCellData.cellId])) ||
14488
+ {};
14489
+ var cellProps = __assign(__assign(__assign({}, tableCellData), cellReplacementData), {
14490
+ openModal: openModal,
14491
+ modalTitle: isFirstCellInRow
14492
+ ? titleFromRow
14493
+ : titleFromColumnOrRow,
14494
+ align: isFirstCellInRow ? 'left' : 'center',
14495
+ });
14496
+ return (jsxRuntime.jsx(TableCell, __assign({ isFirstCellInRow: isFirstCellInRow }, cellProps), key));
14489
14497
  }) }, rowIndex)));
14490
14498
  }) })] }));
14491
14499
  };
@@ -14505,7 +14513,7 @@ var Collapsible = function (_a) {
14505
14513
 
14506
14514
  var TableContents = function (_a) {
14507
14515
  var _b, _c;
14508
- var className = _a.className, collapsibleSections = _a.collapsibleSections, tableData = _a.tableData, hideDetails = _a.hideDetails, isMobile = _a.isMobile, openModal = _a.openModal, shouldHideDetails = _a.shouldHideDetails, title = _a.title;
14516
+ var className = _a.className, collapsibleSections = _a.collapsibleSections, tableData = _a.tableData, hideDetails = _a.hideDetails, isMobile = _a.isMobile, openModal = _a.openModal, shouldHideDetails = _a.shouldHideDetails, title = _a.title, cellReplacements = _a.cellReplacements;
14509
14517
  var _d = require$$0.useState(null), isSectionOpen = _d[0], setOpenSection = _d[1];
14510
14518
  var firstHeadRow = (_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];
14511
14519
  var tableWidth = isMobile ? "".concat((firstHeadRow === null || firstHeadRow === void 0 ? void 0 : firstHeadRow.length) * 50, "%") : '';
@@ -14528,7 +14536,7 @@ var TableContents = function (_a) {
14528
14536
  ? {
14529
14537
  onClick: function () { return handleToggleSection(index); },
14530
14538
  }
14531
- : {}))) }) })), jsxRuntime.jsx(Collapsible, { isExpanded: isExpanded, isMobile: isMobile, children: jsxRuntime.jsx(TableSection, { className: classNames$1(className, 'mb24'), tableCellRows: isFirstSection ? rows : __spreadArray$1([firstHeadRow], rows, true), hideHeader: true, openModal: openModal, title: "".concat(title).concat((section === null || section === void 0 ? void 0 : section.title) ? " - ".concat(section.title) : ''), width: tableWidth }) })] }, index)));
14539
+ : {}))) }) })), jsxRuntime.jsx(Collapsible, { isExpanded: isExpanded, isMobile: isMobile, children: jsxRuntime.jsx(TableSection, { className: classNames$1(className, 'mb24'), tableCellRows: isFirstSection ? rows : __spreadArray$1([firstHeadRow], rows, true), hideHeader: true, openModal: openModal, title: "".concat(title).concat((section === null || section === void 0 ? void 0 : section.title) ? " - ".concat(section.title) : ''), width: tableWidth, cellReplacements: cellReplacements }) })] }, index)));
14532
14540
  }) }));
14533
14541
  };
14534
14542
 
@@ -14624,7 +14632,7 @@ var defaultTextOverrides = {
14624
14632
  };
14625
14633
  var Table = function (_a) {
14626
14634
  var _b, _c, _d, _e, _f;
14627
- var className = _a.className, collapsibleSections = _a.collapsibleSections, tableData = _a.tableData, hideDetails = _a.hideDetails, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, _g = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _g === void 0 ? 0 : _g, definedTextOverrides = _a.textOverrides, title = _a.title;
14635
+ var className = _a.className, cellReplacements = _a.cellReplacements, collapsibleSections = _a.collapsibleSections, tableData = _a.tableData, hideDetails = _a.hideDetails, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, _g = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _g === void 0 ? 0 : _g, definedTextOverrides = _a.textOverrides, title = _a.title;
14628
14636
  var textOverrides = __assign(__assign({}, defaultTextOverrides), definedTextOverrides);
14629
14637
  var isMobile = useMediaQuery('BELOW_MOBILE');
14630
14638
  var _h = require$$0.useState(null), infoModalData = _h[0], setInfoModalData = _h[1];
@@ -14639,12 +14647,16 @@ var Table = function (_a) {
14639
14647
  onSelectionChanged: onSelectionChanged,
14640
14648
  }), activeSection = _k.activeSection, navigateTable = _k.navigateTable;
14641
14649
  var currentActiveSection = (_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[activeSection];
14642
- var handleOpenModal = function (_a) {
14650
+ var currentActiveSectionReplacements = (currentActiveSection.cellId &&
14651
+ (cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[currentActiveSection.cellId])) ||
14652
+ {};
14653
+ var activeCellProps = __assign(__assign({}, currentActiveSection), currentActiveSectionReplacements);
14654
+ var handleOpenModal = require$$0.useCallback(function (_a) {
14643
14655
  var body = _a.body, title = _a.title;
14644
14656
  onModalOpen === null || onModalOpen === void 0 ? void 0 : onModalOpen({ body: body, title: title });
14645
14657
  setInfoModalData({ body: body, title: title });
14646
- };
14647
- return (jsxRuntime.jsxs("div", { className: classNames$1(styles$3.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, currentActiveSection, (isBaseCell(currentActiveSection)
14658
+ }, []);
14659
+ return (jsxRuntime.jsxs("div", { className: classNames$1(styles$3.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, (isBaseCell(currentActiveSection)
14648
14660
  ? {
14649
14661
  openModal: function (body) {
14650
14662
  return handleOpenModal({
@@ -14653,7 +14665,7 @@ var Table = function (_a) {
14653
14665
  });
14654
14666
  },
14655
14667
  }
14656
- : {}), { isNavigation: true })) })) : (jsxRuntime.jsx("div", { "aria-hidden": true, className: styles$3.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsxRuntime.jsx("div", { className: styles$3.container, ref: headerRef, children: jsxRuntime.jsx(TableSection, { tableCellRows: [(_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]], title: title, className: className, openModal: handleOpenModal }) }) })), jsxRuntime.jsx("div", { ref: containerRef, className: classNames$1(styles$3.container, 'pb8'), children: jsxRuntime.jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, hideDetails: hideDetails, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal }) }), hideDetails && (jsxRuntime.jsx(Card, { "data-testid": "show-hide-details", classNames: {
14668
+ : {}), activeCellProps, { isNavigation: true })) })) : (jsxRuntime.jsx("div", { "aria-hidden": true, className: styles$3.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsxRuntime.jsx("div", { className: styles$3.container, ref: headerRef, children: jsxRuntime.jsx(TableSection, { tableCellRows: [(_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]], title: title, className: className, openModal: handleOpenModal }) }) })), jsxRuntime.jsx("div", { ref: containerRef, className: classNames$1(styles$3.container, 'pb8'), children: jsxRuntime.jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, hideDetails: hideDetails, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal, cellReplacements: cellReplacements }) }), hideDetails && (jsxRuntime.jsx(Card, { "data-testid": "show-hide-details", classNames: {
14657
14669
  buttonWrapper: 'm8 mt32',
14658
14670
  title: 'd-flex gap8 ai-center jc-center',
14659
14671
  wrapper: 'bg-grey-200',