diginet-core-ui 1.4.16-beta.2 → 1.4.17
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 +25 -36
- package/components/accordion/group.js +18 -33
- package/components/accordion/index.js +28 -42
- package/components/accordion/summary.js +52 -60
- package/components/alert/index.js +75 -84
- package/components/alert/notify.js +31 -43
- package/components/avatar/index.js +75 -78
- package/components/badge/index.js +60 -62
- package/components/breadcrumb/index.js +44 -62
- package/components/button/icon.js +49 -69
- package/components/button/index.js +75 -97
- package/components/button/more.js +39 -60
- package/components/button/ripple-effect.js +1 -1
- package/components/card/body.js +15 -25
- package/components/card/extra.js +15 -25
- package/components/card/footer.js +15 -25
- package/components/card/header.js +15 -26
- package/components/card/index.js +57 -66
- package/components/chart/bar/Labels.js +8 -14
- package/components/chart/bar-v2/Labels.js +8 -14
- package/components/chart/line/Labels.js +8 -14
- package/components/chart/line/Path.js +3 -3
- package/components/chart/line/Point.js +11 -12
- package/components/chart/line-v2/Labels.js +8 -14
- package/components/check-text/index.js +16 -21
- package/components/check-text/interview-confirmation.js +15 -21
- package/components/check-text/interview-status.js +15 -21
- package/components/chip/attach.js +2 -6
- package/components/chip/index.js +82 -83
- package/components/collapse/index.js +1 -1
- package/components/dialogs/colors.js +11 -13
- package/components/divider/index.js +22 -40
- package/components/form-control/attachment/index.js +36 -73
- package/components/form-control/calendar/function.js +38 -42
- package/components/form-control/calendar/index.js +20 -32
- package/components/form-control/calendar/range.js +22 -38
- package/components/form-control/checkbox/index.js +59 -83
- package/components/form-control/control/index.js +10 -9
- package/components/form-control/date-picker/index.js +64 -81
- package/components/form-control/date-range-picker/index.js +75 -92
- package/components/form-control/dropdown/index.js +172 -197
- package/components/form-control/dropdown-box/index.js +43 -56
- package/components/form-control/form-group/index.js +6 -7
- package/components/form-control/helper-text/index.js +41 -45
- package/components/form-control/input-base/index.js +133 -165
- package/components/form-control/label/index.js +41 -48
- package/components/form-control/money-input/index.js +68 -76
- package/components/form-control/number-input/index.js +521 -579
- package/components/form-control/number-input/index2.js +69 -89
- package/components/form-control/password-input/index.js +59 -67
- package/components/form-control/radio/index.js +69 -85
- package/components/form-control/text-input/index.js +70 -79
- package/components/form-control/time-picker/index.js +56 -79
- package/components/form-control/toggle/index.js +129 -140
- package/components/form-view/helper-text.js +2 -2
- package/components/form-view/index.js +31 -34
- package/components/form-view/input.js +69 -70
- package/components/form-view/label.js +9 -14
- package/components/grid/Col.js +39 -48
- package/components/grid/Container.js +38 -31
- package/components/grid/Row.js +32 -28
- package/components/grid/index.js +54 -66
- package/components/image/index.js +27 -37
- package/components/index.js +1 -1
- package/components/list/list-item-action.js +26 -36
- package/components/list/list-item-icon.js +29 -34
- package/components/list/list-item-text.js +22 -27
- package/components/list/list-item.js +36 -42
- package/components/list/list.js +38 -46
- package/components/list/sub-header.js +26 -33
- package/components/modal/body.js +14 -24
- package/components/modal/footer.js +13 -23
- package/components/modal/header.js +28 -39
- package/components/modal/index.js +3 -3
- package/components/modal/modal.js +49 -60
- package/components/others/extra/index.js +30 -31
- package/components/others/import/index.js +2 -2
- package/components/others/scrollbar/index.js +26 -32
- package/components/paging/page-info.js +34 -33
- package/components/paging/page-selector.js +15 -15
- package/components/paper/index.js +28 -32
- package/components/popover/body.js +8 -14
- package/components/popover/footer.js +8 -13
- package/components/popover/header.js +15 -17
- package/components/popover/index.js +60 -71
- package/components/popup/danger_popup.js +16 -17
- package/components/popup/index.js +17 -16
- package/components/popup/v2/index.js +41 -28
- package/components/progress/circular.js +80 -65
- package/components/progress/linear.js +58 -73
- package/components/rating/index.js +55 -41
- package/components/slider/slider-container.js +57 -49
- package/components/slider/slider-item.js +29 -30
- package/components/status/index.js +34 -23
- package/components/tab/tab-header.js +11 -20
- package/components/tab/tab-panel.js +7 -12
- package/components/tab/tab.js +22 -35
- package/components/tooltip/index.js +35 -24
- package/components/transfer/index.js +103 -102
- package/components/tree-view/index.js +81 -99
- package/components/typography/index.js +45 -62
- package/global/index.js +17 -6
- package/icons/basic.js +972 -975
- package/icons/effect.js +7 -8
- package/package.json +31 -64
- package/readme.md +3 -0
- package/styles/color-helper.js +2 -2
- package/styles/colors.js +30 -168
- package/styles/general.js +5 -73
- package/styles/sx/index.js +4 -7
- package/styles/utils.js +5 -6
- package/theme/index.js +2 -13
- package/theme/make-styles.js +1 -2
- package/theme/set-theme.js +38 -0
- package/theme/settings.js +8 -699
- package/theme/theme-provider.js +15 -32
- package/theme/theme.js +56 -57
- package/utils/handleBreakpoints.js +2 -2
- package/utils/hexToRGBA/index.js +2 -2
- package/utils/object/object.js +12 -7
- package/utils/render-portal.js +3 -4
- package/components/form-control/time-picker/v2/index.js +0 -784
- package/theme/createSpacing.js +0 -10
- package/theme/createTheme.js +0 -26
- package/theme/createZIndex.js +0 -9
- package/theme/use-classes.js +0 -15
- package/theme/utils/getThemeProps.js +0 -12
- package/theme/utils/resolveProps.js +0 -17
- package/theme/utils/useThemeProps.js +0 -14
- package/utils/object/deepmerge.js +0 -104
|
@@ -3,28 +3,23 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
6
|
-
import { boxBorder, overflowHidden, parseHeight, pointerEventsNone, positionRelative, textColor, userSelectNone } from "../../styles/general";
|
|
6
|
+
import { boxBorder, overflowHidden, parseHeight, pd, pointerEventsNone, positionRelative, textColor, userSelectNone } from "../../styles/general";
|
|
7
7
|
import { useTheme } from "../../theme";
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { classNames } from "../../utils";
|
|
9
|
+
const {
|
|
10
|
+
typography: {
|
|
11
|
+
paragraph1
|
|
12
|
+
}
|
|
13
|
+
} = useTheme();
|
|
14
|
+
const AccordionDetails = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
15
|
+
action = {},
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
id,
|
|
19
|
+
style
|
|
20
|
+
}, reference) => {
|
|
11
21
|
if (!reference) reference = useRef(null);
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
|
|
14
|
-
// props priority: `inProps` > `themeDefaultProps`
|
|
15
|
-
const props = useThemeProps({
|
|
16
|
-
props: inProps,
|
|
17
|
-
name: 'AccordionDetails'
|
|
18
|
-
});
|
|
19
|
-
const {
|
|
20
|
-
action = {},
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
id,
|
|
24
|
-
style
|
|
25
|
-
} = props;
|
|
26
22
|
const ref = useRef(null);
|
|
27
|
-
const _DetailsRootCSS = DetailsRootCSS(theme);
|
|
28
23
|
useImperativeHandle(reference, () => {
|
|
29
24
|
const currentRef = ref.current || {};
|
|
30
25
|
currentRef.element = ref.current;
|
|
@@ -37,7 +32,7 @@ const AccordionDetails = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, re
|
|
|
37
32
|
});
|
|
38
33
|
return useMemo(() => {
|
|
39
34
|
return jsx("div", {
|
|
40
|
-
css:
|
|
35
|
+
css: DetailsRootCSS,
|
|
41
36
|
className: 'DGN-UI-Accordion-Details',
|
|
42
37
|
ref: ref,
|
|
43
38
|
id: id
|
|
@@ -45,35 +40,29 @@ const AccordionDetails = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, re
|
|
|
45
40
|
style: style,
|
|
46
41
|
className: classNames('DGN-UI-Accordion-Details-Content', className)
|
|
47
42
|
}, children));
|
|
48
|
-
}, [children, className, id, style
|
|
43
|
+
}, [children, className, id, style]);
|
|
49
44
|
}));
|
|
50
|
-
const DetailsRootCSS =
|
|
51
|
-
colors,
|
|
52
|
-
spacing,
|
|
53
|
-
typography
|
|
54
|
-
}) => css`
|
|
45
|
+
const DetailsRootCSS = css`
|
|
55
46
|
${positionRelative};
|
|
56
47
|
${overflowHidden};
|
|
57
48
|
${parseHeight(0)};
|
|
58
49
|
transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
59
50
|
.DGN-UI-Accordion-Details-Content {
|
|
60
51
|
${boxBorder};
|
|
61
|
-
${
|
|
62
|
-
|
|
63
|
-
${textColor(
|
|
52
|
+
${paragraph1};
|
|
53
|
+
${pd([0, 6, 4, 6])};
|
|
54
|
+
${textColor('text/main')};
|
|
64
55
|
&.disabled {
|
|
65
56
|
${pointerEventsNone};
|
|
66
57
|
${userSelectNone};
|
|
67
58
|
}
|
|
68
59
|
}
|
|
69
60
|
`;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// };
|
|
76
|
-
|
|
61
|
+
AccordionDetails.defaultProps = {
|
|
62
|
+
className: '',
|
|
63
|
+
id: '',
|
|
64
|
+
style: {}
|
|
65
|
+
};
|
|
77
66
|
AccordionDetails.propTypes = {
|
|
78
67
|
/** The content of the component. */
|
|
79
68
|
children: PropTypes.node,
|
|
@@ -3,28 +3,17 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Children, cloneElement, forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
6
|
-
import { borderRadius, borderRadius4px } from "../../styles/general";
|
|
7
|
-
import { useTheme } from "../../theme";
|
|
8
|
-
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
6
|
+
import { borderRadius, borderRadius4px, mg } from "../../styles/general";
|
|
9
7
|
import { classNames } from "../../utils";
|
|
10
|
-
const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((
|
|
8
|
+
const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
+
action = {},
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
collapseOther,
|
|
13
|
+
style
|
|
14
|
+
}, reference) => {
|
|
11
15
|
if (!reference) reference = useRef(null);
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
|
|
14
|
-
// props priority: `inProps` > `themeDefaultProps`
|
|
15
|
-
const props = useThemeProps({
|
|
16
|
-
props: inProps,
|
|
17
|
-
name: 'AccordionGroup'
|
|
18
|
-
});
|
|
19
|
-
const {
|
|
20
|
-
action = {},
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
collapseOther,
|
|
24
|
-
style
|
|
25
|
-
} = props;
|
|
26
16
|
const ref = useRef(null);
|
|
27
|
-
const _AccordionGroupRootCSS = AccordionGroupRootCSS(theme);
|
|
28
17
|
const onCollapseOther = (e, onExpand) => {
|
|
29
18
|
if (collapseOther) {
|
|
30
19
|
const accordions = ref.current.querySelectorAll('.DGN-UI-Accordion');
|
|
@@ -49,7 +38,7 @@ const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, refe
|
|
|
49
38
|
});
|
|
50
39
|
return useMemo(() => {
|
|
51
40
|
return jsx("div", {
|
|
52
|
-
css:
|
|
41
|
+
css: AccordionGroupRootCSS,
|
|
53
42
|
ref: ref,
|
|
54
43
|
style: style,
|
|
55
44
|
className: classNames('DGN-UI-Accordion-Group', className)
|
|
@@ -58,9 +47,7 @@ const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, refe
|
|
|
58
47
|
})));
|
|
59
48
|
}, [children, className, collapseOther, style]);
|
|
60
49
|
}));
|
|
61
|
-
const AccordionGroupRootCSS =
|
|
62
|
-
spacing
|
|
63
|
-
}) => css`
|
|
50
|
+
const AccordionGroupRootCSS = css`
|
|
64
51
|
${borderRadius4px};
|
|
65
52
|
.DGN-UI-Accordion {
|
|
66
53
|
&:first-of-type {
|
|
@@ -70,7 +57,7 @@ const AccordionGroupRootCSS = ({
|
|
|
70
57
|
}
|
|
71
58
|
&.expanding {
|
|
72
59
|
${borderRadius4px};
|
|
73
|
-
|
|
60
|
+
${mg([0, 0, 4, 0])};
|
|
74
61
|
.DGN-UI-Divider {
|
|
75
62
|
display: none !important;
|
|
76
63
|
}
|
|
@@ -83,7 +70,7 @@ const AccordionGroupRootCSS = ({
|
|
|
83
70
|
}
|
|
84
71
|
&.expanding {
|
|
85
72
|
${borderRadius4px};
|
|
86
|
-
|
|
73
|
+
${mg([4, 0, 0, 0])};
|
|
87
74
|
.DGN-UI-Accordion-Summary {
|
|
88
75
|
border-radius: 4px 4px 0px 0px;
|
|
89
76
|
}
|
|
@@ -99,7 +86,7 @@ const AccordionGroupRootCSS = ({
|
|
|
99
86
|
}
|
|
100
87
|
&.expanding {
|
|
101
88
|
${borderRadius4px};
|
|
102
|
-
|
|
89
|
+
${mg([4, 0])};
|
|
103
90
|
.DGN-UI-Accordion-Summary {
|
|
104
91
|
border-radius: 4px 4px 0px 0px;
|
|
105
92
|
}
|
|
@@ -121,13 +108,11 @@ const AccordionGroupRootCSS = ({
|
|
|
121
108
|
}
|
|
122
109
|
}
|
|
123
110
|
`;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// };
|
|
130
|
-
|
|
111
|
+
AccordionGroup.defaultProps = {
|
|
112
|
+
className: '',
|
|
113
|
+
collapseOther: true,
|
|
114
|
+
style: {}
|
|
115
|
+
};
|
|
131
116
|
AccordionGroup.propTypes = {
|
|
132
117
|
/** The content of the component. */
|
|
133
118
|
children: PropTypes.node,
|
|
@@ -5,9 +5,7 @@ import { Divider } from "./..";
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { bgColor, borderRadius4px, cursorNotAllowed, displayBlock, parseHeight, parseWidth, positionRelative, shadowNone } from "../../styles/general";
|
|
8
|
-
import {
|
|
9
|
-
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
10
|
-
import { classNames, getProp } from "../../utils";
|
|
8
|
+
import { classNames } from "../../utils";
|
|
11
9
|
import AccordionContext from "./context";
|
|
12
10
|
const handleTransition = (timer, el, beginHeight, endHeight = null) => {
|
|
13
11
|
const getAutoHeightDuration = height => {
|
|
@@ -29,34 +27,26 @@ const handleTransition = (timer, el, beginHeight, endHeight = null) => {
|
|
|
29
27
|
el.style.height = endHeight;
|
|
30
28
|
}, duration);
|
|
31
29
|
};
|
|
32
|
-
const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((
|
|
30
|
+
const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
31
|
+
action = {},
|
|
32
|
+
boxShadow,
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
disabled,
|
|
36
|
+
expand,
|
|
37
|
+
expanded,
|
|
38
|
+
fullHeight,
|
|
39
|
+
id,
|
|
40
|
+
onClick,
|
|
41
|
+
onCollapse,
|
|
42
|
+
onExpand,
|
|
43
|
+
style
|
|
44
|
+
}, reference) => {
|
|
33
45
|
if (!reference) reference = useRef(null);
|
|
34
|
-
const theme = useTheme();
|
|
35
|
-
|
|
36
|
-
// props priority: `inProps` > `themeDefaultProps`
|
|
37
|
-
const props = useThemeProps({
|
|
38
|
-
props: inProps,
|
|
39
|
-
name: 'Accordion'
|
|
40
|
-
});
|
|
41
|
-
const {
|
|
42
|
-
action = {},
|
|
43
|
-
boxShadow,
|
|
44
|
-
children,
|
|
45
|
-
className,
|
|
46
|
-
disabled,
|
|
47
|
-
expand,
|
|
48
|
-
expanded,
|
|
49
|
-
fullHeight,
|
|
50
|
-
id,
|
|
51
|
-
onClick,
|
|
52
|
-
onCollapse,
|
|
53
|
-
onExpand,
|
|
54
|
-
style
|
|
55
|
-
} = props;
|
|
56
46
|
const ref = useRef(null);
|
|
57
47
|
const timer = useRef(null);
|
|
58
48
|
const [expandState, setExpandState] = useState(expanded || expand);
|
|
59
|
-
const _AccordionRootCSS = AccordionRootCSS(fullHeight, expandState
|
|
49
|
+
const _AccordionRootCSS = AccordionRootCSS(fullHeight, expandState);
|
|
60
50
|
useEffect(() => {
|
|
61
51
|
if (ref.current) {
|
|
62
52
|
if (fullHeight) {
|
|
@@ -114,17 +104,15 @@ const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference
|
|
|
114
104
|
display: 'none'
|
|
115
105
|
}
|
|
116
106
|
})));
|
|
117
|
-
}, [boxShadow, children, className, disabled, expand, expanded, fullHeight, id, onClick, onCollapse, onExpand, style, expandState
|
|
107
|
+
}, [boxShadow, children, className, disabled, expand, expanded, fullHeight, id, onClick, onCollapse, onExpand, style, expandState]);
|
|
118
108
|
}));
|
|
119
|
-
const AccordionRootCSS = (fullHeight, expandState
|
|
120
|
-
colors
|
|
121
|
-
}) => css`
|
|
109
|
+
const AccordionRootCSS = (fullHeight, expandState) => css`
|
|
122
110
|
${displayBlock};
|
|
123
111
|
${positionRelative};
|
|
124
112
|
${borderRadius4px};
|
|
125
113
|
${parseWidth('100%')};
|
|
126
114
|
${fullHeight && expandState && parseHeight('100%')};
|
|
127
|
-
${bgColor(
|
|
115
|
+
${bgColor('system/white')};
|
|
128
116
|
transition: margin 300ms ease, height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
129
117
|
`;
|
|
130
118
|
const AccordionRootBoxShadowCSS = css`
|
|
@@ -134,16 +122,14 @@ const AccordionRootDisabledCSS = css`
|
|
|
134
122
|
${cursorNotAllowed};
|
|
135
123
|
${shadowNone};
|
|
136
124
|
`;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
// };
|
|
146
|
-
|
|
125
|
+
Accordion.defaultProps = {
|
|
126
|
+
boxShadow: true,
|
|
127
|
+
className: '',
|
|
128
|
+
disabled: false,
|
|
129
|
+
expand: false,
|
|
130
|
+
fullHeight: false,
|
|
131
|
+
style: {}
|
|
132
|
+
};
|
|
147
133
|
Accordion.propTypes = {
|
|
148
134
|
/** The box-shadow of component. */
|
|
149
135
|
boxShadow: PropTypes.bool,
|
|
@@ -4,38 +4,37 @@ import { css, jsx } from '@emotion/core';
|
|
|
4
4
|
import { ButtonIcon, Typography } from "./..";
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
|
-
import { bgColor, bgTransparent, borderRadius4px, boxBorder, breakWord, cursorPointer, displayFlex, displayInlineBlock, displayInlineFlex, flexRow, flexRowReverse, inset, itemsCenter, justifyBetween, justifyCenter, justifyEnd, parseMaxWidthHeight, parseMinHeight, parseMinWidthHeight, parseWidth, parseWidthHeight, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionRelative, textColor, userSelectNone } from "../../styles/general";
|
|
7
|
+
import { bgColor, bgTransparent, borderRadius4px, boxBorder, breakWord, cursorPointer, displayFlex, displayInlineBlock, displayInlineFlex, flexRow, flexRowReverse, inset, itemsCenter, justifyBetween, justifyCenter, justifyEnd, mgl, mgr, parseMaxWidthHeight, parseMinHeight, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionRelative, textColor, userSelectNone } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
|
-
import { classNames
|
|
9
|
+
import { classNames } from "../../utils";
|
|
10
10
|
import AccordionContext from "./context";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const {
|
|
12
|
+
colors: {
|
|
13
|
+
system: {
|
|
14
|
+
active: systemActive,
|
|
15
|
+
disabled: systemDisabled
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
typography: {
|
|
19
|
+
heading3
|
|
20
|
+
},
|
|
21
|
+
spacing
|
|
22
|
+
} = useTheme();
|
|
23
|
+
const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
24
|
+
action = {},
|
|
25
|
+
background,
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
collapseIcon,
|
|
29
|
+
expandIcon,
|
|
30
|
+
expandIconAt,
|
|
31
|
+
expandIconProps,
|
|
32
|
+
id,
|
|
33
|
+
onClick,
|
|
34
|
+
style,
|
|
35
|
+
title
|
|
36
|
+
}, reference) => {
|
|
13
37
|
if (!reference) reference = useRef(null);
|
|
14
|
-
const theme = useTheme();
|
|
15
|
-
const {
|
|
16
|
-
colors,
|
|
17
|
-
spacing
|
|
18
|
-
} = theme;
|
|
19
|
-
|
|
20
|
-
// props priority: `inProps` > `themeDefaultProps`
|
|
21
|
-
const props = useThemeProps({
|
|
22
|
-
props: inProps,
|
|
23
|
-
name: 'AccordionSummary'
|
|
24
|
-
});
|
|
25
|
-
const {
|
|
26
|
-
action = {},
|
|
27
|
-
background: backgroundProp,
|
|
28
|
-
children,
|
|
29
|
-
className,
|
|
30
|
-
collapseIcon,
|
|
31
|
-
expandIcon,
|
|
32
|
-
expandIconAt,
|
|
33
|
-
expandIconProps,
|
|
34
|
-
id,
|
|
35
|
-
onClick,
|
|
36
|
-
style,
|
|
37
|
-
title
|
|
38
|
-
} = props;
|
|
39
38
|
const {
|
|
40
39
|
expanded,
|
|
41
40
|
expandState,
|
|
@@ -50,8 +49,7 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, re
|
|
|
50
49
|
const ref = useRef(null);
|
|
51
50
|
const expandIconRef = useRef(null);
|
|
52
51
|
const timer = useRef(null);
|
|
53
|
-
const
|
|
54
|
-
const _SummaryRootCSS = SummaryRootCSS(background, theme);
|
|
52
|
+
const _SummaryRootCSS = SummaryRootCSS(background);
|
|
55
53
|
const _onClick = e => {
|
|
56
54
|
if (disabled) return;
|
|
57
55
|
const target = e.target;
|
|
@@ -141,13 +139,9 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, re
|
|
|
141
139
|
}) : jsx("span", {
|
|
142
140
|
className: 'Accordion-Collapse-Icon effect'
|
|
143
141
|
}, collapseIcon)))));
|
|
144
|
-
}, [children, className, collapseIcon, expandIcon, expandIconAt, expandIconProps, id, onClick, style, title,
|
|
142
|
+
}, [background, children, className, collapseIcon, expandIcon, expandIconAt, expandIconProps, id, onClick, style, title, disabled, expanded, expandState, onClickAccordion, onCollapse, onExpand]);
|
|
145
143
|
}));
|
|
146
|
-
const SummaryRootCSS =
|
|
147
|
-
colors,
|
|
148
|
-
spacing,
|
|
149
|
-
typography
|
|
150
|
-
}) => css`
|
|
144
|
+
const SummaryRootCSS = background => css`
|
|
151
145
|
${displayFlex};
|
|
152
146
|
${flexRow};
|
|
153
147
|
${positionRelative};
|
|
@@ -158,17 +152,17 @@ const SummaryRootCSS = (background, {
|
|
|
158
152
|
${borderRadius4px};
|
|
159
153
|
${parseWidth('100%')};
|
|
160
154
|
${parseMinHeight(56)};
|
|
161
|
-
|
|
155
|
+
${pd([4, 6])};
|
|
162
156
|
${bgColor(background)};
|
|
163
157
|
.Accordion-Expand-Icon,
|
|
164
158
|
.Accordion-Collapse-Icon {
|
|
165
159
|
${cursorPointer};
|
|
166
|
-
color: ${
|
|
160
|
+
color: ${systemActive} !important;
|
|
167
161
|
&:active,
|
|
168
162
|
&:focus,
|
|
169
163
|
&:hover {
|
|
170
164
|
${bgColor('transparent')};
|
|
171
|
-
${textColor(
|
|
165
|
+
${textColor('system/active')};
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
168
|
.Accordion-Icon-Root {
|
|
@@ -190,7 +184,7 @@ const SummaryRootCSS = (background, {
|
|
|
190
184
|
${flexRowReverse};
|
|
191
185
|
${justifyEnd};
|
|
192
186
|
.Accordion-Icon.rotate-able {
|
|
193
|
-
|
|
187
|
+
${mgr([2])};
|
|
194
188
|
&.TreeView {
|
|
195
189
|
transform: rotateZ(-90deg);
|
|
196
190
|
}
|
|
@@ -198,7 +192,7 @@ const SummaryRootCSS = (background, {
|
|
|
198
192
|
}
|
|
199
193
|
&.end {
|
|
200
194
|
.Accordion-Icon.rotate-able {
|
|
201
|
-
|
|
195
|
+
${mgl([2])};
|
|
202
196
|
&.TreeView {
|
|
203
197
|
transform: rotateZ(90deg);
|
|
204
198
|
}
|
|
@@ -226,21 +220,21 @@ const SummaryRootCSS = (background, {
|
|
|
226
220
|
&:not(.disabled) {
|
|
227
221
|
transition: background-color 300ms ease;
|
|
228
222
|
&:hover {
|
|
229
|
-
${bgColor(
|
|
223
|
+
${bgColor('fill.hover')};
|
|
230
224
|
}
|
|
231
225
|
&:focus {
|
|
232
|
-
${bgColor(
|
|
226
|
+
${bgColor('fill.focus')};
|
|
233
227
|
}
|
|
234
228
|
&:active {
|
|
235
|
-
${bgColor(
|
|
229
|
+
${bgColor('fill.pressed')};
|
|
236
230
|
}
|
|
237
231
|
}
|
|
238
232
|
&.disabled {
|
|
239
233
|
${pointerEventsNone};
|
|
240
|
-
${bgColor(
|
|
234
|
+
${bgColor('fill.disabled')};
|
|
241
235
|
.DGN-UI-Accordion-Summary-Content,
|
|
242
236
|
.Accordion-Expand-Icon {
|
|
243
|
-
color: ${
|
|
237
|
+
color: ${systemDisabled} !important;
|
|
244
238
|
}
|
|
245
239
|
}
|
|
246
240
|
&.treeview-disabled {
|
|
@@ -249,7 +243,7 @@ const SummaryRootCSS = (background, {
|
|
|
249
243
|
${bgTransparent};
|
|
250
244
|
}
|
|
251
245
|
.TreeView-Item {
|
|
252
|
-
${textColor(
|
|
246
|
+
${textColor('system.disabled')};
|
|
253
247
|
}
|
|
254
248
|
.Accordion-Icon.rotate-able.TreeView .DGN-UI-Icon {
|
|
255
249
|
${cursorPointer};
|
|
@@ -257,14 +251,14 @@ const SummaryRootCSS = (background, {
|
|
|
257
251
|
}
|
|
258
252
|
}
|
|
259
253
|
.DGN-UI-Accordion-Summary-Content {
|
|
260
|
-
${
|
|
254
|
+
${heading3};
|
|
261
255
|
${flexRow};
|
|
262
256
|
${positionRelative};
|
|
263
257
|
${breakWord};
|
|
264
258
|
${userSelectNone};
|
|
265
259
|
${boxBorder}
|
|
266
260
|
${itemsCenter};
|
|
267
|
-
${textColor(
|
|
261
|
+
${textColor('system.active')};
|
|
268
262
|
${parseWidth('100%')};
|
|
269
263
|
${parseMinHeight(24)};
|
|
270
264
|
}
|
|
@@ -297,16 +291,14 @@ const SummaryRootCSS = (background, {
|
|
|
297
291
|
}
|
|
298
292
|
}
|
|
299
293
|
`;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// };
|
|
309
|
-
|
|
294
|
+
AccordionSummary.defaultProps = {
|
|
295
|
+
background: 'system/white',
|
|
296
|
+
className: '',
|
|
297
|
+
expandIcon: 'ArrowRight',
|
|
298
|
+
expandIconAt: 'start',
|
|
299
|
+
expandIconProps: {},
|
|
300
|
+
style: {}
|
|
301
|
+
};
|
|
310
302
|
AccordionSummary.propTypes = {
|
|
311
303
|
/** Background for label summary. */
|
|
312
304
|
background: PropTypes.string,
|