@spscommerce/ds-react 5.5.0 → 5.6.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.cjs.js +62 -62
- package/lib/index.es.js +22 -7
- package/lib/label/SpsLabel.d.ts +1 -1
- package/lib/multi-select/SpsMultiSelect.d.ts +1 -1
- package/package.json +9 -10
- package/lib/setup-jest.d.ts +0 -1
package/lib/index.es.js
CHANGED
|
@@ -5473,6 +5473,7 @@ function SpsCheckbox(_m) {
|
|
|
5473
5473
|
id: controlId,
|
|
5474
5474
|
checked,
|
|
5475
5475
|
disabled,
|
|
5476
|
+
"data-testId": `${testId}__checkbox-input`,
|
|
5476
5477
|
onChange: handleChange
|
|
5477
5478
|
}, rest)), /* @__PURE__ */ React.createElement("label", {
|
|
5478
5479
|
className: "sps-checkable__label",
|
|
@@ -25178,7 +25179,8 @@ function SpsLabel(_o) {
|
|
|
25178
25179
|
helpIcon = SpsIcon.QUESTION_CIRCLE,
|
|
25179
25180
|
helpIconColor = "blue200",
|
|
25180
25181
|
errors,
|
|
25181
|
-
unsafelyReplaceClassName
|
|
25182
|
+
unsafelyReplaceClassName,
|
|
25183
|
+
"data-testid": testId
|
|
25182
25184
|
} = _p, rest = __objRest(_p, [
|
|
25183
25185
|
"children",
|
|
25184
25186
|
"className",
|
|
@@ -25189,7 +25191,8 @@ function SpsLabel(_o) {
|
|
|
25189
25191
|
"helpIcon",
|
|
25190
25192
|
"helpIconColor",
|
|
25191
25193
|
"errors",
|
|
25192
|
-
"unsafelyReplaceClassName"
|
|
25194
|
+
"unsafelyReplaceClassName",
|
|
25195
|
+
"data-testid"
|
|
25193
25196
|
]);
|
|
25194
25197
|
const { t: t2 } = React.useContext(I18nContext);
|
|
25195
25198
|
const errorIcon = React.useRef();
|
|
@@ -25273,9 +25276,11 @@ function SpsLabel(_o) {
|
|
|
25273
25276
|
formControl: formControl2
|
|
25274
25277
|
}, /* @__PURE__ */ React.createElement("label", __spreadValues({
|
|
25275
25278
|
htmlFor: forProp && "id" in forProp ? forProp.id : void 0,
|
|
25276
|
-
className: classes
|
|
25279
|
+
className: classes,
|
|
25280
|
+
"data-testid": testId
|
|
25277
25281
|
}, rest), /* @__PURE__ */ React.createElement("i", {
|
|
25278
25282
|
ref: suggestedIcon,
|
|
25283
|
+
"data-testid": `${testId}__suggested-icon`,
|
|
25279
25284
|
className: clsx("sps-icon", "sps-icon-exclamation-triangle", "orange200", "sps-form-group__label-suggested-icon", !stronglySuggested && "d-none"),
|
|
25280
25285
|
onClick: handleSuggestedIconClick,
|
|
25281
25286
|
onMouseEnter: () => {
|
|
@@ -25285,6 +25290,7 @@ function SpsLabel(_o) {
|
|
|
25285
25290
|
onMouseLeave: delayedHideTooltips
|
|
25286
25291
|
}), /* @__PURE__ */ React.createElement("i", {
|
|
25287
25292
|
ref: errorIcon,
|
|
25293
|
+
"data-testid": `${testId}__error-icon`,
|
|
25288
25294
|
className: clsx("sps-icon", "sps-icon-exclamation-circle", "sps-form-group__label--error-icon"),
|
|
25289
25295
|
onClick: handleLabelClick,
|
|
25290
25296
|
onMouseEnter: doShowPriorityTooltip,
|
|
@@ -25293,6 +25299,7 @@ function SpsLabel(_o) {
|
|
|
25293
25299
|
className: "sps-form-group__label-content"
|
|
25294
25300
|
}, children), /* @__PURE__ */ React.createElement("i", {
|
|
25295
25301
|
ref: helpIconRef,
|
|
25302
|
+
"data-testid": `${testId}__help-icon`,
|
|
25296
25303
|
className: clsx("sps-icon", `sps-icon-${helpIcon}`, helpIconColor, !help && "d-none"),
|
|
25297
25304
|
onClick: handleHelpClick,
|
|
25298
25305
|
onMouseEnter: () => {
|
|
@@ -25321,7 +25328,8 @@ function SpsLabel(_o) {
|
|
|
25321
25328
|
showOn: TooltipShowTrigger.MANUAL,
|
|
25322
25329
|
isShown: showSuggestedTip
|
|
25323
25330
|
}, t2("design-system:label.stronglySuggested")), description && /* @__PURE__ */ React.createElement("div", {
|
|
25324
|
-
className: "sps-form-control__description"
|
|
25331
|
+
className: "sps-form-control__description",
|
|
25332
|
+
"data-testid": `${testId}__description`
|
|
25325
25333
|
}, description));
|
|
25326
25334
|
}
|
|
25327
25335
|
Object.assign(SpsLabel, {
|
|
@@ -28945,7 +28953,8 @@ function SpsMultiSelect(_w) {
|
|
|
28945
28953
|
value,
|
|
28946
28954
|
zeroState = "There are no matching options.",
|
|
28947
28955
|
loading,
|
|
28948
|
-
icon
|
|
28956
|
+
icon,
|
|
28957
|
+
"data-testid": testId
|
|
28949
28958
|
} = _x, rest = __objRest(_x, [
|
|
28950
28959
|
"action",
|
|
28951
28960
|
"captionKey",
|
|
@@ -28967,7 +28976,8 @@ function SpsMultiSelect(_w) {
|
|
|
28967
28976
|
"value",
|
|
28968
28977
|
"zeroState",
|
|
28969
28978
|
"loading",
|
|
28970
|
-
"icon"
|
|
28979
|
+
"icon",
|
|
28980
|
+
"data-testid"
|
|
28971
28981
|
]);
|
|
28972
28982
|
const meta = formMeta || formControl2;
|
|
28973
28983
|
const { wrapperId, controlId } = useFormControlId(id2, meta);
|
|
@@ -29126,6 +29136,7 @@ function SpsMultiSelect(_w) {
|
|
|
29126
29136
|
}, textKey ? opt[textKey] : opt)), /* @__PURE__ */ React.createElement("input", __spreadValues({
|
|
29127
29137
|
type: "text",
|
|
29128
29138
|
ref: textInput,
|
|
29139
|
+
"data-testid": `${testId}__option-list-input`,
|
|
29129
29140
|
value: state.searchText,
|
|
29130
29141
|
className: "sps-text-input__input",
|
|
29131
29142
|
placeholder: value.length === 0 ? placeholder : void 0,
|
|
@@ -29144,6 +29155,7 @@ function SpsMultiSelect(_w) {
|
|
|
29144
29155
|
}) : null)), /* @__PURE__ */ React.createElement(SpsOptionList, {
|
|
29145
29156
|
id: `${wrapperId}_options`,
|
|
29146
29157
|
ref: optionListRef,
|
|
29158
|
+
"data-testid": `${testId}__option-list`,
|
|
29147
29159
|
attachTo: inputVisual,
|
|
29148
29160
|
captionKey,
|
|
29149
29161
|
disabledOptions: disableSelected ? value : null,
|
|
@@ -31303,6 +31315,7 @@ function SpsRadioButton(_y) {
|
|
|
31303
31315
|
type: "radio",
|
|
31304
31316
|
ref: inputElement,
|
|
31305
31317
|
className: "sps-checkable__input",
|
|
31318
|
+
"data-testid": `${testId}__radio-input`,
|
|
31306
31319
|
id: controlId,
|
|
31307
31320
|
name,
|
|
31308
31321
|
checked,
|
|
@@ -34010,6 +34023,7 @@ function SpsTextarea(_I) {
|
|
|
34010
34023
|
value: value || "",
|
|
34011
34024
|
disabled
|
|
34012
34025
|
}, rest)), value && !disabled && /* @__PURE__ */ React.createElement("i", {
|
|
34026
|
+
"data-testid": `${testId}__input_clear`,
|
|
34013
34027
|
className: "sps-icon sps-icon-x-circle sps-form-control__clear-btn",
|
|
34014
34028
|
onClick: clear
|
|
34015
34029
|
})));
|
|
@@ -34684,7 +34698,8 @@ function SpsToggle(props2) {
|
|
|
34684
34698
|
checked: active || false,
|
|
34685
34699
|
disabled,
|
|
34686
34700
|
onChange: handleChange,
|
|
34687
|
-
"aria-describedby": `${statusLabelID},${descriptionID}
|
|
34701
|
+
"aria-describedby": `${statusLabelID},${descriptionID}`,
|
|
34702
|
+
"data-testid": `${testId}__input`
|
|
34688
34703
|
}, rest)), /* @__PURE__ */ React.createElement("span", {
|
|
34689
34704
|
className: "sps-toggle__slider"
|
|
34690
34705
|
}), label && /* @__PURE__ */ React.createElement("label", {
|
package/lib/label/SpsLabel.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ declare const propTypes: {
|
|
|
16
16
|
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
17
17
|
};
|
|
18
18
|
export declare type SpsLabelProps = PropTypes.InferTS<typeof propTypes, HTMLLabelElement>;
|
|
19
|
-
export declare function SpsLabel({ children, className, description, for: forProp, stronglySuggested, help, helpIcon, helpIconColor, errors, unsafelyReplaceClassName, ...rest }: SpsLabelProps): JSX.Element;
|
|
19
|
+
export declare function SpsLabel({ children, className, description, for: forProp, stronglySuggested, help, helpIcon, helpIconColor, errors, unsafelyReplaceClassName, "data-testid": testId, ...rest }: SpsLabelProps): JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -30,5 +30,5 @@ declare const propTypes: {
|
|
|
30
30
|
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
31
31
|
};
|
|
32
32
|
export declare type SpsMultiSelectProps = PropTypes.InferTS<typeof propTypes, HTMLInputElement>;
|
|
33
|
-
export declare function SpsMultiSelect({ action, captionKey, className, debounce, disabled, disableSelected, comparisonKey, formControl, formMeta, hideSelected, id, onChange, options, placeholder, tallOptionList, textKey, unsafelyReplaceClassName, value, zeroState, loading, icon, ...rest }: SpsMultiSelectProps): JSX.Element;
|
|
33
|
+
export declare function SpsMultiSelect({ action, captionKey, className, debounce, disabled, disableSelected, comparisonKey, formControl, formMeta, hideSelected, id, onChange, options, placeholder, tallOptionList, textKey, unsafelyReplaceClassName, value, zeroState, loading, icon, "data-testid": testId, ...rest }: SpsMultiSelectProps): JSX.Element;
|
|
34
34
|
export {};
|
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.
|
|
4
|
+
"version": "5.6.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.
|
|
32
|
-
"@spscommerce/ds-shared": "5.
|
|
33
|
-
"@spscommerce/positioning": "5.
|
|
34
|
-
"@spscommerce/utils": "5.
|
|
31
|
+
"@spscommerce/ds-colors": "5.6.0",
|
|
32
|
+
"@spscommerce/ds-shared": "5.6.0",
|
|
33
|
+
"@spscommerce/positioning": "5.6.0",
|
|
34
|
+
"@spscommerce/utils": "5.6.0",
|
|
35
35
|
"moment": "^2.25.3",
|
|
36
36
|
"moment-timezone": "^0.5.28",
|
|
37
37
|
"react": "^16.9.0",
|
|
@@ -39,11 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@react-stately/collections": "^3.3.3",
|
|
42
|
-
"@spscommerce/ds-colors": "5.
|
|
43
|
-
"@spscommerce/ds-shared": "5.
|
|
44
|
-
"@spscommerce/positioning": "5.
|
|
45
|
-
"@spscommerce/utils": "5.
|
|
46
|
-
"@testing-library/jest-dom": "^4.2.4",
|
|
42
|
+
"@spscommerce/ds-colors": "5.6.0",
|
|
43
|
+
"@spscommerce/ds-shared": "5.6.0",
|
|
44
|
+
"@spscommerce/positioning": "5.6.0",
|
|
45
|
+
"@spscommerce/utils": "5.6.0",
|
|
47
46
|
"@testing-library/react": "^9.3.2",
|
|
48
47
|
"@types/prop-types": "^15.7.1",
|
|
49
48
|
"@types/react": "^16.9.0",
|
package/lib/setup-jest.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|