@spscommerce/ds-react 5.23.1 → 5.25.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/lib/index.es.js CHANGED
@@ -1815,6 +1815,7 @@ const propTypes$1K = __spreadProps(__spreadValues(__spreadValues(__spreadValues(
1815
1815
  async function updateOptions(props2, searchState, searchStatePatch, setOptionList, setAnyOptionHasIcon, promiseRef) {
1816
1816
  const options = typeof props2.options === "function" ? props2.options(searchState.value) : props2.options || [];
1817
1817
  const areOptionsPromise = options instanceof Promise;
1818
+ const removeSpecialSymbols = (value) => value.replace(/([.?*+^$[\]\\(){}|-])/g, "");
1818
1819
  searchStatePatch({ pending: areOptionsPromise });
1819
1820
  promiseRef.current = areOptionsPromise ? options : null;
1820
1821
  const result = areOptionsPromise ? await options || [] : options || [];
@@ -1832,13 +1833,15 @@ async function updateOptions(props2, searchState, searchStatePatch, setOptionLis
1832
1833
  newOpts.unshift(new SpsOptionListOption(null, { text: props2.nullOption }));
1833
1834
  }
1834
1835
  if (searchState.value) {
1835
- searchStatePatch({ replacementPattern: new RegExp(searchState.value, "ig") });
1836
+ const searchValue = removeSpecialSymbols(searchState.value);
1837
+ searchStatePatch({ replacementPattern: new RegExp(searchValue, "ig") });
1836
1838
  newOpts = newOpts.filter((o) => {
1837
- const regEx = new RegExp(searchState.value, "i");
1839
+ const regEx = new RegExp(searchValue, "i");
1840
+ const optionText = removeSpecialSymbols(o.text);
1838
1841
  if (props2.filterByTextAndCaptionKey) {
1839
- return regEx.test(o.text) || regEx.test(o.caption);
1842
+ return regEx.test(optionText) || regEx.test(removeSpecialSymbols(o.caption));
1840
1843
  }
1841
- return regEx.test(o.text);
1844
+ return regEx.test(optionText);
1842
1845
  });
1843
1846
  } else {
1844
1847
  searchStatePatch({ replacementPattern: null });
@@ -34518,7 +34521,7 @@ function SpsTaskQueue(_E) {
34518
34521
  kind: tooltipKind,
34519
34522
  showOn: hasTasks ? TooltipShowTrigger.MANUAL : TooltipShowTrigger.MOUSEOVER,
34520
34523
  isShown: showNotification && !isOpen ? TooltipVisibility.VISIBLE : TooltipVisibility.HIDDEN,
34521
- hideDelay: TASK_QUEUE_NOTIFICATION_DURATION_MS
34524
+ hideDelay: Number(hasTasks) && TASK_QUEUE_NOTIFICATION_DURATION_MS
34522
34525
  }, !suppressTooltips && showNotification && (notificationText || t2("design-system:taskQueue.newTask")), !suppressTooltips && !showNotification && !hasTasks && t2("design-system:taskQueue.noTasks")), portal(/* @__PURE__ */ React.createElement("div", {
34523
34526
  ref: taskQueueDropdownRef,
34524
34527
  className: clsx("sps-task-queue__task-list", isOpen && "sps-task-queue__task-list--open", "z-stratum-dropdown"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/ds-react",
3
3
  "description": "SPS Design System React components",
4
- "version": "5.23.1",
4
+ "version": "5.25.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@react-stately/collections": "^3.3.3",
31
- "@spscommerce/ds-colors": "5.23.1",
32
- "@spscommerce/ds-illustrations": "5.23.1",
33
- "@spscommerce/ds-shared": "5.23.1",
34
- "@spscommerce/positioning": "5.23.1",
35
- "@spscommerce/utils": "5.23.1",
31
+ "@spscommerce/ds-colors": "5.25.0",
32
+ "@spscommerce/ds-illustrations": "5.25.0",
33
+ "@spscommerce/ds-shared": "5.25.0",
34
+ "@spscommerce/positioning": "5.25.0",
35
+ "@spscommerce/utils": "5.25.0",
36
36
  "moment": "^2.25.3",
37
37
  "moment-timezone": "^0.5.28",
38
38
  "react": "^16.9.0",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@react-stately/collections": "^3.3.3",
43
- "@spscommerce/ds-colors": "5.23.1",
44
- "@spscommerce/ds-illustrations": "5.23.1",
45
- "@spscommerce/ds-shared": "5.23.1",
46
- "@spscommerce/positioning": "5.23.1",
47
- "@spscommerce/utils": "5.23.1",
43
+ "@spscommerce/ds-colors": "5.25.0",
44
+ "@spscommerce/ds-illustrations": "5.25.0",
45
+ "@spscommerce/ds-shared": "5.25.0",
46
+ "@spscommerce/positioning": "5.25.0",
47
+ "@spscommerce/utils": "5.25.0",
48
48
  "@testing-library/react": "^9.3.2",
49
49
  "@types/prop-types": "^15.7.1",
50
50
  "@types/react": "^16.9.0",