@spscommerce/ds-react 5.3.0 → 5.4.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
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React__default, { useRef, useEffect, createContext, useMemo as useMemo$1, useContext, useReducer, useState, useCallback as useCallback$1, useLayoutEffect as useLayoutEffect$1 } from "react";
34
- import { noI18nI18n, ButtonKind, ButtonType, SpsIcon, SpinnerSize, Position, ZStratum, SpsOptionListOption, DropdownKind, SPS_ACTION_DEFAULTS, ClickableTagKind, TagKind, SpsIconSize, SelectMode, TooltipKind, TooltipShowTrigger, TOOLTIP_HIDE_DELAY_MS_DEFAULT, FeedbackBlockKind, FeedbackBlockIcons, GrowlerKind, GrowlerIcon, GROWLER_VISIBLE_DURATION_MS, GROWLER_FADEOUT_DURATION_MS, SpsInsightTileKind, SpsInsightTileIcons, KeyValueListTitleColor, SortDirection, ModalKind, ModalSize, DEFAULT_PAGE_SIZE_OPTIONS, StdButtonKind, SpsTaskStatus, TASK_QUEUE_NOTIFICATION_DURATION_MS, SpsTaskStatusIcons, SpsFilterTileKind, RingSize, WizardSubstepConditions } from "@spscommerce/ds-shared";
34
+ import { noI18nI18n, ButtonKind, ButtonType, SpsIcon, SpinnerSize, Position, ZStratum, SpsOptionListOption, DropdownKind, SPS_ACTION_DEFAULTS, ClickableTagKind, TagKind, SpsIconSize, SelectMode, TooltipKind, TooltipShowTrigger, TOOLTIP_HIDE_DELAY_MS_DEFAULT, FeedbackBlockKind, FeedbackBlockIcons, GrowlerKind, GrowlerIcon, GROWLER_VISIBLE_DURATION_MS, GROWLER_FADEOUT_DURATION_MS, SpsInsightTileKind, SpsInsightTileIcons, KeyValueListTitleColor, SortDirection, ModalKind, ModalSize, DEFAULT_PAGE_SIZE_OPTIONS, SteppedProgressBarColor, StdButtonKind, SpsTaskStatus, TASK_QUEUE_NOTIFICATION_DURATION_MS, SpsTaskStatusIcons, SpsFilterTileKind, RingSize, WizardSubstepConditions } from "@spscommerce/ds-shared";
35
35
  import { values as values$3, code, debounce, flatten, deepFreeze, setPath, diff, DiffChange, getPath, crumblePath, traversePath, forEachNestedObject, lockToAnimationFrames, constrain } from "@spscommerce/utils";
36
36
  import * as ReactDOM from "react-dom";
37
37
  import { createPortal, unstable_batchedUpdates } from "react-dom";
@@ -30424,6 +30424,37 @@ const SpsSteppedProgressBarExamples = {
30424
30424
  }
30425
30425
  `
30426
30426
  },
30427
+ color: {
30428
+ description: () => /* @__PURE__ */ React.createElement("h4", null, "Alternate Color"),
30429
+ react: code`
30430
+ function Component() {
30431
+ const iconsData = [
30432
+ {index: 4, icon: SpsIcon.CALENDAR},
30433
+ {index: 8, icon: SpsIcon.CALENDAR},
30434
+ ];
30435
+ const tooltipsData = [
30436
+ {index: 0, title: 'Title 1', description: 'Description'},
30437
+ {index: 4, title: 'Title 5', description: 'Description'},
30438
+ {index: 8, title: 'Title 9', description: 'Description'},
30439
+ {index: 11, title: 'Title 12', description: 'Description'},
30440
+ ]
30441
+
30442
+ return (
30443
+ <SpsCard>
30444
+ <SpsSteppedProgressBar
30445
+ title="Process Name"
30446
+ showStepsCounter={true}
30447
+ stepsCount={12}
30448
+ completedStepsCount={4}
30449
+ icons={iconsData}
30450
+ tooltipsData={tooltipsData}
30451
+ color={SteppedProgressBarColor.GRAY}
30452
+ />
30453
+ </SpsCard>
30454
+ )
30455
+ }
30456
+ `
30457
+ },
30427
30458
  completed: {
30428
30459
  description: () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h4", null, "Completed State"), /* @__PURE__ */ React.createElement("p", null, "Once complete, the progress bar appears in green.")),
30429
30460
  react: code`
@@ -31013,7 +31044,8 @@ const propsDoc$G = {
31013
31044
  disabled: "boolean",
31014
31045
  showStepsCounter: "boolean",
31015
31046
  icons: "IconsProps[]",
31016
- tooltipsData: "TooltipsProps[]"
31047
+ tooltipsData: "TooltipsProps[]",
31048
+ color: "SteppedProgressBarColor"
31017
31049
  };
31018
31050
  const propTypes$J = {
31019
31051
  title: propTypes$1M.exports.string,
@@ -31022,7 +31054,8 @@ const propTypes$J = {
31022
31054
  disabled: propTypes$1M.exports.bool,
31023
31055
  showStepsCounter: propTypes$1M.exports.bool,
31024
31056
  icons: propTypes$1M.exports.arrayOf(impl()),
31025
- tooltipsData: propTypes$1M.exports.arrayOf(impl())
31057
+ tooltipsData: propTypes$1M.exports.arrayOf(impl()),
31058
+ color: enumValue(SteppedProgressBarColor)
31026
31059
  };
31027
31060
  function SpsSteppedProgressBar(props2) {
31028
31061
  const {
@@ -31033,7 +31066,8 @@ function SpsSteppedProgressBar(props2) {
31033
31066
  showStepsCounter,
31034
31067
  icons,
31035
31068
  tooltipsData,
31036
- className
31069
+ className,
31070
+ color = SteppedProgressBarColor.PURPLE
31037
31071
  } = props2;
31038
31072
  function findIcon(idx) {
31039
31073
  return icons && icons.find((i2) => i2.index === idx);
@@ -31042,7 +31076,7 @@ function SpsSteppedProgressBar(props2) {
31042
31076
  return tooltipsData && tooltipsData.find((i2) => i2.index === idx);
31043
31077
  }
31044
31078
  const data = Array.from(Array(stepsCount)).map(() => useElementId(null).current);
31045
- const classes = clsx("sps-stepped-progress-bar", completedStepsCount === stepsCount && "sps-stepped-progress-bar--complete", disabled && "sps-stepped-progress-bar--disabled", className);
31079
+ const classes = clsx("sps-stepped-progress-bar", `sps-stepped-progress-bar--${color}`, completedStepsCount === stepsCount && "sps-stepped-progress-bar--complete", disabled && "sps-stepped-progress-bar--disabled", className);
31046
31080
  return /* @__PURE__ */ React.createElement("div", {
31047
31081
  className: classes
31048
31082
  }, /* @__PURE__ */ React.createElement("div", {
@@ -1,4 +1,5 @@
1
- import type { SpsIcon } from "@spscommerce/ds-shared";
1
+ import { SpsIcon } from "@spscommerce/ds-shared";
2
+ import { SteppedProgressBarColor } from "@spscommerce/ds-shared";
2
3
  import * as PropTypes from "../prop-types";
3
4
  declare const propTypes: {
4
5
  title: PropTypes.Requireable<string>;
@@ -8,6 +9,7 @@ declare const propTypes: {
8
9
  showStepsCounter: PropTypes.Requireable<boolean>;
9
10
  icons: PropTypes.Requireable<IconsProps[]>;
10
11
  tooltipsData: PropTypes.Requireable<TooltipsProps[]>;
12
+ color: PropTypes.Requireable<SteppedProgressBarColor>;
11
13
  };
12
14
  export interface IconsProps {
13
15
  index: number;
@@ -7,6 +7,10 @@ export declare const SpsSteppedProgressBarExamples: {
7
7
  description: () => JSX.Element;
8
8
  react: string;
9
9
  };
10
+ color: {
11
+ description: () => JSX.Element;
12
+ react: string;
13
+ };
10
14
  completed: {
11
15
  description: () => JSX.Element;
12
16
  react: string;
@@ -1,2 +1,2 @@
1
1
  export * from "./SpsSteppedProgressBar";
2
- export * from "./SpsStepepdProgressBar.examples";
2
+ export * from "./SpsSteppedProgressBar.examples";
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.3.0",
4
+ "version": "5.4.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.3.0",
32
- "@spscommerce/ds-shared": "5.3.0",
33
- "@spscommerce/positioning": "5.3.0",
34
- "@spscommerce/utils": "5.3.0",
31
+ "@spscommerce/ds-colors": "5.4.0",
32
+ "@spscommerce/ds-shared": "5.4.0",
33
+ "@spscommerce/positioning": "5.4.0",
34
+ "@spscommerce/utils": "5.4.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.3.0",
43
- "@spscommerce/ds-shared": "5.3.0",
44
- "@spscommerce/positioning": "5.3.0",
45
- "@spscommerce/utils": "5.3.0",
42
+ "@spscommerce/ds-colors": "5.4.0",
43
+ "@spscommerce/ds-shared": "5.4.0",
44
+ "@spscommerce/positioning": "5.4.0",
45
+ "@spscommerce/utils": "5.4.0",
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",