@carbon/charts-react 0.41.68 → 0.41.72

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [0.41.68](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.67...v0.41.68) (2021-06-08)
6
+ ## [0.41.72](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.71...v0.41.72) (2021-06-23)
7
7
 
8
8
  **Note:** Version bump only for package @carbon/charts-react
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [0.41.67](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.66...v0.41.67) (2021-05-31)
14
+ ## [0.41.71](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.70...v0.41.71) (2021-06-21)
15
15
 
16
16
  **Note:** Version bump only for package @carbon/charts-react
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- ## [0.41.66](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.65...v0.41.66) (2021-05-25)
22
+ ## [0.41.70](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.69...v0.41.70) (2021-06-21)
23
23
 
24
24
  **Note:** Version bump only for package @carbon/charts-react
25
25
 
@@ -27,13 +27,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- ## [0.41.65](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.64...v0.41.65) (2021-05-19)
30
+ # Change Log
31
+
32
+ All notable changes to this project will be documented in this file. See
33
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
34
+
35
+ ## [0.41.69](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.68...v0.41.69) (2021-06-21)
36
+
37
+ **Note:** Version bump only for package @carbon/charts-react
38
+
39
+ # Change Log
40
+
41
+ All notable changes to this project will be documented in this file. See
42
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
43
+
44
+ ## [0.41.68](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.67...v0.41.68) (2021-06-08)
31
45
 
32
46
  **Note:** Version bump only for package @carbon/charts-react
33
47
 
48
+ ## [0.41.67](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.66...v0.41.67) (2021-05-31)
34
49
 
50
+ **Note:** Version bump only for package @carbon/charts-react
35
51
 
52
+ ## [0.41.66](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.65...v0.41.66) (2021-05-25)
36
53
 
54
+ **Note:** Version bump only for package @carbon/charts-react
55
+
56
+ ## [0.41.65](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.64...v0.41.65) (2021-05-19)
57
+
58
+ **Note:** Version bump only for package @carbon/charts-react
37
59
 
38
60
  # Change Log
39
61
 
@@ -96,19 +118,7 @@ All notable changes to this project will be documented in this file. See
96
118
  All notable changes to this project will be documented in this file. See
97
119
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
98
120
 
99
- ## [0.41.56](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.55...v0.41.56) (2021-04-16)
100
-
101
- **Note:** Version bump only for package @carbon/charts-react
102
-
103
- ## [0.41.55](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.54...v0.41.55) (2021-04-14)
104
-
105
- **Note:** Version bump only for package @carbon/charts-react
106
-
107
- ## [0.41.54](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.53...v0.41.54) (2021-04-14)
108
-
109
- **Note:** Version bump only for package @carbon/charts-react
110
-
111
- ## [0.41.53](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.52...v0.41.53) (2021-04-13)
121
+ ## [0.41.57](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.56...v0.41.57) (2021-04-20)
112
122
 
113
123
  **Note:** Version bump only for package @carbon/charts-react
114
124
 
@@ -0,0 +1,50 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const CardNode: {
3
+ ({ as, children, color, href, onMouseEnter, onMouseOver, onMouseOut, onMouseLeave, onMouseMove, onClick, stacked, }: any): JSX.Element;
4
+ propTypes: {
5
+ /** Provide a custom element to be rendered instead of the default */
6
+ as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
7
+ /**
8
+ * Pass in the children that will be rendered within the CardNode
9
+ */
10
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
11
+ /**
12
+ * Specify the node's border color
13
+ */
14
+ color: PropTypes.Requireable<string>;
15
+ /**
16
+ * Optionally specify an href for the CardNode to become an `<a>` element
17
+ */
18
+ href: PropTypes.Requireable<string>;
19
+ /**
20
+ * Provide an optional function to be called when the CardNode
21
+ * is clicked, turning the CardNode into a `<button>` element
22
+ */
23
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
24
+ /**
25
+ * Provide an optional function to be called for the onMouseEnter event
26
+ */
27
+ onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
28
+ /**
29
+ * Provide an optional function to be called for the onMouseOver event
30
+ */
31
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
32
+ /**
33
+ * Provide an optional function to be called for the onMouseOut event
34
+ */
35
+ onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
36
+ /**
37
+ * Provide an optional function to be called for the onMouseLeave event
38
+ */
39
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
40
+ /**
41
+ * Provide an optional function to be called for the onMouseMove event
42
+ */
43
+ onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
44
+ /**
45
+ * Specify whether the node displays a stacked effect
46
+ */
47
+ stacked: PropTypes.Requireable<boolean>;
48
+ };
49
+ };
50
+ export default CardNode;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var prop_types_1 = __importDefault(require("prop-types"));
8
+ // @ts-ignore
9
+ var classnames_1 = __importDefault(require("classnames"));
10
+ // @ts-ignore
11
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
12
+ var prefix = settings_1.default.prefix;
13
+ var namespace = prefix + "--cc--card-node";
14
+ var CardNode = function (_a) {
15
+ var _b;
16
+ var _c = _a.as, as = _c === void 0 ? 'div' : _c, children = _a.children, color = _a.color, _d = _a.href, href = _d === void 0 ? null : _d, _e = _a.onMouseEnter, onMouseEnter = _e === void 0 ? null : _e, _f = _a.onMouseOver, onMouseOver = _f === void 0 ? null : _f, _g = _a.onMouseOut, onMouseOut = _g === void 0 ? null : _g, _h = _a.onMouseLeave, onMouseLeave = _h === void 0 ? null : _h, _j = _a.onMouseMove, onMouseMove = _j === void 0 ? null : _j, _k = _a.onClick, onClick = _k === void 0 ? null : _k, stacked = _a.stacked;
17
+ var Component = 'div';
18
+ if (as !== 'div') {
19
+ Component = as;
20
+ }
21
+ else if (href) {
22
+ Component = 'a';
23
+ }
24
+ else if (onClick) {
25
+ Component = 'button';
26
+ }
27
+ var cardClasses = classnames_1.default(namespace, (_b = {},
28
+ _b[namespace + "--stacked"] = stacked,
29
+ _b[namespace + "--" + Component] = Component,
30
+ _b));
31
+ return (
32
+ // @ts-ignore
33
+ react_1.default.createElement(Component, { className: cardClasses, onClick: onClick, onMouseEnter: onMouseEnter, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onMouseLeave: onMouseLeave, onMouseMove: onMouseMove, style: { borderColor: color }, tabIndex: 0 }, children));
34
+ };
35
+ exports.default = CardNode;
36
+ CardNode.propTypes = {
37
+ /** Provide a custom element to be rendered instead of the default */
38
+ as: prop_types_1.default.elementType,
39
+ /**
40
+ * Pass in the children that will be rendered within the CardNode
41
+ */
42
+ children: prop_types_1.default.node,
43
+ /**
44
+ * Specify the node's border color
45
+ */
46
+ color: prop_types_1.default.string,
47
+ /**
48
+ * Optionally specify an href for the CardNode to become an `<a>` element
49
+ */
50
+ href: prop_types_1.default.string,
51
+ /**
52
+ * Provide an optional function to be called when the CardNode
53
+ * is clicked, turning the CardNode into a `<button>` element
54
+ */
55
+ onClick: prop_types_1.default.func,
56
+ /**
57
+ * Provide an optional function to be called for the onMouseEnter event
58
+ */
59
+ onMouseEnter: prop_types_1.default.func,
60
+ /**
61
+ * Provide an optional function to be called for the onMouseOver event
62
+ */
63
+ onMouseOver: prop_types_1.default.func,
64
+ /**
65
+ * Provide an optional function to be called for the onMouseOut event
66
+ */
67
+ onMouseOut: prop_types_1.default.func,
68
+ /**
69
+ * Provide an optional function to be called for the onMouseLeave event
70
+ */
71
+ onMouseLeave: prop_types_1.default.func,
72
+ /**
73
+ * Provide an optional function to be called for the onMouseMove event
74
+ */
75
+ onMouseMove: prop_types_1.default.func,
76
+ /**
77
+ * Specify whether the node displays a stacked effect
78
+ */
79
+ stacked: prop_types_1.default.bool,
80
+ };
@@ -0,0 +1,15 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const CardNodeColumn: {
3
+ ({ children, farsideColumn }: any): JSX.Element;
4
+ propTypes: {
5
+ /**
6
+ * Pass in the children that will be rendered within the CardNodeColumn
7
+ */
8
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ /**
10
+ * Specify whether this is the last column
11
+ */
12
+ farsideColumn: PropTypes.Requireable<boolean>;
13
+ };
14
+ };
15
+ export { CardNodeColumn };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardNodeColumn = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var prop_types_1 = __importDefault(require("prop-types"));
9
+ // @ts-ignore
10
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
11
+ var prefix = settings_1.default.prefix;
12
+ var namespace = prefix + "--cc--card-node";
13
+ var CardNodeColumn = function (_a) {
14
+ var children = _a.children, farsideColumn = _a.farsideColumn;
15
+ return (react_1.default.createElement("div", { className: namespace + "__column " + (farsideColumn && namespace + "__column--farside") }, children));
16
+ };
17
+ exports.CardNodeColumn = CardNodeColumn;
18
+ CardNodeColumn.propTypes = {
19
+ /**
20
+ * Pass in the children that will be rendered within the CardNodeColumn
21
+ */
22
+ children: prop_types_1.default.node,
23
+ /**
24
+ * Specify whether this is the last column
25
+ */
26
+ farsideColumn: prop_types_1.default.bool,
27
+ };
@@ -0,0 +1,11 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const CardNodeLabel: {
3
+ ({ children }: any): JSX.Element;
4
+ propTypes: {
5
+ /**
6
+ * Pass in the children that will be rendered within the CardNodeLabel
7
+ */
8
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ };
10
+ };
11
+ export { CardNodeLabel };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardNodeLabel = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var prop_types_1 = __importDefault(require("prop-types"));
9
+ // @ts-ignore
10
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
11
+ var prefix = settings_1.default.prefix;
12
+ var namespace = prefix + "--cc--card-node";
13
+ var CardNodeLabel = function (_a) {
14
+ var children = _a.children;
15
+ return (react_1.default.createElement("label", { className: namespace + "__label" }, children));
16
+ };
17
+ exports.CardNodeLabel = CardNodeLabel;
18
+ CardNodeLabel.propTypes = {
19
+ /**
20
+ * Pass in the children that will be rendered within the CardNodeLabel
21
+ */
22
+ children: prop_types_1.default.node,
23
+ };
@@ -0,0 +1,11 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const CardNodeSubtitle: {
3
+ ({ children }: any): JSX.Element;
4
+ propTypes: {
5
+ /**
6
+ * Pass in the children that will be rendered within the CardNodeSubtitle
7
+ */
8
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ };
10
+ };
11
+ export { CardNodeSubtitle };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardNodeSubtitle = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var prop_types_1 = __importDefault(require("prop-types"));
9
+ // @ts-ignore
10
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
11
+ var prefix = settings_1.default.prefix;
12
+ var namespace = prefix + "--cc--card-node";
13
+ var CardNodeSubtitle = function (_a) {
14
+ var children = _a.children;
15
+ return (react_1.default.createElement("div", { className: namespace + "__subtitle" }, children));
16
+ };
17
+ exports.CardNodeSubtitle = CardNodeSubtitle;
18
+ CardNodeSubtitle.propTypes = {
19
+ /**
20
+ * Pass in the children that will be rendered within the CardNodeSubtitle
21
+ */
22
+ children: prop_types_1.default.node,
23
+ };
@@ -0,0 +1,11 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const CardNodeTitle: {
3
+ ({ children }: any): JSX.Element;
4
+ propTypes: {
5
+ /**
6
+ * Pass in the children that will be rendered within the CardNodeTitle
7
+ */
8
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ };
10
+ };
11
+ export { CardNodeTitle };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardNodeTitle = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var prop_types_1 = __importDefault(require("prop-types"));
9
+ // @ts-ignore
10
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
11
+ var prefix = settings_1.default.prefix;
12
+ var namespace = prefix + "--cc--card-node";
13
+ var CardNodeTitle = function (_a) {
14
+ var children = _a.children;
15
+ return (react_1.default.createElement("div", { className: namespace + "__title" }, children));
16
+ };
17
+ exports.CardNodeTitle = CardNodeTitle;
18
+ CardNodeTitle.propTypes = {
19
+ /**
20
+ * Pass in the children that will be rendered within the CardNodeTitle
21
+ */
22
+ children: prop_types_1.default.node,
23
+ };
@@ -0,0 +1,6 @@
1
+ import CardNode from './CardNode';
2
+ import { CardNodeColumn } from './CardNodeColumn';
3
+ import { CardNodeLabel } from './CardNodeLabel';
4
+ import { CardNodeSubtitle } from './CardNodeSubtitle';
5
+ import { CardNodeTitle } from './CardNodeTitle';
6
+ export { CardNode as default, CardNodeColumn, CardNodeSubtitle, CardNodeTitle, CardNodeLabel, };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardNodeLabel = exports.CardNodeTitle = exports.CardNodeSubtitle = exports.CardNodeColumn = exports.default = void 0;
7
+ var CardNode_1 = __importDefault(require("./CardNode"));
8
+ exports.default = CardNode_1.default;
9
+ var CardNodeColumn_1 = require("./CardNodeColumn");
10
+ Object.defineProperty(exports, "CardNodeColumn", { enumerable: true, get: function () { return CardNodeColumn_1.CardNodeColumn; } });
11
+ var CardNodeLabel_1 = require("./CardNodeLabel");
12
+ Object.defineProperty(exports, "CardNodeLabel", { enumerable: true, get: function () { return CardNodeLabel_1.CardNodeLabel; } });
13
+ var CardNodeSubtitle_1 = require("./CardNodeSubtitle");
14
+ Object.defineProperty(exports, "CardNodeSubtitle", { enumerable: true, get: function () { return CardNodeSubtitle_1.CardNodeSubtitle; } });
15
+ var CardNodeTitle_1 = require("./CardNodeTitle");
16
+ Object.defineProperty(exports, "CardNodeTitle", { enumerable: true, get: function () { return CardNodeTitle_1.CardNodeTitle; } });
@@ -0,0 +1,61 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const Edge: {
3
+ ({ color, markerEnd, markerStart, onMouseEnter, onMouseOver, onMouseOut, onMouseLeave, onMouseMove, path, source, target, variant, }: any): JSX.Element;
4
+ propTypes: {
5
+ /**
6
+ * Specify the edge's color
7
+ */
8
+ color: PropTypes.Requireable<string>;
9
+ /**
10
+ * Specify an ID for a corresponding end marker
11
+ */
12
+ markerEnd: PropTypes.Requireable<string>;
13
+ /**
14
+ * Specify an ID for a corresponding start marker
15
+ */
16
+ markerStart: PropTypes.Requireable<string>;
17
+ /**
18
+ * Provide an optional function to be called for the onMouseEnter event
19
+ */
20
+ onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
21
+ /**
22
+ * Provide an optional function to be called for the onMouseOver event
23
+ */
24
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
25
+ /**
26
+ * Provide an optional function to be called for the onMouseOut event
27
+ */
28
+ onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
29
+ /**
30
+ * Provide an optional function to be called for the onMouseLeave event
31
+ */
32
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
33
+ /**
34
+ * Provide an optional function to be called for the onMouseMove event
35
+ */
36
+ onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
37
+ /**
38
+ * Specify a path string
39
+ */
40
+ path: PropTypes.Requireable<string>;
41
+ /**
42
+ * Coordinates for the source element
43
+ */
44
+ source: PropTypes.Requireable<PropTypes.InferProps<{
45
+ x: PropTypes.Requireable<number>;
46
+ y: PropTypes.Requireable<number>;
47
+ }>>;
48
+ /**
49
+ * Coordinates for the target element
50
+ */
51
+ target: PropTypes.Requireable<PropTypes.InferProps<{
52
+ x: PropTypes.Requireable<number>;
53
+ y: PropTypes.Requireable<number>;
54
+ }>>;
55
+ /**
56
+ * Specify the variant of the edge
57
+ */
58
+ variant: PropTypes.Requireable<string>;
59
+ };
60
+ };
61
+ export default Edge;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var prop_types_1 = __importDefault(require("prop-types"));
8
+ // @ts-ignore
9
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
10
+ // @ts-ignore
11
+ var classnames_1 = __importDefault(require("classnames"));
12
+ var buildPaths_1 = require("@carbon/charts/components/diagrams/buildPaths");
13
+ var prefix = settings_1.default.prefix;
14
+ var Edge = function (_a) {
15
+ var _b;
16
+ var color = _a.color, markerEnd = _a.markerEnd, markerStart = _a.markerStart, _c = _a.onMouseEnter, onMouseEnter = _c === void 0 ? null : _c, _d = _a.onMouseOver, onMouseOver = _d === void 0 ? null : _d, _e = _a.onMouseOut, onMouseOut = _e === void 0 ? null : _e, _f = _a.onMouseLeave, onMouseLeave = _f === void 0 ? null : _f, _g = _a.onMouseMove, onMouseMove = _g === void 0 ? null : _g, path = _a.path, source = _a.source, target = _a.target, _h = _a.variant, variant = _h === void 0 ? null : _h;
17
+ var namespace = prefix + "--cc--edge";
18
+ var pathClasses = classnames_1.default(namespace, (_b = {},
19
+ _b[namespace + "--" + variant] = variant,
20
+ _b));
21
+ var d = path || buildPaths_1.buildStraightPathString(source, target);
22
+ return (react_1.default.createElement("g", { className: pathClasses, onMouseEnter: onMouseEnter, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onMouseLeave: onMouseLeave, onMouseMove: onMouseMove },
23
+ react_1.default.createElement("path", { d: d, className: namespace + "__container" }),
24
+ react_1.default.createElement("path", { d: d, className: namespace + "__outer" }),
25
+ react_1.default.createElement("path", { d: d, className: namespace + "__inner", markerEnd: "url(#" + markerEnd + ")", markerStart: "url(#" + markerStart + ")", style: { stroke: color } })));
26
+ };
27
+ exports.default = Edge;
28
+ Edge.propTypes = {
29
+ /**
30
+ * Specify the edge's color
31
+ */
32
+ color: prop_types_1.default.string,
33
+ /**
34
+ * Specify an ID for a corresponding end marker
35
+ */
36
+ markerEnd: prop_types_1.default.string,
37
+ /**
38
+ * Specify an ID for a corresponding start marker
39
+ */
40
+ markerStart: prop_types_1.default.string,
41
+ /**
42
+ * Provide an optional function to be called for the onMouseEnter event
43
+ */
44
+ onMouseEnter: prop_types_1.default.func,
45
+ /**
46
+ * Provide an optional function to be called for the onMouseOver event
47
+ */
48
+ onMouseOver: prop_types_1.default.func,
49
+ /**
50
+ * Provide an optional function to be called for the onMouseOut event
51
+ */
52
+ onMouseOut: prop_types_1.default.func,
53
+ /**
54
+ * Provide an optional function to be called for the onMouseLeave event
55
+ */
56
+ onMouseLeave: prop_types_1.default.func,
57
+ /**
58
+ * Provide an optional function to be called for the onMouseMove event
59
+ */
60
+ onMouseMove: prop_types_1.default.func,
61
+ /**
62
+ * Specify a path string
63
+ */
64
+ path: prop_types_1.default.string,
65
+ /**
66
+ * Coordinates for the source element
67
+ */
68
+ source: prop_types_1.default.shape({
69
+ x: prop_types_1.default.number,
70
+ y: prop_types_1.default.number,
71
+ }),
72
+ /**
73
+ * Coordinates for the target element
74
+ */
75
+ target: prop_types_1.default.shape({
76
+ x: prop_types_1.default.number,
77
+ y: prop_types_1.default.number,
78
+ }),
79
+ /**
80
+ * Specify the variant of the edge
81
+ */
82
+ variant: prop_types_1.default.oneOf([
83
+ 'dash-sm',
84
+ 'dash-md',
85
+ 'dash-lg',
86
+ 'dash-xl',
87
+ 'double',
88
+ 'tunnel',
89
+ ]),
90
+ };
@@ -0,0 +1,2 @@
1
+ import Edge from './Edge';
2
+ export default Edge;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var Edge_1 = __importDefault(require("./Edge"));
7
+ exports.default = Edge_1.default;
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ declare const Marker: {
4
+ ({ d, color, id, orient, height, width, position, refX, refY, }: any): JSX.Element;
5
+ propTypes: {
6
+ /**
7
+ * Specify a path string
8
+ */
9
+ d: PropTypes.Requireable<string>;
10
+ /**
11
+ * Specify the marker's color
12
+ */
13
+ color: PropTypes.Requireable<string>;
14
+ /**
15
+ * Specify an ID for the marker
16
+ */
17
+ id: PropTypes.Requireable<string>;
18
+ /**
19
+ * Specify the orient attribute for the marker
20
+ */
21
+ orient: PropTypes.Requireable<React.ReactText>;
22
+ /**
23
+ * Specify the height attribute for the marker
24
+ */
25
+ height: PropTypes.Requireable<React.ReactText>;
26
+ /**
27
+ * Specify the width attribute for the marker
28
+ */
29
+ width: PropTypes.Requireable<React.ReactText>;
30
+ /**
31
+ * Specify whether this marker appears at the start or end of a line
32
+ */
33
+ position: PropTypes.Requireable<string>;
34
+ /**
35
+ * Specify the refX attribute for the marker
36
+ */
37
+ refX: PropTypes.Requireable<React.ReactText>;
38
+ /**
39
+ * Specify the refY attribute for the marker
40
+ */
41
+ refY: PropTypes.Requireable<React.ReactText>;
42
+ };
43
+ };
44
+ declare const ArrowLeftMarker: ({ ...rest }: {
45
+ [x: string]: any;
46
+ }) => JSX.Element;
47
+ declare const ArrowRightMarker: ({ ...rest }: {
48
+ [x: string]: any;
49
+ }) => JSX.Element;
50
+ declare const CircleMarker: ({ ...rest }: {
51
+ [x: string]: any;
52
+ }) => JSX.Element;
53
+ declare const DiamondMarker: ({ ...rest }: {
54
+ [x: string]: any;
55
+ }) => JSX.Element;
56
+ declare const SquareMarker: ({ ...rest }: {
57
+ [x: string]: any;
58
+ }) => JSX.Element;
59
+ declare const TeeMarker: ({ ...rest }: {
60
+ [x: string]: any;
61
+ }) => JSX.Element;
62
+ export { Marker as default, ArrowLeftMarker, ArrowRightMarker, CircleMarker, DiamondMarker, SquareMarker, TeeMarker, };
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.TeeMarker = exports.SquareMarker = exports.DiamondMarker = exports.CircleMarker = exports.ArrowRightMarker = exports.ArrowLeftMarker = exports.default = void 0;
29
+ var react_1 = __importDefault(require("react"));
30
+ var prop_types_1 = __importDefault(require("prop-types"));
31
+ // @ts-ignore
32
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
33
+ var markerDefinitions_1 = require("@carbon/charts/components/diagrams/markerDefinitions");
34
+ var prefix = settings_1.default.prefix;
35
+ var Marker = function (_a) {
36
+ var d = _a.d, color = _a.color, id = _a.id, _b = _a.orient, orient = _b === void 0 ? 'auto' : _b, height = _a.height, width = _a.width, _c = _a.position, position = _c === void 0 ? 'end' : _c, refX = _a.refX, refY = _a.refY;
37
+ var namespace = prefix + "--cc--marker";
38
+ var xPos = position === 'end' ? width / 2 + 0.5 : 0.5;
39
+ var yPos = height / 2;
40
+ return (react_1.default.createElement("marker", { className: namespace, markerHeight: height, markerWidth: width, orient: orient, id: id, refX: refX || xPos, refY: refY || yPos, markerUnits: "userSpaceOnUse" },
41
+ react_1.default.createElement("path", { d: d, style: { fill: color } })));
42
+ };
43
+ exports.default = Marker;
44
+ var ArrowLeftMarker = function (_a) {
45
+ var rest = __rest(_a, []);
46
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.arrowLeft, rest));
47
+ };
48
+ exports.ArrowLeftMarker = ArrowLeftMarker;
49
+ var ArrowRightMarker = function (_a) {
50
+ var rest = __rest(_a, []);
51
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.arrowRight, rest));
52
+ };
53
+ exports.ArrowRightMarker = ArrowRightMarker;
54
+ var CircleMarker = function (_a) {
55
+ var rest = __rest(_a, []);
56
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.circle, rest));
57
+ };
58
+ exports.CircleMarker = CircleMarker;
59
+ var DiamondMarker = function (_a) {
60
+ var rest = __rest(_a, []);
61
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.diamond, rest));
62
+ };
63
+ exports.DiamondMarker = DiamondMarker;
64
+ var SquareMarker = function (_a) {
65
+ var rest = __rest(_a, []);
66
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.square, rest));
67
+ };
68
+ exports.SquareMarker = SquareMarker;
69
+ var TeeMarker = function (_a) {
70
+ var rest = __rest(_a, []);
71
+ return react_1.default.createElement(Marker, __assign({}, markerDefinitions_1.tee, rest));
72
+ };
73
+ exports.TeeMarker = TeeMarker;
74
+ Marker.propTypes = {
75
+ /**
76
+ * Specify a path string
77
+ */
78
+ d: prop_types_1.default.string,
79
+ /**
80
+ * Specify the marker's color
81
+ */
82
+ color: prop_types_1.default.string,
83
+ /**
84
+ * Specify an ID for the marker
85
+ */
86
+ id: prop_types_1.default.string,
87
+ /**
88
+ * Specify the orient attribute for the marker
89
+ */
90
+ orient: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
91
+ /**
92
+ * Specify the height attribute for the marker
93
+ */
94
+ height: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
95
+ /**
96
+ * Specify the width attribute for the marker
97
+ */
98
+ width: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
99
+ /**
100
+ * Specify whether this marker appears at the start or end of a line
101
+ */
102
+ position: prop_types_1.default.oneOf(['end', 'start']),
103
+ /**
104
+ * Specify the refX attribute for the marker
105
+ */
106
+ refX: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
107
+ /**
108
+ * Specify the refY attribute for the marker
109
+ */
110
+ refY: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
111
+ };
@@ -0,0 +1 @@
1
+ export { default, ArrowLeftMarker, ArrowRightMarker, CircleMarker, DiamondMarker, SquareMarker, TeeMarker, } from './Marker';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TeeMarker = exports.SquareMarker = exports.DiamondMarker = exports.CircleMarker = exports.ArrowRightMarker = exports.ArrowLeftMarker = exports.default = void 0;
7
+ var Marker_1 = require("./Marker");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Marker_1).default; } });
9
+ Object.defineProperty(exports, "ArrowLeftMarker", { enumerable: true, get: function () { return Marker_1.ArrowLeftMarker; } });
10
+ Object.defineProperty(exports, "ArrowRightMarker", { enumerable: true, get: function () { return Marker_1.ArrowRightMarker; } });
11
+ Object.defineProperty(exports, "CircleMarker", { enumerable: true, get: function () { return Marker_1.CircleMarker; } });
12
+ Object.defineProperty(exports, "DiamondMarker", { enumerable: true, get: function () { return Marker_1.DiamondMarker; } });
13
+ Object.defineProperty(exports, "SquareMarker", { enumerable: true, get: function () { return Marker_1.SquareMarker; } });
14
+ Object.defineProperty(exports, "TeeMarker", { enumerable: true, get: function () { return Marker_1.TeeMarker; } });
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ declare const ShapeNode: {
4
+ ({ as, href, onClick, onMouseEnter, onMouseOver, onMouseOut, onMouseLeave, onMouseMove, renderIcon, size, stacked, shape, subtitle, title, }: any): JSX.Element;
5
+ propTypes: {
6
+ /** Provide a custom element to be rendered instead of the default */
7
+ as: PropTypes.Requireable<string>;
8
+ /**
9
+ * Optionally specify an href for the CardNode to become an `<a>` element
10
+ */
11
+ href: PropTypes.Requireable<string>;
12
+ /**
13
+ * Provide an optional function to be called when the CardNode
14
+ * is clicked, turning the CardNode into a `<button>` element
15
+ */
16
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
17
+ /**
18
+ * Provide an optional function to be called for the onMouseEnter event
19
+ */
20
+ onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
21
+ /**
22
+ * Provide an optional function to be called for the onMouseOver event
23
+ */
24
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
25
+ /**
26
+ * Provide an optional function to be called for the onMouseOut event
27
+ */
28
+ onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
29
+ /**
30
+ * Provide an optional function to be called for the onMouseLeave event
31
+ */
32
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
33
+ /**
34
+ * Provide an optional function to be called for the onMouseMove event
35
+ */
36
+ onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
37
+ /**
38
+ * Function to render your own icon in the underlying button
39
+ */
40
+ renderIcon: PropTypes.Requireable<object>;
41
+ /**
42
+ * Specify the height and width of the shape
43
+ * Can be defined using any CSS length unit (px, %, rem)
44
+ */
45
+ size: PropTypes.Requireable<React.ReactText>;
46
+ /**
47
+ * Specify whether the node displays a stacked effect
48
+ */
49
+ stacked: PropTypes.Requireable<boolean>;
50
+ /**
51
+ * Specify the shape of the node
52
+ */
53
+ shape: PropTypes.Requireable<string>;
54
+ /**
55
+ * Specify the node's subtitle
56
+ */
57
+ subtitle: PropTypes.Requireable<string>;
58
+ /**
59
+ * Specify the node's title
60
+ */
61
+ title: PropTypes.Requireable<string>;
62
+ };
63
+ };
64
+ export default ShapeNode;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var prop_types_1 = __importDefault(require("prop-types"));
8
+ // @ts-ignore
9
+ var settings_1 = __importDefault(require("carbon-components/src/globals/js/settings"));
10
+ // @ts-ignore
11
+ var classnames_1 = __importDefault(require("classnames"));
12
+ var prefix = settings_1.default.prefix;
13
+ var ShapeNode = function (_a) {
14
+ var _b;
15
+ var _c = _a.as, as = _c === void 0 ? 'div' : _c, _d = _a.href, href = _d === void 0 ? null : _d, _e = _a.onClick, onClick = _e === void 0 ? null : _e, _f = _a.onMouseEnter, onMouseEnter = _f === void 0 ? null : _f, _g = _a.onMouseOver, onMouseOver = _g === void 0 ? null : _g, _h = _a.onMouseOut, onMouseOut = _h === void 0 ? null : _h, _j = _a.onMouseLeave, onMouseLeave = _j === void 0 ? null : _j, _k = _a.onMouseMove, onMouseMove = _k === void 0 ? null : _k, renderIcon = _a.renderIcon, _l = _a.size, size = _l === void 0 ? 48 : _l, stacked = _a.stacked, _m = _a.shape, shape = _m === void 0 ? 'circle' : _m, subtitle = _a.subtitle, title = _a.title;
16
+ var namespace = prefix + "--cc--shape-node";
17
+ var Component = 'div';
18
+ if (href) {
19
+ Component = 'a';
20
+ }
21
+ else if (onClick) {
22
+ Component = 'button';
23
+ }
24
+ var circleClasses = classnames_1.default(namespace, (_b = {},
25
+ _b[namespace + "--stacked"] = stacked,
26
+ _b[namespace + "--" + shape] = shape,
27
+ _b[namespace + "--" + Component] = Component,
28
+ _b));
29
+ var titleElement = title ? (react_1.default.createElement("div", { className: namespace + "__title" }, title)) : null;
30
+ var subtitleElement = subtitle ? (react_1.default.createElement("div", { className: namespace + "__subtitle" }, subtitle)) : null;
31
+ return (
32
+ // @ts-ignore
33
+ react_1.default.createElement(Component, { className: circleClasses, onClick: onClick, onMouseEnter: onMouseEnter, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onMouseLeave: onMouseLeave, onMouseMove: onMouseMove, style: { height: size, width: size }, tabIndex: 0 },
34
+ react_1.default.createElement("div", { className: namespace + "__icon" }, renderIcon),
35
+ react_1.default.createElement("div", { className: namespace + "__body" },
36
+ titleElement,
37
+ subtitleElement)));
38
+ };
39
+ ShapeNode.propTypes = {
40
+ /** Provide a custom element to be rendered instead of the default */
41
+ as: prop_types_1.default.oneOf(['div', 'a', 'button']),
42
+ /**
43
+ * Optionally specify an href for the CardNode to become an `<a>` element
44
+ */
45
+ href: prop_types_1.default.string,
46
+ /**
47
+ * Provide an optional function to be called when the CardNode
48
+ * is clicked, turning the CardNode into a `<button>` element
49
+ */
50
+ onClick: prop_types_1.default.func,
51
+ /**
52
+ * Provide an optional function to be called for the onMouseEnter event
53
+ */
54
+ onMouseEnter: prop_types_1.default.func,
55
+ /**
56
+ * Provide an optional function to be called for the onMouseOver event
57
+ */
58
+ onMouseOver: prop_types_1.default.func,
59
+ /**
60
+ * Provide an optional function to be called for the onMouseOut event
61
+ */
62
+ onMouseOut: prop_types_1.default.func,
63
+ /**
64
+ * Provide an optional function to be called for the onMouseLeave event
65
+ */
66
+ onMouseLeave: prop_types_1.default.func,
67
+ /**
68
+ * Provide an optional function to be called for the onMouseMove event
69
+ */
70
+ onMouseMove: prop_types_1.default.func,
71
+ /**
72
+ * Function to render your own icon in the underlying button
73
+ */
74
+ renderIcon: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.object]),
75
+ /**
76
+ * Specify the height and width of the shape
77
+ * Can be defined using any CSS length unit (px, %, rem)
78
+ */
79
+ size: prop_types_1.default.oneOfType([prop_types_1.default.number, prop_types_1.default.string]),
80
+ /**
81
+ * Specify whether the node displays a stacked effect
82
+ */
83
+ stacked: prop_types_1.default.bool,
84
+ /**
85
+ * Specify the shape of the node
86
+ */
87
+ shape: prop_types_1.default.oneOf(['circle', 'square', 'rounded-square']),
88
+ /**
89
+ * Specify the node's subtitle
90
+ */
91
+ subtitle: prop_types_1.default.string,
92
+ /**
93
+ * Specify the node's title
94
+ */
95
+ title: prop_types_1.default.string,
96
+ };
97
+ exports.default = ShapeNode;
@@ -0,0 +1,2 @@
1
+ import ShapeNode from './ShapeNode';
2
+ export default ShapeNode;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var ShapeNode_1 = __importDefault(require("./ShapeNode"));
7
+ exports.default = ShapeNode_1.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts-react",
3
- "version": "0.41.68",
3
+ "version": "0.41.72",
4
4
  "description": "Carbon charting components for React",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
@@ -49,12 +49,13 @@
49
49
  },
50
50
  "homepage": "https://github.com/carbon-design-system/carbon-charts#readme",
51
51
  "dependencies": {
52
- "@carbon/charts": "^0.41.68",
52
+ "@carbon/charts": "^0.41.72",
53
+ "@carbon/icons-react": "^10.32.0",
53
54
  "@carbon/telemetry": "0.0.0-alpha.6"
54
55
  },
55
56
  "peerDependencies": {
56
- "react": "^16.6.3",
57
- "react-dom": "^16.6.3"
57
+ "react": "^17.0.2",
58
+ "react-dom": "^17.0.2"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@storybook/addon-knobs": "5.3.12",
@@ -73,8 +74,8 @@
73
74
  "base64-inline-loader": "1.1.0",
74
75
  "css-loader": "0.28.7",
75
76
  "img-loader": "2.0.0",
76
- "react": "16.6.3",
77
- "react-dom": "16.6.3",
77
+ "react": "17.0.2",
78
+ "react-dom": "17.0.2",
78
79
  "rollup": "1.27.10",
79
80
  "rollup-plugin-commonjs": "10.1.0",
80
81
  "rollup-plugin-node-resolve": "5.2.0",