@spscommerce/ds-react 5.33.5 → 5.33.6

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.
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  /**
3
3
  * takes in an ElementType (e.g. a React component) and
4
4
  * returns a new version of that component where certain
5
- * props are ALWAYS set to predefined values regardless of
6
- * what is passed in.
5
+ * props are ALWAYS set to predefined values.
7
6
  *
8
7
  * for example, consider the following component:
9
8
  * const Foo: React.FC<{
@@ -22,12 +21,13 @@ import * as React from "react";
22
21
  * But if you bind the prop a...
23
22
  * const FooWithBoundA = bindProps(Foo, { a: "parakeet" });
24
23
  *
25
- * then <FooWithBoundA a="dog" b="cat"/> will produce <span>a is parakeet and b is cat</span>
24
+ * then <FooWithBoundA b="cat"/> will produce <span>a is parakeet and b is cat</span>
26
25
  *
27
- * The type of the props is the same, but prop a is always going to be overridden to its
28
- * bound value.
26
+ * The type of the props is the same, except that prop a is pre-set and so no
27
+ * longer something that can be passed in.
29
28
  *
30
29
  * This was created to be used with <Provide> (see Provide.tsx in this same directory),
31
30
  * but may have other use cases.
32
31
  */
33
- export declare function bindProps<T extends React.ElementType>(E: T, boundProps: Partial<React.ComponentProps<T>>, deps?: unknown[]): React.FC<React.ComponentProps<T>>;
32
+ export declare type BoundFC<T extends React.ElementType, K extends Partial<React.ComponentProps<T>>> = React.FC<Omit<React.ComponentProps<T>, keyof K>>;
33
+ export declare function bindProps<T extends React.ElementType, K extends Partial<React.ComponentProps<T>>>(E: T, boundProps: K, deps?: unknown[]): BoundFC<T, K>;
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.33.5",
4
+ "version": "5.33.6",
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,11 +28,11 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@react-stately/collections": "^3.3.3",
31
- "@spscommerce/ds-colors": "5.33.5",
32
- "@spscommerce/ds-illustrations": "5.33.5",
33
- "@spscommerce/ds-shared": "5.33.5",
34
- "@spscommerce/positioning": "5.33.5",
35
- "@spscommerce/utils": "5.33.5",
31
+ "@spscommerce/ds-colors": "5.33.6",
32
+ "@spscommerce/ds-illustrations": "5.33.6",
33
+ "@spscommerce/ds-shared": "5.33.6",
34
+ "@spscommerce/positioning": "5.33.6",
35
+ "@spscommerce/utils": "5.33.6",
36
36
  "moment": "^2.25.3",
37
37
  "moment-timezone": "^0.5.28",
38
38
  "react": "^16.9.0",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@react-stately/collections": "^3.3.3",
43
- "@spscommerce/ds-colors": "5.33.5",
44
- "@spscommerce/ds-illustrations": "5.33.5",
45
- "@spscommerce/ds-shared": "5.33.5",
46
- "@spscommerce/positioning": "5.33.5",
47
- "@spscommerce/utils": "5.33.5",
43
+ "@spscommerce/ds-colors": "5.33.6",
44
+ "@spscommerce/ds-illustrations": "5.33.6",
45
+ "@spscommerce/ds-shared": "5.33.6",
46
+ "@spscommerce/positioning": "5.33.6",
47
+ "@spscommerce/utils": "5.33.6",
48
48
  "@testing-library/react": "^9.3.2",
49
49
  "@types/prop-types": "^15.7.1",
50
50
  "@types/react": "^16.9.0",