@spscommerce/ds-react 5.26.1 → 6.0.0-rc1

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.
@@ -1,25 +1,18 @@
1
+ import { ModalKind, ModalSize } from "@spscommerce/ds-shared";
1
2
  import * as React from "react";
2
3
  import * as PropTypes from "../prop-types";
3
- import { SpsModalHeader } from "./SpsModalHeader";
4
- import { SpsModalOverlay } from "./SpsModalOverlay";
5
- import { SpsModalBody } from "./SpsModalBody";
6
- import { SpsModalFooter } from "./SpsModalFooter";
7
- import { SpsModalAction } from "./SpsModalAction";
8
4
  declare const propTypes: {
9
- kind: PropTypes.Requireable<string>;
10
- id: PropTypes.Requireable<string>;
11
- isOpen: PropTypes.Requireable<boolean>;
12
- header: PropTypes.Requireable<string | (() => string)>;
13
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
14
- onOpen: PropTypes.Requireable<(...args: any[]) => any>;
15
- size: PropTypes.Requireable<string>;
16
- backdrop: PropTypes.Requireable<string>;
17
- actionRequired: PropTypes.Requireable<boolean>;
5
+ kind: PropTypes.Requireable<ModalKind>;
6
+ size: PropTypes.Requireable<ModalSize>;
7
+ title: PropTypes.Requireable<string>;
8
+ onClose: PropTypes.Requireable<() => void>;
9
+ focusElementOnOpen: PropTypes.Requireable<React.MutableRefObject<HTMLElement>>;
18
10
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
19
11
  className: PropTypes.Requireable<string>;
20
12
  "data-testid": PropTypes.Requireable<string>;
21
13
  unsafelyReplaceClassName: PropTypes.Requireable<string>;
22
14
  };
23
15
  export declare type SpsModalProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
24
- declare function SpsModal(modalProps: SpsModalProps): React.ReactPortal;
25
- export { SpsModal, SpsModalHeader, SpsModalOverlay, SpsModalBody, SpsModalFooter, SpsModalAction, };
16
+ export declare function SpsModalFooter({ children }: SpsModalProps): JSX.Element;
17
+ export declare function SpsModal({ children, className, id: idProp, kind, size, onClose, focusElementOnOpen, title, ...rest }: SpsModalProps): JSX.Element;
18
+ export {};
@@ -4,15 +4,11 @@ import type { SpsFormFieldMeta } from "../form/hooks/useSpsForm";
4
4
  import * as PropTypes from "../prop-types";
5
5
  declare const propTypes: {
6
6
  active: PropTypes.Requireable<boolean>;
7
- activeDescription: PropTypes.Deprecated<string>;
8
- activeLabel: PropTypes.Deprecated<string>;
9
7
  description: PropTypes.Requireable<string>;
10
8
  disabled: PropTypes.Requireable<boolean>;
11
9
  formControl: PropTypes.Requireable<SpsFormControl<boolean>>;
12
10
  formMeta: PropTypes.Requireable<SpsFormFieldMeta<boolean>>;
13
11
  id: PropTypes.Requireable<string>;
14
- inactiveDescription: PropTypes.Deprecated<string>;
15
- inactiveLabel: PropTypes.Deprecated<string>;
16
12
  label: PropTypes.Requireable<string>;
17
13
  large: PropTypes.Requireable<boolean>;
18
14
  onChange: PropTypes.Requireable<(isActive: boolean) => void>;
@@ -1,8 +1,6 @@
1
- export * from "./bindProps";
2
1
  export * from "./contentOf";
3
2
  export * from "./FauxChangeEvent";
4
3
  export * from "./getPosition";
5
- export * from "./Provide";
6
4
  export * from "./selectChildren";
7
5
  export * from "./useCheckDeprecatedProps";
8
6
  export * from "./useDidUpdateEffect";
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.26.1",
4
+ "version": "6.0.0-rc1",
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.26.1",
32
- "@spscommerce/ds-illustrations": "5.26.1",
33
- "@spscommerce/ds-shared": "5.26.1",
34
- "@spscommerce/positioning": "5.26.1",
35
- "@spscommerce/utils": "5.26.1",
31
+ "@spscommerce/ds-colors": "6.0.0-rc1",
32
+ "@spscommerce/ds-illustrations": "6.0.0-rc1",
33
+ "@spscommerce/ds-shared": "6.0.0-rc1",
34
+ "@spscommerce/positioning": "6.0.0-rc1",
35
+ "@spscommerce/utils": "6.0.0-rc1",
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.26.1",
44
- "@spscommerce/ds-illustrations": "5.26.1",
45
- "@spscommerce/ds-shared": "5.26.1",
46
- "@spscommerce/positioning": "5.26.1",
47
- "@spscommerce/utils": "5.26.1",
43
+ "@spscommerce/ds-colors": "6.0.0-rc1",
44
+ "@spscommerce/ds-illustrations": "6.0.0-rc1",
45
+ "@spscommerce/ds-shared": "6.0.0-rc1",
46
+ "@spscommerce/positioning": "6.0.0-rc1",
47
+ "@spscommerce/utils": "6.0.0-rc1",
48
48
  "@testing-library/react": "^9.3.2",
49
49
  "@types/prop-types": "^15.7.1",
50
50
  "@types/react": "^16.9.0",
@@ -64,6 +64,5 @@
64
64
  "watch": "vite build --watch",
65
65
  "clean": "git clean -fdX",
66
66
  "pub": "pnpm pack && node ../../scripts/publish-package.js"
67
- },
68
- "readme": "[//]: # \"START_AUTOGENERATED\"\n\n## [@spscommerce/ds-react](https://github.com/spscommerce/ui-angular/tree/master/packages/@spscommerce/ds-react#readme)\n\n![release: 1.1.0](https://img.shields.io/badge/release-1.1.0-blue.svg?style=flat-square)\n![build: passing](https://img.shields.io/badge/build-passing-green.svg?style=flat-square)\n![tests: failing](https://img.shields.io/badge/tests-failing-red.svg?style=flat-square)\n\nSPS Design System React components \n \n ### Installation \n \n ```shell\nnpm install --save @spscommerce/ds-react\n```\n\n#### Peer Dependencies\n\n<div class=\"row\">\n <div class=\"col-5\"> \n <table class=\"sps-table\">\n <thead class=\"sps-table__head\">\n <tr class=\"sps-table__row\">\n <th class=\"sps-table__header\">\n <span class=\"sps-table__header-cell-body\"> \n Package\n </span>\n </th>\n <th class=\"sps-table__header text-right\">\n <span class=\"sps-table__header-cell-body\"> \n Version\n </span>\n </th>\n </tr>\n </thead>\n <tbody class=\"sps-table__body\">\n <tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-shared#readme\">@spscommerce/ds-shared</a></td><td class=\"sps-table__cell text-right\">^1.1.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/positioning#readme\">@spscommerce/positioning</a></td><td class=\"sps-table__cell text-right\">^1.1.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/utils#readme\">@spscommerce/utils</a></td><td class=\"sps-table__cell text-right\">^1.1.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"lukeed/clsx\">clsx</a></td><td class=\"sps-table__cell text-right\">^1.0.3</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://momentjs.com\">moment</a></td><td class=\"sps-table__cell text-right\">^2.25.3</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"http://momentjs.com/timezone/\">moment-timezone</a></td><td class=\"sps-table__cell text-right\">^0.5.28</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"ai/nanoid\">nanoid</a></td><td class=\"sps-table__cell text-right\">^2.1.6</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://facebook.github.io/react/\">prop-types</a></td><td class=\"sps-table__cell text-right\">^15.7.2</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://reactjs.org/\">react</a></td><td class=\"sps-table__cell text-right\">^16.9.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://reactjs.org/\">react-dom</a></td><td class=\"sps-table__cell text-right\">^16.9.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://scroll-into-view-if-needed.netlify.com\">scroll-into-view-if-needed</a></td><td class=\"sps-table__cell text-right\">^2.2.20</td></tr>\n </tbody>\n </table>\n </div>\n <div class=\"col-7\">\n &nbsp;\n </div>\n</div>\n\n[//]: # \"END_AUTOGENERATED\"\n"
67
+ }
69
68
  }
@@ -1,24 +0,0 @@
1
- import * as React from "react";
2
- /**
3
- * This is the use case for Nested: wrapping JSX in a flat list of
4
- * multiple React context providers instead of creating a pyramid of doom.
5
- *
6
- * bindProps (see bindProps.tsx in this same directory) was
7
- * created to be used with this, so you can set props on the
8
- * providers, including and especially `value` on the built-in
9
- * context object's `.Provider` component.
10
- *
11
- * <Provide providers={[
12
- * ProplessProviderFromALibrary,
13
- * bindProps(MyReallyUsefulContext.Provider, { value: "foo" }),
14
- * // ...etc
15
- * ]}>
16
- * (component tree that will have access to context from these providers)
17
- * </Provide>
18
- */
19
- declare type ProvideProps = React.HTMLProps<HTMLDivElement> & {
20
- providers?: React.ElementType[];
21
- };
22
- export declare const Provide: React.FC<ProvideProps>;
23
- export declare const SpsApp: React.FC<ProvideProps>;
24
- export {};
@@ -1,33 +0,0 @@
1
- import * as React from "react";
2
- /**
3
- * takes in an ElementType (e.g. a React component) and
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.
7
- *
8
- * for example, consider the following component:
9
- * const Foo: React.FC<{
10
- * a: string;
11
- * b: string;
12
- * }> = function ({ a, b }) {
13
- * return (
14
- * <span>
15
- * a is {a} and b is {b}
16
- * </span>
17
- * );
18
- * };
19
- *
20
- * <Foo a="dog" b="cat"/> would produce <span>a is dog and b is cat</span>
21
- *
22
- * But if you bind the prop a...
23
- * const FooWithBoundA = bindProps(Foo, { a: "parakeet" });
24
- *
25
- * then <FooWithBoundA a="dog" b="cat"/> will produce <span>a is parakeet and b is cat</span>
26
- *
27
- * The type of the props is the same, but prop a is always going to be overridden to its
28
- * bound value.
29
- *
30
- * This was created to be used with <Provide> (see Provide.tsx in this same directory),
31
- * but may have other use cases.
32
- */
33
- export declare function bindProps<T extends React.ElementType>(E: T, boundProps: Partial<React.ComponentProps<T>>, deps?: unknown[]): React.FC<React.ComponentProps<T>>;