@spscommerce/ds-react 4.33.0 → 4.34.2

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
@@ -1027,12 +1027,12 @@ const propTypes$1H = __spreadProps(__spreadValues(__spreadValues(__spreadValues(
1027
1027
  loading: propTypes$1L.exports.bool
1028
1028
  });
1029
1029
  async function updateOptions(props2, searchState, searchStatePatch, setOptionList, setAnyOptionHasIcon, promiseRef) {
1030
- searchStatePatch({ pending: true });
1031
- const fetchedOptions = typeof props2.options === "function" ? props2.options(searchState.value) : props2.options || [];
1032
- const resultPromise = fetchedOptions instanceof Promise ? fetchedOptions : Promise.resolve(fetchedOptions);
1033
- promiseRef.current = resultPromise;
1034
- const result = await resultPromise || [];
1035
- if (promiseRef.current !== resultPromise) {
1030
+ const options = typeof props2.options === "function" ? props2.options(searchState.value) : props2.options || [];
1031
+ const areOptionsPromise = options instanceof Promise;
1032
+ searchStatePatch({ pending: areOptionsPromise });
1033
+ promiseRef.current = areOptionsPromise ? options : null;
1034
+ const result = areOptionsPromise ? await options || [] : options || [];
1035
+ if (areOptionsPromise && promiseRef.current !== options) {
1036
1036
  return;
1037
1037
  }
1038
1038
  let newOpts = Array.from(result).filter(Boolean).map((thing) => new SpsOptionListOption(thing, typeof thing === "function" ? {
@@ -29886,11 +29886,26 @@ Object.assign(SpsPagination, {
29886
29886
  displayName: "SpsPagination"
29887
29887
  });
29888
29888
  const SpsPaginationExamples = {
29889
+ general: {
29890
+ label: "General Usage",
29891
+ description: () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "Use the Standard Pagination Bar on a list page (comprised of a Table, Content Rows, or Content Tiles). It should always appear at the bottom of the listed records."), /* @__PURE__ */ React.createElement("p", null, "Use the Mini Pagination component when a paginated list of results exists inside a smaller Card."))
29892
+ },
29889
29893
  pagination: {
29890
- label: "Pagination",
29891
- description: "info about pagination",
29894
+ label: "Standard Pagination Bar",
29895
+ description: ({ Link }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "The Standard Pagination Bar is comprised of three main sections. The middle section is hidden from view when the width of its container is at the responsive breakpoint of 767 pixels."), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("span", {
29896
+ className: "sps-text-semibold"
29897
+ }, "Results-per-page Select"), " ", "(left): allows the user to adjust the number of records being displayed per page.*")), /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("span", {
29898
+ className: "sps-text-semibold"
29899
+ }, "Viewing details"), " (middle): describes which results are being displayed on the current page.")), /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("span", {
29900
+ className: "sps-text-semibold"
29901
+ }, "Page Navigator"), " (right): allows the user to navigate between pages of results"))), /* @__PURE__ */ React.createElement("i", null, "*Note: For Tables and Content Rows, per-page options should be 25, 50, and 100. For Content Tiles, per-page options should be 24, 48, and 100."), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("p", {
29902
+ className: "mt-2"
29903
+ }, "To see an example of the Standard Pagination Bar in context with a Table, view the Table Lists section on the", " ", /* @__PURE__ */ React.createElement(Link, {
29904
+ to: "/style-and-layout/page-types"
29905
+ }, "Page Types"), " page.")),
29892
29906
  examples: {
29893
29907
  basic: {
29908
+ description: () => /* @__PURE__ */ React.createElement("h4", null, "Building the Standard Pagination Bar"),
29894
29909
  react: code`
29895
29910
  function Component() {
29896
29911
  const [page, setPage] = React.useState(2);
@@ -29936,10 +29951,13 @@ const SpsPaginationExamples = {
29936
29951
  }
29937
29952
  },
29938
29953
  pageSelector: {
29939
- label: "Page selector",
29940
- description: "info about page selector",
29954
+ label: "Page Navigator",
29955
+ description: ({ Link }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "When navigating through a series of paginated results inside of a container such as a sidebar, a miniature version of the pagination bar can be used. This version utilizes only the page navigation component. Use Mini Pagination inside of a Card Header that also includes a title describing the content contained in the card below."), /* @__PURE__ */ React.createElement("p", null, "To see an example of the Page Navigator in context within a Card Header, view the General Content section on the", " ", /* @__PURE__ */ React.createElement(Link, {
29956
+ to: "/style-and-layout/page-types"
29957
+ }, "Page Types"), " page.")),
29941
29958
  examples: {
29942
29959
  basic: {
29960
+ description: () => /* @__PURE__ */ React.createElement("h4", null, "Building the Page Navigator"),
29943
29961
  react: code`
29944
29962
  function Component() {
29945
29963
  const pageChanged = val => {
@@ -30873,7 +30891,7 @@ const SpsTooltipExamples = {
30873
30891
  <SpsTooltipTitle icon={SpsIcon.CALENDAR_BLANK}>Started</SpsTooltipTitle>
30874
30892
  <div className="mb-3">Tuesday, April 15</div>
30875
30893
  <SpsTooltipTitle icon={SpsIcon.CHECKMARK}>Completed</SpsTooltipTitle>
30876
- <div className="mb-3">Thursday, April 24</div>
30894
+ <div>Thursday, April 24</div>
30877
30895
  </SpsTooltip>
30878
30896
  </React.Fragment>
30879
30897
  );
@@ -36223,6 +36241,7 @@ const MANIFEST = {
36223
36241
  examples: SpsPageTitleExamples
36224
36242
  },
36225
36243
  Pagination: {
36244
+ description: () => /* @__PURE__ */ React.createElement("p", null, "The Pagination component allows users to navigate lists of records and control the number of records displayed on each page. The records can span across multiple pages, or within sections of a page."),
36226
36245
  components: [SpsPagination, SpsPageSelector],
36227
36246
  examples: SpsPaginationExamples
36228
36247
  },
@@ -1,2 +1,2 @@
1
- import type { DSReactExamples } from "@spscommerce/ds-shared";
1
+ import { DSReactExamples } from '@spscommerce/ds-shared';
2
2
  export declare const SpsPaginationExamples: DSReactExamples;
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": "4.33.0",
4
+ "version": "4.34.2",
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": "4.33.0",
32
- "@spscommerce/ds-shared": "4.33.0",
33
- "@spscommerce/positioning": "4.33.0",
34
- "@spscommerce/utils": "4.33.0",
31
+ "@spscommerce/ds-colors": "4.34.2",
32
+ "@spscommerce/ds-shared": "4.34.2",
33
+ "@spscommerce/positioning": "4.34.2",
34
+ "@spscommerce/utils": "4.34.2",
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": "4.33.0",
43
- "@spscommerce/ds-shared": "4.33.0",
44
- "@spscommerce/positioning": "4.33.0",
45
- "@spscommerce/utils": "4.33.0",
42
+ "@spscommerce/ds-colors": "4.34.2",
43
+ "@spscommerce/ds-shared": "4.34.2",
44
+ "@spscommerce/positioning": "4.34.2",
45
+ "@spscommerce/utils": "4.34.2",
46
46
  "@testing-library/jest-dom": "^4.2.4",
47
47
  "@testing-library/react": "^9.3.2",
48
48
  "@types/prop-types": "^15.7.1",