@spscommerce/ds-react 5.14.1 → 5.15.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
@@ -204,7 +204,7 @@ function SpsButton(props2) {
204
204
  className: clsx("sps-icon", `sps-icon-${icon}`),
205
205
  "aria-hidden": "true"
206
206
  });
207
- const spinner = /* @__PURE__ */ React.createElement("div", {
207
+ const spinner = spinning && /* @__PURE__ */ React.createElement("div", {
208
208
  className: "sps-spinner"
209
209
  }, spinningTitle || t2("design-system:button.spinningTitle"));
210
210
  return /* @__PURE__ */ React.createElement("div", {
@@ -2546,7 +2546,8 @@ function SpsAutocomplete(_a) {
2546
2546
  zeroState,
2547
2547
  loading,
2548
2548
  maxHeightOptionListPx,
2549
- maxHeightOptionListRem
2549
+ maxHeightOptionListRem,
2550
+ "data-testid": testId
2550
2551
  } = _b, rest = __objRest(_b, [
2551
2552
  "className",
2552
2553
  "debounce",
@@ -2564,7 +2565,8 @@ function SpsAutocomplete(_a) {
2564
2565
  "zeroState",
2565
2566
  "loading",
2566
2567
  "maxHeightOptionListPx",
2567
- "maxHeightOptionListRem"
2568
+ "maxHeightOptionListRem",
2569
+ "data-testid"
2568
2570
  ]);
2569
2571
  const meta = formMeta || formControl2;
2570
2572
  const { wrapperId, controlId } = useFormControlId(id2, meta);
@@ -2635,7 +2637,8 @@ function SpsAutocomplete(_a) {
2635
2637
  inputRef: textInput,
2636
2638
  ref: rootRef,
2637
2639
  focusInputOnClick: true,
2638
- onClick: (event) => event.nativeEvent.stopImmediatePropagation()
2640
+ onClick: (event) => event.nativeEvent.stopImmediatePropagation(),
2641
+ "data-testId": `${testId}`
2639
2642
  }, /* @__PURE__ */ React.createElement("div", {
2640
2643
  className: "sps-text-input"
2641
2644
  }, /* @__PURE__ */ React.createElement("div", {
@@ -2653,8 +2656,10 @@ function SpsAutocomplete(_a) {
2653
2656
  onChange: handleChange,
2654
2657
  onKeyDown: handleKeyDown,
2655
2658
  disabled,
2656
- id: controlId
2659
+ id: controlId,
2660
+ "data-testid": `${testId}__input`
2657
2661
  }, rest)), value && !disabled && /* @__PURE__ */ React.createElement("i", {
2662
+ "aria-label": "clear",
2658
2663
  className: "sps-icon sps-icon-x-circle sps-form-control__clear-btn",
2659
2664
  onClick: (event) => clear(event)
2660
2665
  }))), /* @__PURE__ */ React.createElement(SpsOptionList, {
@@ -24232,7 +24237,7 @@ const SpsFormExamples = {
24232
24237
  },
24233
24238
  custom_errors: {
24234
24239
  label: "Custom errors",
24235
- description: () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "When using custom validators you can specify when to show the errors - on Change, on Blur or on Submit.", /* @__PURE__ */ React.createElement("br", null), "On Blur is the the default behavior. If you want to change that behavior you can use ", /* @__PURE__ */ React.createElement("b", null, "useCustomValidator hook"), ". It takes validation function as first argument, validator configuration (object containing errorKey as key and ValidationMode as value) as second argument and dependencies as third argument. useCustomValidator returns a React callback of the validation function with the given dependencies."), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("b", null, "!Note:"), " useCustomValidator hook will make changes to the global scope and once you set a custom error key you can't change it.")),
24240
+ description: () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "When using custom validators you can specify when to show the errors - on Change, on Blur or on Submit.", /* @__PURE__ */ React.createElement("br", null), "On Blur is the default behavior. If you want to change that behavior you can use ", /* @__PURE__ */ React.createElement("b", null, "useCustomValidator hook"), ". It takes validation function as first argument, validator configuration (object containing errorKey as key and ValidationMode as value) as second argument and dependencies as third argument. useCustomValidator returns a React callback of the validation function with the given dependencies."), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("b", null, "!Note:"), " useCustomValidator hook will make changes to the global scope and once you set a custom error key you can't change it.")),
24236
24241
  examples: {
24237
24242
  basic: {
24238
24243
  react: code`
@@ -28257,7 +28262,8 @@ const propsDoc$S = {
28257
28262
  isSelected: "boolean",
28258
28263
  isIndeterminate: "boolean",
28259
28264
  onSelectionChange: "(boolean) => void",
28260
- pinResultsBar: "boolean"
28265
+ pinResultsBar: "boolean",
28266
+ pinToolbar: "boolean"
28261
28267
  };
28262
28268
  const propTypes$U = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
28263
28269
  activeTab: impl(),
@@ -28274,7 +28280,8 @@ const propTypes$U = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
28274
28280
  isSelected: propTypes$1N.exports.bool,
28275
28281
  isIndeterminate: propTypes$1N.exports.bool,
28276
28282
  onSelectionChange: fun(),
28277
- pinResultsBar: propTypes$1N.exports.bool
28283
+ pinResultsBar: propTypes$1N.exports.bool,
28284
+ pinToolbar: propTypes$1N.exports.bool
28278
28285
  });
28279
28286
  function SpsListToolbar(props2) {
28280
28287
  const _a = props2, {
@@ -28293,6 +28300,7 @@ function SpsListToolbar(props2) {
28293
28300
  isIndeterminate,
28294
28301
  onSelectionChange,
28295
28302
  pinResultsBar,
28303
+ pinToolbar = true,
28296
28304
  "data-testid": testId
28297
28305
  } = _a, rest = __objRest(_a, [
28298
28306
  "activeTab",
@@ -28310,6 +28318,7 @@ function SpsListToolbar(props2) {
28310
28318
  "isIndeterminate",
28311
28319
  "onSelectionChange",
28312
28320
  "pinResultsBar",
28321
+ "pinToolbar",
28313
28322
  "data-testid"
28314
28323
  ]);
28315
28324
  const { t: t2 } = React.useContext(I18nContext);
@@ -28378,7 +28387,7 @@ function SpsListToolbar(props2) {
28378
28387
  React.useEffect(() => {
28379
28388
  emitToolbarPinned(isPinned);
28380
28389
  }, [isPinned]);
28381
- const classes = clsx(unsafelyReplaceClassName || "sps-list-toolbar", isPinned && "sps-list-toolbar--pinned", isPinned && "z-stratum-bar", advancedSearch && advancedSearch.isOpen && "sps-list-toolbar--advanced-search-open", className);
28390
+ const classes = clsx(unsafelyReplaceClassName || "sps-list-toolbar", isPinned && pinToolbar && "sps-list-toolbar--pinned", isPinned && pinToolbar && "z-stratum-bar", advancedSearch && advancedSearch.isOpen && "sps-list-toolbar--advanced-search-open", className);
28382
28391
  const [
28383
28392
  listToolbarSearch,
28384
28393
  listToolbarSearchInfo,
@@ -16,6 +16,7 @@ declare const propTypes: {
16
16
  isIndeterminate: PropTypes.Requireable<boolean>;
17
17
  onSelectionChange: PropTypes.Requireable<(boolean: any) => void>;
18
18
  pinResultsBar: PropTypes.Requireable<boolean>;
19
+ pinToolbar: PropTypes.Requireable<boolean>;
19
20
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
21
  className: PropTypes.Requireable<string>;
21
22
  "data-testid": PropTypes.Requireable<string>;
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.14.1",
4
+ "version": "5.15.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,10 +28,10 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@react-stately/collections": "^3.3.3",
31
- "@spscommerce/ds-colors": "5.14.1",
32
- "@spscommerce/ds-shared": "5.14.1",
33
- "@spscommerce/positioning": "5.14.1",
34
- "@spscommerce/utils": "5.14.1",
31
+ "@spscommerce/ds-colors": "5.15.0",
32
+ "@spscommerce/ds-shared": "5.15.0",
33
+ "@spscommerce/positioning": "5.15.0",
34
+ "@spscommerce/utils": "5.15.0",
35
35
  "moment": "^2.25.3",
36
36
  "moment-timezone": "^0.5.28",
37
37
  "react": "^16.9.0",
@@ -39,10 +39,10 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@react-stately/collections": "^3.3.3",
42
- "@spscommerce/ds-colors": "5.14.1",
43
- "@spscommerce/ds-shared": "5.14.1",
44
- "@spscommerce/positioning": "5.14.1",
45
- "@spscommerce/utils": "5.14.1",
42
+ "@spscommerce/ds-colors": "5.15.0",
43
+ "@spscommerce/ds-shared": "5.15.0",
44
+ "@spscommerce/positioning": "5.15.0",
45
+ "@spscommerce/utils": "5.15.0",
46
46
  "@testing-library/react": "^9.3.2",
47
47
  "@types/prop-types": "^15.7.1",
48
48
  "@types/react": "^16.9.0",