diginet-core-ui 1.4.14-beta.2 → 1.4.14-beta.3
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/components/accordion/details.js +36 -25
- package/components/accordion/group.js +33 -18
- package/components/accordion/index.js +42 -28
- package/components/accordion/summary.js +60 -52
- package/components/alert/index.js +84 -75
- package/components/alert/notify.js +53 -41
- package/components/avatar/index.js +97 -94
- package/components/badge/index.js +80 -78
- package/components/breadcrumb/index.js +62 -44
- package/components/button/icon.js +90 -70
- package/components/button/index.js +110 -88
- package/components/button/more.js +60 -39
- package/components/button/ripple-effect.js +1 -1
- package/components/card/body.js +38 -28
- package/components/card/extra.js +38 -28
- package/components/card/footer.js +38 -28
- package/components/card/header.js +39 -28
- package/components/card/index.js +79 -70
- package/components/chart/bar/Labels.js +14 -8
- package/components/chart/bar-v2/Labels.js +14 -8
- package/components/chart/line/Labels.js +14 -8
- package/components/chart/line/Path.js +3 -3
- package/components/chart/line/Point.js +12 -11
- package/components/chart/line-v2/Labels.js +14 -8
- package/components/check-text/index.js +21 -16
- package/components/check-text/interview-confirmation.js +21 -15
- package/components/check-text/interview-status.js +21 -15
- package/components/chip/attach.js +11 -7
- package/components/chip/index.js +83 -82
- package/components/collapse/index.js +1 -1
- package/components/dialogs/colors.js +13 -11
- package/components/divider/index.js +40 -22
- package/components/form-control/attachment/index.js +94 -57
- package/components/form-control/calendar/function.js +173 -169
- package/components/form-control/calendar/index.js +48 -36
- package/components/form-control/calendar/range.js +38 -22
- package/components/form-control/checkbox/index.js +87 -63
- package/components/form-control/control/index.js +9 -10
- package/components/form-control/date-picker/index.js +81 -64
- package/components/form-control/date-range-picker/index.js +98 -81
- package/components/form-control/dropdown/index.js +240 -215
- package/components/form-control/dropdown-box/index.js +56 -43
- package/components/form-control/form-group/index.js +7 -6
- package/components/form-control/helper-text/index.js +45 -41
- package/components/form-control/input-base/index.js +165 -133
- package/components/form-control/label/index.js +48 -41
- package/components/form-control/money-input/index.js +87 -79
- package/components/form-control/number-input/index.js +579 -521
- package/components/form-control/number-input/index2.js +107 -87
- package/components/form-control/password-input/index.js +71 -63
- package/components/form-control/radio/index.js +90 -74
- package/components/form-control/text-input/index.js +83 -74
- package/components/form-control/time-picker/index.js +79 -56
- package/components/form-control/time-picker/v2/index.js +90 -84
- package/components/form-control/toggle/index.js +144 -133
- package/components/form-view/helper-text.js +2 -2
- package/components/form-view/index.js +34 -31
- package/components/form-view/input.js +70 -69
- package/components/form-view/label.js +14 -9
- package/components/grid/Col.js +48 -39
- package/components/grid/Container.js +31 -38
- package/components/grid/Row.js +28 -32
- package/components/grid/index.js +66 -54
- package/components/image/index.js +37 -27
- package/components/list/list-item-action.js +36 -26
- package/components/list/list-item-icon.js +34 -29
- package/components/list/list-item-text.js +27 -22
- package/components/list/list-item.js +42 -36
- package/components/list/list.js +46 -38
- package/components/list/sub-header.js +33 -26
- package/components/modal/body.js +24 -14
- package/components/modal/footer.js +23 -13
- package/components/modal/header.js +39 -28
- package/components/modal/index.js +3 -3
- package/components/modal/modal.js +60 -49
- package/components/others/extra/index.js +31 -30
- package/components/others/import/index.js +2 -2
- package/components/others/scrollbar/index.js +32 -26
- package/components/paging/page-info.js +67 -68
- package/components/paging/page-selector.js +49 -49
- package/components/paper/index.js +32 -28
- package/components/popover/body.js +14 -8
- package/components/popover/footer.js +13 -8
- package/components/popover/header.js +17 -15
- package/components/popover/index.js +103 -92
- package/components/popup/danger_popup.js +17 -16
- package/components/popup/index.js +16 -17
- package/components/popup/v2/index.js +41 -54
- package/components/progress/circular.js +65 -80
- package/components/progress/linear.js +73 -58
- package/components/rating/index.js +49 -63
- package/components/slider/slider-container.js +49 -57
- package/components/slider/slider-item.js +30 -29
- package/components/status/index.js +23 -34
- package/components/tab/tab-header.js +20 -11
- package/components/tab/tab-panel.js +12 -7
- package/components/tab/tab.js +35 -22
- package/components/tooltip/index.js +24 -35
- package/components/transfer/index.js +105 -106
- package/components/tree-view/index.js +133 -115
- package/components/typography/index.js +72 -55
- package/global/index.js +2 -17
- package/icons/basic.js +975 -972
- package/icons/effect.js +21 -20
- package/package.json +3 -1
- package/styles/color-helper.js +105 -105
- package/styles/colors.js +168 -30
- package/styles/general.js +84 -16
- package/styles/sx/index.js +7 -4
- package/styles/utils.js +20 -19
- package/theme/createSpacing.js +10 -0
- package/theme/createTheme.js +26 -0
- package/theme/createZIndex.js +9 -0
- package/theme/index.js +13 -2
- package/theme/make-styles.js +2 -1
- package/theme/settings.js +699 -8
- package/theme/theme-provider.js +32 -15
- package/theme/theme.js +57 -56
- package/theme/use-classes.js +15 -0
- package/theme/utils/getThemeProps.js +12 -0
- package/theme/utils/resolveProps.js +17 -0
- package/theme/utils/useThemeProps.js +14 -0
- package/utils/handleBreakpoints.js +2 -2
- package/utils/hexToRGBA/index.js +7 -7
- package/utils/object/deepmerge.js +104 -0
- package/utils/object/object.js +7 -12
- package/utils/render-portal.js +4 -3
- package/theme/set-theme.js +0 -38
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import { jsx } from '@emotion/core';
|
|
6
4
|
import OptionWrapper from "../others/option-wrapper";
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
|
+
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
7
8
|
import { classNames, refType as ref } from "../../utils";
|
|
8
|
-
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
10
|
+
if (!reference) reference = useRef(null);
|
|
11
|
+
|
|
12
|
+
// props priority: `inProps` > `themeDefaultProps`
|
|
13
|
+
const props = useThemeProps({
|
|
14
|
+
props: inProps,
|
|
15
|
+
name: 'CardFooter'
|
|
16
|
+
});
|
|
17
|
+
const {
|
|
18
|
+
action = {},
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
id,
|
|
22
|
+
style
|
|
23
|
+
} = props;
|
|
16
24
|
const ref = useRef(null);
|
|
17
25
|
useImperativeHandle(reference, () => {
|
|
18
26
|
const currentRef = ref.current || {};
|
|
@@ -31,12 +39,14 @@ const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
31
39
|
style: style,
|
|
32
40
|
className: classNames(`DGN-UI-Card-Footer`, className)
|
|
33
41
|
}, children);
|
|
34
|
-
}, [children, className, id, style
|
|
42
|
+
}, [children, className, id, style]);
|
|
35
43
|
}));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
44
|
+
|
|
45
|
+
// CardFooter.defaultProps = {
|
|
46
|
+
// className: '',
|
|
47
|
+
// style: {},
|
|
48
|
+
// };
|
|
49
|
+
|
|
40
50
|
CardFooter.propTypes = {
|
|
41
51
|
/** The content of the component. */
|
|
42
52
|
children: PropTypes.node,
|
|
@@ -46,19 +56,19 @@ CardFooter.propTypes = {
|
|
|
46
56
|
style: PropTypes.object,
|
|
47
57
|
/** The title of the component's header. */
|
|
48
58
|
title: PropTypes.string,
|
|
49
|
-
/**
|
|
50
|
-
* ref methods (ref.current.instance.*method*)
|
|
51
|
-
*
|
|
52
|
-
* * option(): Gets all UI component properties
|
|
53
|
-
* * Returns value - object
|
|
54
|
-
* * option(optionName): Gets the value of a single property
|
|
55
|
-
* * @param {optionName} - string
|
|
56
|
-
* * Returns value - any
|
|
57
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
58
|
-
* * @param {optionName} - string
|
|
59
|
-
* * @param {optionValue} - any
|
|
60
|
-
* * option(options): Updates the values of several properties
|
|
61
|
-
* * @param {options} - object
|
|
59
|
+
/**
|
|
60
|
+
* ref methods (ref.current.instance.*method*)
|
|
61
|
+
*
|
|
62
|
+
* * option(): Gets all UI component properties
|
|
63
|
+
* * Returns value - object
|
|
64
|
+
* * option(optionName): Gets the value of a single property
|
|
65
|
+
* * @param {optionName} - string
|
|
66
|
+
* * Returns value - any
|
|
67
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
68
|
+
* * @param {optionName} - string
|
|
69
|
+
* * @param {optionValue} - any
|
|
70
|
+
* * option(options): Updates the values of several properties
|
|
71
|
+
* * @param {options} - object
|
|
62
72
|
*/
|
|
63
73
|
ref: ref
|
|
64
74
|
};
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import { jsx } from '@emotion/core';
|
|
4
|
+
import { Typography } from "./..";
|
|
6
5
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
-
import
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
8
|
+
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
8
9
|
import { classNames, refType as ref } from "../../utils";
|
|
9
|
-
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
10
|
+
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
11
|
+
if (!reference) reference = useRef(null);
|
|
12
|
+
|
|
13
|
+
// props priority: `inProps` > `themeDefaultProps`
|
|
14
|
+
const props = useThemeProps({
|
|
15
|
+
props: inProps,
|
|
16
|
+
name: 'CardHeader'
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
action = {},
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
id,
|
|
23
|
+
style,
|
|
24
|
+
title
|
|
25
|
+
} = props;
|
|
17
26
|
const ref = useRef(null);
|
|
18
27
|
useImperativeHandle(reference, () => {
|
|
19
28
|
const currentRef = ref.current || {};
|
|
@@ -36,10 +45,12 @@ const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
36
45
|
}, title));
|
|
37
46
|
}, [children, className, id, style, title]);
|
|
38
47
|
}));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
48
|
+
|
|
49
|
+
// CardHeader.defaultProps = {
|
|
50
|
+
// className: '',
|
|
51
|
+
// style: {},
|
|
52
|
+
// };
|
|
53
|
+
|
|
43
54
|
CardHeader.propTypes = {
|
|
44
55
|
/** The content of the component. */
|
|
45
56
|
children: PropTypes.node,
|
|
@@ -49,19 +60,19 @@ CardHeader.propTypes = {
|
|
|
49
60
|
style: PropTypes.object,
|
|
50
61
|
/** The title of the component's header. */
|
|
51
62
|
title: PropTypes.string,
|
|
52
|
-
/**
|
|
53
|
-
* ref methods (ref.current.instance.*method*)
|
|
54
|
-
*
|
|
55
|
-
* * option(): Gets all UI component properties
|
|
56
|
-
* * Returns value - object
|
|
57
|
-
* * option(optionName): Gets the value of a single property
|
|
58
|
-
* * @param {optionName} - string
|
|
59
|
-
* * Returns value - any
|
|
60
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
61
|
-
* * @param {optionName} - string
|
|
62
|
-
* * @param {optionValue} - any
|
|
63
|
-
* * option(options): Updates the values of several properties
|
|
64
|
-
* * @param {options} - object
|
|
63
|
+
/**
|
|
64
|
+
* ref methods (ref.current.instance.*method*)
|
|
65
|
+
*
|
|
66
|
+
* * option(): Gets all UI component properties
|
|
67
|
+
* * Returns value - object
|
|
68
|
+
* * option(optionName): Gets the value of a single property
|
|
69
|
+
* * @param {optionName} - string
|
|
70
|
+
* * Returns value - any
|
|
71
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
72
|
+
* * @param {optionName} - string
|
|
73
|
+
* * @param {optionValue} - any
|
|
74
|
+
* * option(options): Updates the values of several properties
|
|
75
|
+
* * @param {options} - object
|
|
65
76
|
*/
|
|
66
77
|
ref: ref
|
|
67
78
|
};
|
package/components/card/index.js
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import {
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { jsx, css } from '@emotion/core';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
6
4
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { CardFooter } from "./footer";
|
|
11
|
-
import { CardBody } from "./body";
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
|
+
import { bgColor, borderRadius4px, boxBorder, flexCol, flexRow, justifyEnd, overflowHidden, parseWidth, parseWidthHeight, positionAbsolute, positionRelative } from "../../styles/general";
|
|
12
8
|
import { getColor } from "../../styles/utils";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = theme;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
import { useTheme } from "../../theme";
|
|
10
|
+
import { classNames, getProp, refType as ref } from "../../utils";
|
|
11
|
+
import { CardBody } from "./body";
|
|
12
|
+
import { CardFooter } from "./footer";
|
|
13
|
+
import CardHeader from "./header";
|
|
14
|
+
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
15
|
+
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
16
|
+
if (!reference) reference = useRef(null);
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
const {
|
|
19
|
+
colors
|
|
20
|
+
} = theme;
|
|
21
|
+
|
|
22
|
+
// props priority: `inProps` > `themeDefaultProps`
|
|
23
|
+
const props = useThemeProps({
|
|
24
|
+
props: inProps,
|
|
25
|
+
name: 'Card'
|
|
26
|
+
});
|
|
27
|
+
const {
|
|
28
|
+
action = {},
|
|
29
|
+
body: bodyProp,
|
|
30
|
+
bodyStyle,
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
dividerColor,
|
|
34
|
+
direction,
|
|
35
|
+
footer,
|
|
36
|
+
footerDivider,
|
|
37
|
+
footerStyle,
|
|
38
|
+
header,
|
|
39
|
+
headerDivider,
|
|
40
|
+
headerStyle,
|
|
41
|
+
height,
|
|
42
|
+
id,
|
|
43
|
+
style,
|
|
44
|
+
title,
|
|
45
|
+
width
|
|
46
|
+
} = props;
|
|
45
47
|
const ref = useRef(null);
|
|
46
|
-
const _CardCSS = CardCSS(width, height, headerDivider, footerDivider, dividerColor, direction);
|
|
48
|
+
const _CardCSS = CardCSS(width, height, headerDivider, footerDivider, getProp(colors, dividerColor, dividerColor), direction, theme);
|
|
47
49
|
useImperativeHandle(reference, () => {
|
|
48
50
|
const currentRef = ref.current || {};
|
|
49
51
|
currentRef.element = ref.current;
|
|
@@ -77,15 +79,18 @@ const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
77
79
|
}, head, body || children, foot);
|
|
78
80
|
}, [bodyProp, bodyStyle, children, className, dividerColor, direction, footer, footerDivider, footerStyle, header, headerDivider, headerStyle, height, id, style, title, width]);
|
|
79
81
|
}));
|
|
80
|
-
const CardCSS = (width, height, headerDivider, footerDivider, dividerColor, direction
|
|
82
|
+
const CardCSS = (width, height, headerDivider, footerDivider, dividerColor, direction, {
|
|
83
|
+
colors,
|
|
84
|
+
spacing
|
|
85
|
+
}) => css`
|
|
81
86
|
${direction === 'vertical' ? flexCol : flexRow};
|
|
82
87
|
${positionRelative};
|
|
83
88
|
${boxBorder};
|
|
84
89
|
${borderRadius4px};
|
|
85
90
|
${overflowHidden}
|
|
86
|
-
${parseWidthHeight(width
|
|
91
|
+
${parseWidthHeight(width, height)};
|
|
87
92
|
${parseWidth(width)};
|
|
88
|
-
|
|
93
|
+
${bgColor(getProp(colors, 'system/standard'))};
|
|
89
94
|
.DGN-UI-Card-Header {
|
|
90
95
|
${flexRow};
|
|
91
96
|
${positionRelative};
|
|
@@ -107,7 +112,7 @@ const CardCSS = (width, height, headerDivider, footerDivider, dividerColor, dire
|
|
|
107
112
|
${positionRelative};
|
|
108
113
|
${boxBorder};
|
|
109
114
|
order: 2;
|
|
110
|
-
padding: ${headerDivider ?
|
|
115
|
+
padding: ${spacing(headerDivider ? [4] : [0, 4, 4])};
|
|
111
116
|
}
|
|
112
117
|
.DGN-UI-Card-Footer {
|
|
113
118
|
${flexRow};
|
|
@@ -115,7 +120,7 @@ const CardCSS = (width, height, headerDivider, footerDivider, dividerColor, dire
|
|
|
115
120
|
${positionRelative};
|
|
116
121
|
${boxBorder};
|
|
117
122
|
order: 3;
|
|
118
|
-
padding: ${footerDivider ?
|
|
123
|
+
padding: ${spacing(footerDivider ? [4] : [0, 4, 4])};
|
|
119
124
|
&:before {
|
|
120
125
|
${positionAbsolute};
|
|
121
126
|
content: '';
|
|
@@ -132,17 +137,21 @@ const CardCSS = (width, height, headerDivider, footerDivider, dividerColor, dire
|
|
|
132
137
|
${boxBorder};
|
|
133
138
|
}
|
|
134
139
|
`;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
140
|
+
|
|
141
|
+
// Card.defaultProps = {
|
|
142
|
+
// bodyStyle: {},
|
|
143
|
+
// className: '',
|
|
144
|
+
// dividerColor: 'line/category',
|
|
145
|
+
// direction: 'vertical',
|
|
146
|
+
// footerDivider: false,
|
|
147
|
+
// footerStyle: {},
|
|
148
|
+
// headerDivider: true,
|
|
149
|
+
// headerStyle: {},
|
|
150
|
+
// style: {},
|
|
151
|
+
// width: 258,
|
|
152
|
+
// height: 'max-content',
|
|
153
|
+
// };
|
|
154
|
+
|
|
146
155
|
Card.propTypes = {
|
|
147
156
|
/** The content of the component's body. */
|
|
148
157
|
body: PropTypes.node,
|
|
@@ -174,19 +183,19 @@ Card.propTypes = {
|
|
|
174
183
|
title: PropTypes.string,
|
|
175
184
|
/** Width of the component. */
|
|
176
185
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
177
|
-
/**
|
|
178
|
-
* ref methods (ref.current.instance.*method*)
|
|
179
|
-
*
|
|
180
|
-
* * option(): Gets all UI component properties
|
|
181
|
-
* * Returns value - object
|
|
182
|
-
* * option(optionName): Gets the value of a single property
|
|
183
|
-
* * @param {optionName} - string
|
|
184
|
-
* * Returns value - any
|
|
185
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
186
|
-
* * @param {optionName} - string
|
|
187
|
-
* * @param {optionValue} - any
|
|
188
|
-
* * option(options): Updates the values of several properties
|
|
189
|
-
* * @param {options} - object
|
|
186
|
+
/**
|
|
187
|
+
* ref methods (ref.current.instance.*method*)
|
|
188
|
+
*
|
|
189
|
+
* * option(): Gets all UI component properties
|
|
190
|
+
* * Returns value - object
|
|
191
|
+
* * option(optionName): Gets the value of a single property
|
|
192
|
+
* * @param {optionName} - string
|
|
193
|
+
* * Returns value - any
|
|
194
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
195
|
+
* * @param {optionName} - string
|
|
196
|
+
* * @param {optionValue} - any
|
|
197
|
+
* * option(options): Updates the values of several properties
|
|
198
|
+
* * @param {options} - object
|
|
190
199
|
*/
|
|
191
200
|
ref: ref
|
|
192
201
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/** @jsxRuntime classic */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { typography } from "../../../styles/typography";
|
|
6
|
+
import { useTheme } from "../../../theme";
|
|
7
|
+
import { getProp } from "../../../utils";
|
|
8
8
|
const Labels = ({
|
|
9
9
|
getX,
|
|
10
10
|
getY,
|
|
11
11
|
data,
|
|
12
|
-
labelsColor,
|
|
12
|
+
labelsColor: labelsColorProp,
|
|
13
13
|
labelsCountY,
|
|
14
14
|
labelsFormatX,
|
|
15
15
|
viewBoxWidth,
|
|
@@ -23,6 +23,12 @@ const Labels = ({
|
|
|
23
23
|
minX,
|
|
24
24
|
unitWidth
|
|
25
25
|
}) => {
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const {
|
|
28
|
+
colors,
|
|
29
|
+
typography
|
|
30
|
+
} = theme;
|
|
31
|
+
const labelsColor = getProp(colors, labelsColorProp, labelsColorProp);
|
|
26
32
|
const labelContainerCSS = css`
|
|
27
33
|
transform: translate(0, ${labelsOffsetX}px);
|
|
28
34
|
`;
|
|
@@ -32,7 +38,7 @@ const Labels = ({
|
|
|
32
38
|
text-align: center;
|
|
33
39
|
`;
|
|
34
40
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
35
|
-
fill: ${
|
|
41
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
36
42
|
text-anchor: start;
|
|
37
43
|
${typography.paragraph3};
|
|
38
44
|
text-transform: capitalize;
|
|
@@ -41,7 +47,7 @@ const Labels = ({
|
|
|
41
47
|
transform-box: fill-box;
|
|
42
48
|
transform: rotateZ(45deg);
|
|
43
49
|
` : css`
|
|
44
|
-
color: ${
|
|
50
|
+
color: ${getProp(colors, 'system/rest')};
|
|
45
51
|
text-anchor: middle;
|
|
46
52
|
${typography.paragraph3};
|
|
47
53
|
text-transform: capitalize;
|
|
@@ -51,7 +57,7 @@ const Labels = ({
|
|
|
51
57
|
`;
|
|
52
58
|
const TextCSS = css`
|
|
53
59
|
${typography.paragraph3};
|
|
54
|
-
fill: ${
|
|
60
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
55
61
|
cursor: 'pointer';
|
|
56
62
|
`;
|
|
57
63
|
if (labelsVisible) {
|
|
@@ -112,7 +118,7 @@ Labels.defaultProps = {
|
|
|
112
118
|
getX: x => x,
|
|
113
119
|
getY: quantity => quantity,
|
|
114
120
|
labelsCharacterWidth: 10,
|
|
115
|
-
labelsColor:
|
|
121
|
+
labelsColor: 'system/rest',
|
|
116
122
|
labelsCountY: 5,
|
|
117
123
|
labelsFormatX: label => label,
|
|
118
124
|
labelsFormatY: quantity => quantity,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/** @jsxRuntime classic */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { typography } from "../../../styles/typography";
|
|
6
|
+
import { useTheme } from "../../../theme";
|
|
7
|
+
import { getProp } from "../../../utils";
|
|
8
8
|
const Labels = ({
|
|
9
9
|
getX,
|
|
10
10
|
getY,
|
|
11
11
|
data,
|
|
12
|
-
labelsColor,
|
|
12
|
+
labelsColor: labelsColorProp,
|
|
13
13
|
labelsCountY,
|
|
14
14
|
labelsFormatX,
|
|
15
15
|
viewBoxWidth,
|
|
@@ -23,6 +23,12 @@ const Labels = ({
|
|
|
23
23
|
minX,
|
|
24
24
|
unitWidth
|
|
25
25
|
}) => {
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const {
|
|
28
|
+
colors,
|
|
29
|
+
typography
|
|
30
|
+
} = theme;
|
|
31
|
+
const labelsColor = getProp(colors, labelsColorProp, labelsColorProp);
|
|
26
32
|
const labelContainerCSS = css`
|
|
27
33
|
transform: translate(0, ${labelsOffsetX}px);
|
|
28
34
|
`;
|
|
@@ -32,7 +38,7 @@ const Labels = ({
|
|
|
32
38
|
text-align: center;
|
|
33
39
|
`;
|
|
34
40
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
35
|
-
fill: ${
|
|
41
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
36
42
|
text-anchor: start;
|
|
37
43
|
${typography.paragraph3};
|
|
38
44
|
text-transform: capitalize;
|
|
@@ -41,7 +47,7 @@ const Labels = ({
|
|
|
41
47
|
transform-box: fill-box;
|
|
42
48
|
transform: rotateZ(45deg);
|
|
43
49
|
` : css`
|
|
44
|
-
color: ${
|
|
50
|
+
color: ${getProp(colors, 'system/rest')};
|
|
45
51
|
text-anchor: middle;
|
|
46
52
|
${typography.paragraph3};
|
|
47
53
|
text-transform: capitalize;
|
|
@@ -51,7 +57,7 @@ const Labels = ({
|
|
|
51
57
|
`;
|
|
52
58
|
const TextCSS = css`
|
|
53
59
|
${typography.paragraph3};
|
|
54
|
-
fill: ${
|
|
60
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
55
61
|
cursor: 'pointer';
|
|
56
62
|
`;
|
|
57
63
|
if (labelsVisible) {
|
|
@@ -112,7 +118,7 @@ Labels.defaultProps = {
|
|
|
112
118
|
getX: x => x,
|
|
113
119
|
getY: quantity => quantity,
|
|
114
120
|
labelsCharacterWidth: 10,
|
|
115
|
-
labelsColor:
|
|
121
|
+
labelsColor: 'system/rest',
|
|
116
122
|
labelsCountY: 5,
|
|
117
123
|
labelsFormatX: label => label,
|
|
118
124
|
labelsFormatY: quantity => quantity,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/** @jsxRuntime classic */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { typography } from "../../../styles/typography";
|
|
6
|
+
import { useTheme } from "../../../theme";
|
|
7
|
+
import { getProp } from "../../../utils";
|
|
8
8
|
const Labels = ({
|
|
9
9
|
getX,
|
|
10
10
|
getY,
|
|
11
11
|
data,
|
|
12
|
-
labelsColor,
|
|
12
|
+
labelsColor: labelsColorProp,
|
|
13
13
|
labelsCountY,
|
|
14
14
|
labelsFormatX,
|
|
15
15
|
labelsFormatY,
|
|
@@ -22,6 +22,12 @@ const Labels = ({
|
|
|
22
22
|
minX,
|
|
23
23
|
unitWidth
|
|
24
24
|
}) => {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const {
|
|
27
|
+
colors,
|
|
28
|
+
typography
|
|
29
|
+
} = theme;
|
|
30
|
+
const labelsColor = getProp(colors, labelsColorProp, labelsColorProp);
|
|
25
31
|
const labelContainerCSS = css`
|
|
26
32
|
transform: translate(0, ${labelsOffsetX}px);
|
|
27
33
|
`;
|
|
@@ -31,7 +37,7 @@ const Labels = ({
|
|
|
31
37
|
text-align: center;
|
|
32
38
|
`;
|
|
33
39
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
34
|
-
fill: ${
|
|
40
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
35
41
|
text-anchor: start;
|
|
36
42
|
${typography.paragraph3};
|
|
37
43
|
text-transform: capitalize;
|
|
@@ -40,7 +46,7 @@ const Labels = ({
|
|
|
40
46
|
transform-box: fill-box;
|
|
41
47
|
transform: rotateZ(45deg);
|
|
42
48
|
` : css`
|
|
43
|
-
color: ${
|
|
49
|
+
color: ${getProp(colors, 'system/rest')};
|
|
44
50
|
text-anchor: middle;
|
|
45
51
|
${typography.paragraph3};
|
|
46
52
|
text-transform: capitalize;
|
|
@@ -49,7 +55,7 @@ const Labels = ({
|
|
|
49
55
|
`;
|
|
50
56
|
const TextCSS = css`
|
|
51
57
|
${typography.paragraph3};
|
|
52
|
-
fill: ${
|
|
58
|
+
fill: ${getProp(colors, 'system/rest')};
|
|
53
59
|
`;
|
|
54
60
|
if (labelsVisible) {
|
|
55
61
|
let xLabels;
|
|
@@ -110,7 +116,7 @@ Labels.defaultProps = {
|
|
|
110
116
|
getX: x => x,
|
|
111
117
|
getY: quantity => quantity,
|
|
112
118
|
labelsCharacterWidth: 10,
|
|
113
|
-
labelsColor:
|
|
119
|
+
labelsColor: 'system/rest',
|
|
114
120
|
labelsCountY: 5,
|
|
115
121
|
labelsFormatX: label => label,
|
|
116
122
|
labelsFormatY: quantity => quantity,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import {
|
|
6
|
+
import { getColor } from "../../../styles/utils";
|
|
7
7
|
const Path = ({
|
|
8
8
|
data,
|
|
9
9
|
getX,
|
|
@@ -27,13 +27,13 @@ const Path = ({
|
|
|
27
27
|
// });
|
|
28
28
|
|
|
29
29
|
const PathCSS = css`
|
|
30
|
-
stroke: ${
|
|
30
|
+
stroke: ${getColor(pathColor)};
|
|
31
31
|
stroke-width: ${STROKE};
|
|
32
32
|
stroke-linecap: round;
|
|
33
33
|
stroke-linejoin: round;
|
|
34
34
|
/* &:hover {
|
|
35
35
|
cursor: pointer;
|
|
36
|
-
stroke: ${
|
|
36
|
+
stroke: ${getColor(pathColor)};
|
|
37
37
|
stroke-linecap: round;
|
|
38
38
|
stroke-linejoin: round;
|
|
39
39
|
stroke-width: ${STROKEHover};
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import { typography } from "../../../styles/typography";
|
|
7
|
-
import {
|
|
7
|
+
import { fill } from "../../../styles/general";
|
|
8
|
+
import { getColor } from "../../../styles/utils";
|
|
8
9
|
const Points = ({
|
|
9
10
|
data,
|
|
10
11
|
getX,
|
|
@@ -27,13 +28,13 @@ const Points = ({
|
|
|
27
28
|
pointHoverAlignment
|
|
28
29
|
}) => {
|
|
29
30
|
const PointCSS = css`
|
|
30
|
-
|
|
31
|
+
${fill(pointsColor)};
|
|
31
32
|
stroke: ${pointsStrokeColor};
|
|
32
33
|
stroke-width: ${strokeWidth};
|
|
33
34
|
&:hover {
|
|
34
35
|
cursor: pointer;
|
|
35
36
|
fill: #fff;
|
|
36
|
-
stroke: ${
|
|
37
|
+
stroke: ${getColor(pointsColor)};
|
|
37
38
|
stroke-width: ${pointsStrokeHover};
|
|
38
39
|
}
|
|
39
40
|
`;
|
|
@@ -170,8 +171,8 @@ const Points = ({
|
|
|
170
171
|
transform: `translate(${getX(point.x + unitWidth / 1.5) + 4}, ${getY(point.quantity)})`
|
|
171
172
|
}, jsx("path", {
|
|
172
173
|
d: rightTooltipPath(Width, 20, 6, 4),
|
|
173
|
-
fill:
|
|
174
|
-
stroke:
|
|
174
|
+
fill: getColor(pointsColor),
|
|
175
|
+
stroke: getColor(pointsColor),
|
|
175
176
|
style: {
|
|
176
177
|
filter: 'drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.15))'
|
|
177
178
|
}
|
|
@@ -191,8 +192,8 @@ const Points = ({
|
|
|
191
192
|
transform: `translate(${getX(point.x + unitWidth / 1.5) - 4}, ${getY(point.quantity)})`
|
|
192
193
|
}, jsx("path", {
|
|
193
194
|
d: leftTooltipPath(Width, 20, 6, 4),
|
|
194
|
-
fill:
|
|
195
|
-
stroke:
|
|
195
|
+
fill: getColor(pointsColor),
|
|
196
|
+
stroke: getColor(pointsColor),
|
|
196
197
|
style: {
|
|
197
198
|
filter: 'drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.15))'
|
|
198
199
|
}
|
|
@@ -212,8 +213,8 @@ const Points = ({
|
|
|
212
213
|
transform: `translate(${getX(point.x + unitWidth / 1.5)}, ${getY(point.quantity) - 4})`
|
|
213
214
|
}, jsx("path", {
|
|
214
215
|
d: topTooltipPath(Width, 20, 6, 4),
|
|
215
|
-
fill:
|
|
216
|
-
stroke:
|
|
216
|
+
fill: getColor(pointsColor),
|
|
217
|
+
stroke: getColor(pointsColor),
|
|
217
218
|
style: {
|
|
218
219
|
filter: 'drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.15))'
|
|
219
220
|
}
|
|
@@ -232,8 +233,8 @@ const Points = ({
|
|
|
232
233
|
transform: `translate(${getX(point.x + unitWidth / 1.5)}, ${getY(point.quantity) + 4})`
|
|
233
234
|
}, jsx("path", {
|
|
234
235
|
d: bottomTooltipPath(Width, 20, 6, 4),
|
|
235
|
-
fill:
|
|
236
|
-
stroke:
|
|
236
|
+
fill: getColor(pointsColor),
|
|
237
|
+
stroke: getColor(pointsColor),
|
|
237
238
|
style: {
|
|
238
239
|
filter: 'drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.15))'
|
|
239
240
|
}
|