@deque/cauldron-react 2.0.0 → 3.0.1-canary.0298c7b0

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.
Files changed (45) hide show
  1. package/lib/arrow-36f5cb02.js +25 -0
  2. package/lib/{arrow-circle-7b95a2fd.js → arrow-circle-858d89b5.js} +5 -7
  3. package/lib/cauldron.css +45 -7
  4. package/lib/chevron-cbfd92ec.js +25 -0
  5. package/lib/{chevron-double-65975fca.js → chevron-double-42e4b50e.js} +5 -6
  6. package/lib/{close-1b16b9ec.js → close-31ce4dcf.js} +2 -2
  7. package/lib/components/Address/index.d.ts +38 -0
  8. package/lib/components/Card/Card.d.ts +3 -1
  9. package/lib/components/ExpandCollapsePanel/PanelTrigger.d.ts +2 -1
  10. package/lib/components/Icon/index.d.ts +3 -1
  11. package/lib/components/Icon/types.d.ts +7 -0
  12. package/lib/components/IconButton/index.d.ts +12 -4
  13. package/lib/components/Loader/index.d.ts +2 -3
  14. package/lib/components/NavBar/NavBar.d.ts +22 -0
  15. package/lib/components/NavBar/NavItem.d.ts +14 -0
  16. package/lib/components/NavBar/index.d.ts +2 -0
  17. package/lib/components/OptionsMenu/OptionsMenu.d.ts +4 -4
  18. package/lib/components/Panel/index.d.ts +17 -0
  19. package/lib/components/ProgressBar/index.d.ts +15 -0
  20. package/lib/components/Select/index.d.ts +2 -2
  21. package/lib/components/SideBar/SideBar.d.ts +1 -0
  22. package/lib/components/Stepper/index.d.ts +2 -0
  23. package/lib/components/Table/TableCell.d.ts +2 -2
  24. package/lib/components/Table/TableHeader.d.ts +2 -2
  25. package/lib/components/Tabs/Tab.d.ts +8 -0
  26. package/lib/components/Tabs/TabPanel.d.ts +8 -0
  27. package/lib/components/Tabs/Tabs.d.ts +26 -0
  28. package/lib/components/Tabs/index.d.ts +3 -0
  29. package/lib/components/TextField/index.d.ts +0 -1
  30. package/lib/components/Toast/utils.d.ts +9 -22
  31. package/lib/components/Tooltip/index.d.ts +1 -1
  32. package/lib/{chevron-064d5f96.js → copy-d2ade017.js} +5 -5
  33. package/lib/index.d.ts +7 -1
  34. package/lib/index.js +436 -73
  35. package/lib/{arrow-97011665.js → info-square-f193e281.js} +5 -7
  36. package/lib/magnifying-glass-2907fb77.js +23 -0
  37. package/lib/{triangle-51d7723a.js → menu-2f2be7c2.js} +5 -6
  38. package/lib/recycle-0198fb67.js +25 -0
  39. package/lib/robot-22863b2b.js +29 -0
  40. package/lib/triangle-42e0eece.js +25 -0
  41. package/lib/types.d.ts +7 -0
  42. package/lib/utils/polymorphic-type/index.d.ts +40 -0
  43. package/lib/utils/use-did-update/index.d.ts +10 -0
  44. package/package.json +3 -2
  45. package/lib/menu-2bb052ac.js +0 -43
@@ -8,20 +8,18 @@ var React__default = _interopDefault(React);
8
8
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",
11
+ d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",
12
12
  vectorEffect: "non-scaling-stroke",
13
13
  fill: "currentColor"
14
14
  });
15
15
 
16
- function SvgArrow(props) {
16
+ function SvgInfoSquare(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 28,
22
- height: 28,
23
- transform: "rotate(180)"
20
+ width: 24,
21
+ height: 24
24
22
  }, props), _ref);
25
23
  }
26
24
 
27
- exports.default = SvgArrow;
25
+ exports.default = SvgInfoSquare;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+
8
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+
10
+ var _ref = /*#__PURE__*/React.createElement("path", {
11
+ d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z",
12
+ fill: "currentColor"
13
+ });
14
+
15
+ function SvgMagnifyingGlass(props) {
16
+ return /*#__PURE__*/React.createElement("svg", _extends({
17
+ viewBox: "0 0 24 24",
18
+ width: 19,
19
+ height: 19
20
+ }, props), _ref);
21
+ }
22
+
23
+ exports.default = SvgMagnifyingGlass;
@@ -8,20 +8,19 @@ var React__default = _interopDefault(React);
8
8
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M7 10l5 5 5-5z",
11
+ d: "M20 9H4v2h16V9zM4 15h16v-2H4v2z",
12
12
  vectorEffect: "non-scaling-stroke",
13
13
  fill: "currentColor"
14
14
  });
15
15
 
16
- function SvgTriangle(props) {
16
+ function SvgMenu(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
20
  viewBox: "0 0 24 24",
21
- width: 32,
22
- height: 32,
23
- transform: "rotate(270)"
21
+ width: 19,
22
+ height: 19
24
23
  }, props), _ref);
25
24
  }
26
25
 
27
- exports.default = SvgTriangle;
26
+ exports.default = SvgMenu;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+
8
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+
10
+ var _ref = /*#__PURE__*/React.createElement("path", {
11
+ d: "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8A5.87 5.87 0 016 12c0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z",
12
+ vectorEffect: "non-scaling-stroke",
13
+ fill: "currentColor"
14
+ });
15
+
16
+ function SvgRecycle(props) {
17
+ return /*#__PURE__*/React.createElement("svg", _extends({
18
+ overflow: "visible",
19
+ preserveAspectRatio: "none",
20
+ width: 24,
21
+ height: 24
22
+ }, props), _ref);
23
+ }
24
+
25
+ exports.default = SvgRecycle;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+
8
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+
10
+ var _ref = /*#__PURE__*/React.createElement("circle", {
11
+ cx: 14.5,
12
+ cy: 14.5,
13
+ r: 13.5,
14
+ fill: "currentColor"
15
+ });
16
+
17
+ var _ref2 = /*#__PURE__*/React.createElement("path", {
18
+ d: "M6.23 12.58h.92v5.51h-.92a.91.91 0 01-.92-.91V13.5a.92.92 0 01.92-.92zm14.7-1.38V19a1.84 1.84 0 01-1.84 1.84H9.91A1.84 1.84 0 018.07 19v-7.8a2.29 2.29 0 012.29-2.29h3.22V7.07a.92.92 0 011.84 0v1.84h3.22a2.29 2.29 0 012.29 2.29zm-8 2.3a1.15 1.15 0 10-1.15 1.15 1.15 1.15 0 001.15-1.15zm-.23 3.68h-1.88v.91h1.84zm2.76 0h-1.88v.91h1.84zm3-3.68a1.15 1.15 0 10-1.15 1.15 1.16 1.16 0 001.15-1.15zm-.23 3.68h-1.89v.91h1.84zm5.51-3.68v3.68a.92.92 0 01-.92.91h-.92v-5.51h.92a.92.92 0 01.92.92z",
19
+ fill: "currentColor"
20
+ });
21
+
22
+ function SvgRobot(props) {
23
+ return /*#__PURE__*/React.createElement("svg", _extends({
24
+ width: 29,
25
+ height: 29
26
+ }, props), _ref, _ref2);
27
+ }
28
+
29
+ exports.default = SvgRobot;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+
8
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+
10
+ var _ref = /*#__PURE__*/React.createElement("path", {
11
+ d: "M7 10l5 5 5-5z",
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
+ });
15
+
16
+ function SvgTriangle(props) {
17
+ return /*#__PURE__*/React.createElement("svg", _extends({
18
+ overflow: "visible",
19
+ preserveAspectRatio: "none",
20
+ width: 24,
21
+ height: 24
22
+ }, props), _ref);
23
+ }
24
+
25
+ exports.default = SvgTriangle;
package/lib/types.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare namespace Cauldron {
2
+ type LabelProps = {
3
+ 'aria-label': string;
4
+ } | {
5
+ 'aria-labelledby': string;
6
+ };
7
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Based on @radix-ui/polymorphic:
3
+ * https://github.com/radix-ui/primitives/blob/main/packages/react/polymorphic/src/polymorphic.ts
4
+ */
5
+ import * as React from 'react';
6
+ declare type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
7
+ /**
8
+ * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
9
+ */
10
+ declare type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
11
+ /**
12
+ * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
13
+ */
14
+ declare type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
15
+ declare type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
16
+ as?: E;
17
+ }>>;
18
+ interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}
19
+ /**
20
+ * Extends original type to ensure built in React types play nice
21
+ * with polymorphic components still e.g. `React.ElementRef` etc.
22
+ */
23
+ > extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
24
+ /**
25
+ * When `as` prop is passed, use this overload.
26
+ * Merges original own props (without DOM props) and the inferred props
27
+ * from `as` element with the own props taking precendence.
28
+ *
29
+ * We explicitly avoid `React.ElementType` and manually narrow the prop types
30
+ * so that events are typed when using JSX.IntrinsicElements.
31
+ */
32
+ <As = IntrinsicElementString>(props: As extends '' ? {
33
+ as: keyof JSX.IntrinsicElements;
34
+ } : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
35
+ as: As;
36
+ }> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
37
+ as: As;
38
+ }> : never): React.ReactElement | null;
39
+ }
40
+ export { ForwardRefComponent, OwnProps, IntrinsicElement, Merge };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hook to be used similarly to the React.Component#componentDidMount.
3
+ * Executes the provided `effect` when `dependencies` change but does not
4
+ * execute the effect initially (on mount) - only on update.
5
+ *
6
+ * @param effect {Function} function to be executed when dependencies update
7
+ * @param dependencies {Any} any valid dependency argument to React.useEffect
8
+ */
9
+ declare const useDidUpdate: (effect: () => void, dependencies: unknown[]) => void;
10
+ export default useDidUpdate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "2.0.0",
3
+ "version": "3.0.1-canary.0298c7b0",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "build": "yarn build:lib && yarn build:css",
16
+ "prebuild:lib": "node scripts/buildIconTypes.js",
16
17
  "build:lib": "rollup -c && tsc --declaration --emitDeclarationOnly --outDir lib",
17
18
  "build:css": "postcss --output=lib/cauldron.css src/index.css",
18
19
  "dev": "concurrently 'yarn build:css --watch' 'rollup -c --watch'",
@@ -123,4 +124,4 @@
123
124
  "\\.svg$": "<rootDir>/__tests__/svgMock.js"
124
125
  }
125
126
  }
126
- }
127
+ }
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
-
5
- var React = require('react');
6
- var React__default = _interopDefault(React);
7
-
8
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
-
10
- var _ref = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
11
- d: "M0 0h24v24H0V0z",
12
- id: "menu_svg__a",
13
- vectorEffect: "non-scaling-stroke",
14
- fill: "currentColor"
15
- }));
16
-
17
- var _ref2 = /*#__PURE__*/React.createElement("clipPath", {
18
- xmlnsXlink: "http://www.w3.org/1999/xlink",
19
- id: "menu_svg__b",
20
- vectorEffect: "non-scaling-stroke"
21
- }, /*#__PURE__*/React.createElement("use", {
22
- xlinkHref: "#menu_svg__a",
23
- vectorEffect: "non-scaling-stroke"
24
- }));
25
-
26
- var _ref3 = /*#__PURE__*/React.createElement("path", {
27
- clipPath: "url(#menu_svg__b)",
28
- d: "M20 9H4v2h16V9zM4 15h16v-2H4v2z",
29
- vectorEffect: "non-scaling-stroke",
30
- fill: "currentColor"
31
- });
32
-
33
- function SvgMenu(props) {
34
- return /*#__PURE__*/React.createElement("svg", _extends({
35
- overflow: "visible",
36
- preserveAspectRatio: "none",
37
- viewBox: "0 0 24 24",
38
- width: 19,
39
- height: 19
40
- }, props), _ref, _ref2, _ref3);
41
- }
42
-
43
- exports.default = SvgMenu;