@spscommerce/ds-react 4.30.1 → 4.32.1
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 as SpsIcon$1, SpinnerSize, Position, ZStratum, SpsOptionListOption, DropdownKind, SPS_ACTION_DEFAULTS, ClickableTagKind, MultiSelectTagKind, TagKind, SpsIconSize, SelectMode, TooltipKind, TooltipShowTrigger, TOOLTIP_HIDE_DELAY_MS_DEFAULT, FeedbackBlockKind, FeedbackBlockIcons, GrowlerKind, GrowlerIcon, GROWLER_VISIBLE_DURATION_MS, GROWLER_FADEOUT_DURATION_MS, SpsInsightTileKind, SpsInsightTileIcons, 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 as SpsIcon$1, SpinnerSize, Position, ZStratum, SpsOptionListOption, DropdownKind, SPS_ACTION_DEFAULTS, ClickableTagKind, MultiSelectTagKind, 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";
|
|
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";
|
|
@@ -939,7 +939,7 @@ function getPosition(subjectRef, targetRef, position3, {
|
|
|
939
939
|
if (setWidth) {
|
|
940
940
|
styles.width = `${targetBounds.width}px`;
|
|
941
941
|
}
|
|
942
|
-
return [styles,
|
|
942
|
+
return [styles, positionToUse === altPosition];
|
|
943
943
|
}
|
|
944
944
|
return [{}, false];
|
|
945
945
|
}
|
|
@@ -24691,7 +24691,7 @@ const propsDoc$14 = {
|
|
|
24691
24691
|
icon: "SpsIcon",
|
|
24692
24692
|
kind: "SpsInsightTileKind",
|
|
24693
24693
|
title: "string",
|
|
24694
|
-
metric: "number",
|
|
24694
|
+
metric: "number | string",
|
|
24695
24695
|
partnerCount: "number",
|
|
24696
24696
|
totalPartners: "number"
|
|
24697
24697
|
};
|
|
@@ -24700,7 +24700,7 @@ const propTypes$17 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
24700
24700
|
icon: enumValue(SpsIcon$1),
|
|
24701
24701
|
kind: enumValue(SpsInsightTileKind),
|
|
24702
24702
|
title: propTypes$1K.exports.string,
|
|
24703
|
-
metric: propTypes$1K.exports.number,
|
|
24703
|
+
metric: propTypes$1K.exports.number || propTypes$1K.exports.string,
|
|
24704
24704
|
partnerCount: propTypes$1K.exports.number,
|
|
24705
24705
|
totalPartners: propTypes$1K.exports.number
|
|
24706
24706
|
});
|
|
@@ -25069,26 +25069,30 @@ Object.assign(SpsKeyValueList, {
|
|
|
25069
25069
|
displayName: "SpsKeyValueList"
|
|
25070
25070
|
});
|
|
25071
25071
|
const propsDoc$12 = {
|
|
25072
|
-
itemKey: { type: "string", required: true }
|
|
25072
|
+
itemKey: { type: "string | nodeOrRenderFn", required: true },
|
|
25073
|
+
titleColor: "KeyValueListTitleColor"
|
|
25073
25074
|
};
|
|
25074
25075
|
const propTypes$15 = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
25075
|
-
itemKey: propTypes$1K.exports.string.isRequired
|
|
25076
|
+
itemKey: propTypes$1K.exports.string.isRequired || nodeOrRenderFn.isRequired,
|
|
25077
|
+
titleColor: enumValue(KeyValueListTitleColor)
|
|
25076
25078
|
});
|
|
25077
25079
|
function SpsKeyValueListItem(props2) {
|
|
25078
25080
|
const _a = props2, {
|
|
25079
25081
|
children,
|
|
25080
25082
|
className,
|
|
25081
25083
|
itemKey,
|
|
25084
|
+
titleColor = KeyValueListTitleColor.LIGHT,
|
|
25082
25085
|
"data-testid": testId,
|
|
25083
25086
|
unsafelyReplaceClassName
|
|
25084
25087
|
} = _a, rest = __objRest(_a, [
|
|
25085
25088
|
"children",
|
|
25086
25089
|
"className",
|
|
25087
25090
|
"itemKey",
|
|
25091
|
+
"titleColor",
|
|
25088
25092
|
"data-testid",
|
|
25089
25093
|
"unsafelyReplaceClassName"
|
|
25090
25094
|
]);
|
|
25091
|
-
const classes = clsx(unsafelyReplaceClassName || "sps-key-value-list__item", className);
|
|
25095
|
+
const classes = clsx(unsafelyReplaceClassName || "sps-key-value-list__item", `sps-key-value-list__item--${titleColor}`, className);
|
|
25092
25096
|
return /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
25093
25097
|
className: classes,
|
|
25094
25098
|
"data-testid": `${testId}`
|
|
@@ -5,7 +5,7 @@ declare const propTypes: {
|
|
|
5
5
|
icon: PropTypes.Requireable<SpsIcon>;
|
|
6
6
|
kind: PropTypes.Requireable<SpsInsightTileKind>;
|
|
7
7
|
title: PropTypes.Requireable<string>;
|
|
8
|
-
metric: PropTypes.Requireable<number>;
|
|
8
|
+
metric: PropTypes.Requireable<string> | PropTypes.Requireable<number>;
|
|
9
9
|
partnerCount: PropTypes.Requireable<number>;
|
|
10
10
|
totalPartners: PropTypes.Requireable<number>;
|
|
11
11
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { KeyValueListTitleColor } from "@spscommerce/ds-shared";
|
|
1
2
|
import * as PropTypes from "../prop-types";
|
|
2
3
|
declare const propTypes: {
|
|
3
|
-
itemKey: PropTypes.Validator<
|
|
4
|
+
itemKey: PropTypes.Validator<PropTypes.ReactNodeOrRenderFn>;
|
|
5
|
+
titleColor: PropTypes.Requireable<KeyValueListTitleColor>;
|
|
4
6
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
5
7
|
className: PropTypes.Requireable<string>;
|
|
6
8
|
"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": "4.
|
|
4
|
+
"version": "4.32.1",
|
|
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.
|
|
32
|
-
"@spscommerce/ds-shared": "4.
|
|
33
|
-
"@spscommerce/positioning": "4.
|
|
34
|
-
"@spscommerce/utils": "4.
|
|
31
|
+
"@spscommerce/ds-colors": "4.32.1",
|
|
32
|
+
"@spscommerce/ds-shared": "4.32.1",
|
|
33
|
+
"@spscommerce/positioning": "4.32.1",
|
|
34
|
+
"@spscommerce/utils": "4.32.1",
|
|
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.
|
|
43
|
-
"@spscommerce/ds-shared": "4.
|
|
44
|
-
"@spscommerce/positioning": "4.
|
|
45
|
-
"@spscommerce/utils": "4.
|
|
42
|
+
"@spscommerce/ds-colors": "4.32.1",
|
|
43
|
+
"@spscommerce/ds-shared": "4.32.1",
|
|
44
|
+
"@spscommerce/positioning": "4.32.1",
|
|
45
|
+
"@spscommerce/utils": "4.32.1",
|
|
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",
|