@popsure/dirty-swan 0.66.27 → 0.66.29

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 (36) hide show
  1. package/dist/cjs/index.js +14 -6
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/downloadButton/index.test.d.ts +1 -0
  4. package/dist/cjs/lib/components/input/autoSuggestInput/index.test.d.ts +1 -0
  5. package/dist/cjs/lib/components/tabs/Tabs.d.ts +1 -0
  6. package/dist/esm/components/autocompleteAddress/index.js +2 -2
  7. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  8. package/dist/esm/components/autocompleteAddress/index.test.js +21 -12
  9. package/dist/esm/components/autocompleteAddress/index.test.js.map +1 -1
  10. package/dist/esm/components/downloadButton/index.js +1 -1
  11. package/dist/esm/components/downloadButton/index.js.map +1 -1
  12. package/dist/esm/components/downloadButton/index.test.js +25 -0
  13. package/dist/esm/components/downloadButton/index.test.js.map +1 -0
  14. package/dist/esm/components/input/autoSuggestInput/index.js +1 -1
  15. package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
  16. package/dist/esm/components/input/autoSuggestInput/index.test.js +24 -0
  17. package/dist/esm/components/input/autoSuggestInput/index.test.js.map +1 -0
  18. package/dist/esm/components/table/Table.js +9 -1
  19. package/dist/esm/components/table/Table.js.map +1 -1
  20. package/dist/esm/components/table/Table.test.js +25 -0
  21. package/dist/esm/components/table/Table.test.js.map +1 -1
  22. package/dist/esm/components/tabs/Tabs.js +1 -1
  23. package/dist/esm/components/tabs/Tabs.js.map +1 -1
  24. package/dist/esm/lib/components/downloadButton/index.test.d.ts +1 -0
  25. package/dist/esm/lib/components/input/autoSuggestInput/index.test.d.ts +1 -0
  26. package/dist/esm/lib/components/tabs/Tabs.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/src/lib/components/autocompleteAddress/index.test.tsx +17 -11
  29. package/src/lib/components/autocompleteAddress/index.tsx +7 -0
  30. package/src/lib/components/downloadButton/index.test.tsx +22 -0
  31. package/src/lib/components/downloadButton/index.tsx +1 -0
  32. package/src/lib/components/input/autoSuggestInput/index.test.tsx +22 -0
  33. package/src/lib/components/input/autoSuggestInput/index.tsx +1 -0
  34. package/src/lib/components/table/Table.test.tsx +43 -0
  35. package/src/lib/components/table/Table.tsx +9 -1
  36. package/src/lib/components/tabs/Tabs.tsx +2 -0
package/dist/cjs/index.js CHANGED
@@ -11224,8 +11224,8 @@ var AutocompleteAddress = function (_a) {
11224
11224
  };
11225
11225
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: classNames("wmx8 bg-neutral-600 ".concat(styles$G['map-container']), (_b = {},
11226
11226
  _b[styles$G['map-container--hidden']] = place === null,
11227
- _b)), children: [jsxRuntime.jsx("div", { className: styles$G.map, id: "map", "aria-hidden": "true" }), isLoading && (jsxRuntime.jsx("div", { className: styles$G['loading-spinner'], children: jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m" }) }))] }), jsxRuntime.jsx("div", { className: "wmx8", children: manualAddressEntry === false ? (jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntime.jsx(Input, { className: "w100", id: "autocomplete", "data-cy": "autocomplete", type: "text", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.manualAddressEntry) || 'Search for address', ref: autocompleteElement, disabled: hasLoadedGoogleAPI === false }, "autocomplete-search"), hasLoadedGoogleAPI === false && (jsxRuntime.jsx("div", { "data-cy": "google-api-loader", className: styles$G['loading-spinner'], children: jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m" }) }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "d-flex c-gap16 ".concat(styles$G['input-line']), children: [jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete", type: "text", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.street) || 'Street', value: (address === null || address === void 0 ? void 0 : address.street) || '', onChange: onManualAddressChange(), name: "street" }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.street), "autocomplete-street"), jsxRuntime.jsx(Input, __assign({ className: "wmx2 ".concat(styles$G['house-number-input']), "data-cy": "autocomplete-house-number", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.houseNumber) || 'House number', value: (address === null || address === void 0 ? void 0 : address.houseNumber) || '', name: "houseNumber", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.houseNumber), "autocomplete-house-number")] }), jsxRuntime.jsx(Input, __assign({ className: "mt16", "data-cy": "autocomplete-additional-info", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.additionalInformation) ||
11228
- 'Additional information (C/O, apartment, etc.)', value: (address === null || address === void 0 ? void 0 : address.additionalInformation) || '', name: "additionalInformation", onChange: onManualAddressChange({ updatePlace: false }) }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.additionalInformation), "autocomplete-additional-info"), jsxRuntime.jsxs("div", { className: "d-flex mt16 c-gap16 ".concat(styles$G['input-line']), children: [jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete-postcode", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.postcode) || 'Postcode', value: (address === null || address === void 0 ? void 0 : address.postcode) || '', name: "postcode", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.postcode), "autocomplete-postcode"), jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete-city", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.city) || 'City', value: (address === null || address === void 0 ? void 0 : address.city) || '', name: "city", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.city), "autocomplete-city")] })] })) }), manualAddressEntry === false && (jsxRuntime.jsxs("div", { className: "p-p mt8", children: [(manualAddressEntryTexts === null || manualAddressEntryTexts === void 0 ? void 0 : manualAddressEntryTexts.preText) || 'Or ', jsxRuntime.jsx("button", { className: 'p-a p-p fw-bold c-pointer bg-transparent', onClick: handleEnterAddressManually, type: "button", children: (manualAddressEntryTexts === null || manualAddressEntryTexts === void 0 ? void 0 : manualAddressEntryTexts.cta) || 'enter address manually' })] }))] }));
11227
+ _b)), children: [jsxRuntime.jsx("div", { className: styles$G.map, id: "map", "aria-hidden": "true" }), isLoading && (jsxRuntime.jsx("div", { className: styles$G['loading-spinner'], children: jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m" }) }))] }), jsxRuntime.jsx("div", { className: "wmx8", children: manualAddressEntry === false ? (jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntime.jsx(Input, { className: "w100", id: "autocomplete", "data-cy": "autocomplete", "data-testid": "autocomplete", type: "text", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.manualAddressEntry) || 'Search for address', ref: autocompleteElement, disabled: hasLoadedGoogleAPI === false }, "autocomplete-search"), hasLoadedGoogleAPI === false && (jsxRuntime.jsx("div", { "data-cy": "google-api-loader", "data-testid": "google-api-loader", className: styles$G['loading-spinner'], children: jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m" }) }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "d-flex c-gap16 ".concat(styles$G['input-line']), children: [jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete", "data-testid": "autocomplete", type: "text", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.street) || 'Street', value: (address === null || address === void 0 ? void 0 : address.street) || '', onChange: onManualAddressChange(), name: "street" }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.street), "autocomplete-street"), jsxRuntime.jsx(Input, __assign({ className: "wmx2 ".concat(styles$G['house-number-input']), "data-cy": "autocomplete-house-number", "data-testid": "autocomplete-house-number", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.houseNumber) || 'House number', value: (address === null || address === void 0 ? void 0 : address.houseNumber) || '', name: "houseNumber", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.houseNumber), "autocomplete-house-number")] }), jsxRuntime.jsx(Input, __assign({ className: "mt16", "data-cy": "autocomplete-additional-info", "data-testid": "autocomplete-additional-info", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.additionalInformation) ||
11228
+ 'Additional information (C/O, apartment, etc.)', value: (address === null || address === void 0 ? void 0 : address.additionalInformation) || '', name: "additionalInformation", onChange: onManualAddressChange({ updatePlace: false }) }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.additionalInformation), "autocomplete-additional-info"), jsxRuntime.jsxs("div", { className: "d-flex mt16 c-gap16 ".concat(styles$G['input-line']), children: [jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete-postcode", "data-testid": "autocomplete-postcode", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.postcode) || 'Postcode', value: (address === null || address === void 0 ? void 0 : address.postcode) || '', name: "postcode", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.postcode), "autocomplete-postcode"), jsxRuntime.jsx(Input, __assign({ className: "w100", "data-cy": "autocomplete-city", "data-testid": "autocomplete-city", placeholder: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.city) || 'City', value: (address === null || address === void 0 ? void 0 : address.city) || '', name: "city", onChange: onManualAddressChange() }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.city), "autocomplete-city")] })] })) }), manualAddressEntry === false && (jsxRuntime.jsxs("div", { className: "p-p mt8", children: [(manualAddressEntryTexts === null || manualAddressEntryTexts === void 0 ? void 0 : manualAddressEntryTexts.preText) || 'Or ', jsxRuntime.jsx("button", { className: 'p-a p-p fw-bold c-pointer bg-transparent', onClick: handleEnterAddressManually, type: "button", children: (manualAddressEntryTexts === null || manualAddressEntryTexts === void 0 ? void 0 : manualAddressEntryTexts.cta) || 'enter address manually' })] }))] }));
11229
11229
  };
11230
11230
 
11231
11231
  var propTypes$2 = {exports: {}};
@@ -14571,7 +14571,7 @@ styleInject(css_248z$E);
14571
14571
 
14572
14572
  var InitialButton = function (_a) {
14573
14573
  var onDownload = _a.onDownload;
14574
- return (jsxRuntime.jsx(Button, { className: "w100 ".concat(styles$D.button), leftIcon: jsxRuntime.jsx(DownloadIcon, {}), onClick: onDownload, "data-cy": "download-documents-button", children: "Download" }));
14574
+ return (jsxRuntime.jsx(Button, { className: "w100 ".concat(styles$D.button), leftIcon: jsxRuntime.jsx(DownloadIcon, {}), onClick: onDownload, "data-cy": "download-documents-button", "data-testid": "download-documents-button", children: "Download" }));
14575
14575
  };
14576
14576
  // TODO: Allow setting loading to true to display text
14577
14577
  var GeneratingButton = function () { return (jsxRuntime.jsx(Button, { className: "w100 ".concat(styles$D.button), loading: true, children: "Generating" })); };
@@ -20100,7 +20100,7 @@ var AutoSuggestInput = function (_a) {
20100
20100
  _a)), children: suggestion.value })] }));
20101
20101
  };
20102
20102
  var getSuggestionValue = function (suggestion) { return suggestion.value; };
20103
- var renderInputComponent = function (autoSuggestInputProps) { return (jsxRuntime.jsx(Input, __assign({}, autoSuggestInputProps, { placeholder: placeholder, "data-cy": "suggest-multi-select-input" }))); };
20103
+ var renderInputComponent = function (autoSuggestInputProps) { return (jsxRuntime.jsx(Input, __assign({}, autoSuggestInputProps, { placeholder: placeholder, "data-cy": "suggest-multi-select-input", "data-testid": "suggest-multi-select-input" }))); };
20104
20104
  return (jsxRuntime.jsx("div", { className: className, children: jsxRuntime.jsx(Autosuggest, { theme: styles$p, suggestions: suggestions, onSuggestionsFetchRequested: handleSuggestionFetchRequest, onSuggestionsClearRequested: handleSuggestionClearRequest, getSuggestionValue: getSuggestionValue, renderSuggestion: renderSuggestion, highlightFirstSuggestion: true, inputProps: __assign(__assign({}, inputProps), { value: currentOption, onChange: function (_, _a) {
20105
20105
  var newValue = _a.newValue;
20106
20106
  onChange(newValue);
@@ -23115,7 +23115,7 @@ var Tabs = function (_a) {
23115
23115
  var _a;
23116
23116
  return (jsxRuntime.jsx("button", { ref: setTabRef(index), type: "button", role: "tab", "aria-selected": activeIndex === index, tabIndex: activeIndex === index ? 0 : -1, className: classNames('p-p bg-transparent c-pointer', styles$1.tab, (_a = {},
23117
23117
  _a[styles$1.tabActive] = activeIndex === index,
23118
- _a)), onClick: function () { return onTabChange(index); }, onKeyDown: function (e) { return handleKeyDown(e, index); }, children: tab.label }, tab.id));
23118
+ _a)), onClick: function () { return onTabChange(index); }, onKeyDown: function (e) { return handleKeyDown(e, index); }, "data-testid": tab.dataTestId, children: tab.label }, tab.id));
23119
23119
  }) }));
23120
23120
  };
23121
23121
 
@@ -23123,6 +23123,9 @@ var defaultTextOverrides = {
23123
23123
  showDetails: 'Show details',
23124
23124
  hideDetails: 'Hide details',
23125
23125
  };
23126
+ var getCellDataTestId = function (cell) {
23127
+ return cell && 'dataTestId' in cell ? cell.dataTestId : undefined;
23128
+ };
23126
23129
  var Table = function (_a) {
23127
23130
  var _b, _c, _d, _e, _f;
23128
23131
  var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _g = _a.hideColumns, hideColumns = _g === void 0 ? [] : _g, hideDetails = _a.hideDetails, _h = _a.hideRows, hideRows = _h === void 0 ? [] : _h, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, scrollOnOpen = _a.scrollOnOpen, _j = _a.scrollTopOffset, scrollTopOffset = _j === void 0 ? 0 : _j, _k = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _k === void 0 ? 0 : _k, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title, externalActiveSection = _a.activeSection, _l = _a.hideTableNavigation, hideTableNavigation = _l === void 0 ? false : _l, _m = _a.hideStickyHeader, hideStickyHeader = _m === void 0 ? false : _m, _o = _a.showSelectedColumn, showSelectedColumn = _o === void 0 ? false : _o, _p = _a.mobileNavigationMode, mobileNavigationMode = _p === void 0 ? 'arrows' : _p;
@@ -23147,6 +23150,7 @@ var Table = function (_a) {
23147
23150
  var currentActiveSection = headerRow === null || headerRow === void 0 ? void 0 : headerRow[activeSection];
23148
23151
  var mobileTabs = useTabs
23149
23152
  ? (_d = headerRow === null || headerRow === void 0 ? void 0 : headerRow.slice(1).map(function (cell, index) {
23153
+ var _a;
23150
23154
  var label = '';
23151
23155
  if (!cell.type)
23152
23156
  label = String(cell.text || '');
@@ -23154,7 +23158,11 @@ var Table = function (_a) {
23154
23158
  label = String(cell.title || '');
23155
23159
  else if (cell.type === 'BUTTON')
23156
23160
  label = String(cell.buttonCaption || '');
23157
- return { id: String(index), label: label };
23161
+ var replacement = cell.cellId
23162
+ ? cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[cell.cellId]
23163
+ : undefined;
23164
+ var dataTestId = (_a = getCellDataTestId(replacement)) !== null && _a !== void 0 ? _a : getCellDataTestId(cell);
23165
+ return { id: String(index), label: label, dataTestId: dataTestId };
23158
23166
  })) !== null && _d !== void 0 ? _d : []
23159
23167
  : [];
23160
23168
  var currentActiveSectionReplacements = ((currentActiveSection === null || currentActiveSection === void 0 ? void 0 : currentActiveSection.cellId) &&