diginet-core-ui 1.3.46 → 1.3.47-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.
@@ -0,0 +1,11 @@
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M30.7901 28.13C30.7901 27.5 30.2701 26.99 29.6401 26.99H19.2301C18.5901 26.99 18.0801 27.5 18.0801 28.13C18.0801 28.76 18.6001 29.27 19.2301 29.27H29.6401C30.2701 29.27 30.7901 28.76 30.7901 28.13Z" fill="#FF8C00"/>
3
+ <path d="M29.6401 22.41H19.2301C18.5901 22.41 18.0801 22.92 18.0801 23.55C18.0801 24.18 18.6001 24.69 19.2301 24.69H29.6401C30.2801 24.69 30.7901 24.18 30.7901 23.55C30.7901 22.93 30.2701 22.41 29.6401 22.41Z" fill="#FF8C00"/>
4
+ <path d="M19.2301 31.5601C18.5901 31.5601 18.0801 32.0701 18.0801 32.7001C18.0801 33.3301 18.6001 33.8401 19.2301 33.8401H25.0201C25.6601 33.8401 26.1701 33.3301 26.1701 32.7001C26.1701 32.0701 25.6501 31.5601 25.0201 31.5601H19.2301Z" fill="#FF8C00"/>
5
+ <path d="M10.0601 25.8101H11.2001V23.5701H10.2401V22.8501C10.8601 22.7501 11.1701 22.6401 11.5201 22.4301H12.3901V25.8201H13.3301V26.7601H10.0601V25.8101Z" fill="#FF8C00"/>
6
+ <path d="M14.8799 25.9401C14.8799 25.4501 15.2399 25.05 15.7799 25.05C16.3199 25.05 16.6799 25.4501 16.6799 25.9401C16.6799 26.4301 16.3199 26.83 15.7799 26.83C15.2399 26.83 14.8799 26.4301 14.8799 25.9401Z" fill="#FF8C00"/>
7
+ <path d="M9.92011 33.17C11.0901 32.23 11.9401 31.5 11.9401 30.91C11.9401 30.52 11.6901 30.34 11.3001 30.34C10.9801 30.34 10.7201 30.55 10.4901 30.75L9.86011 30.12C10.3401 29.64 10.7801 29.42 11.4701 29.42C12.4101 29.42 13.0601 29.98 13.0601 30.84C13.0601 31.54 12.3301 32.3 11.6101 32.9C11.8501 32.87 12.1801 32.85 12.4001 32.85H13.2801V33.83H9.92011V33.17Z" fill="#FF8C00"/>
8
+ <path d="M14.8799 33.03C14.8799 32.54 15.2399 32.14 15.7799 32.14C16.3199 32.14 16.6799 32.54 16.6799 33.03C16.6799 33.52 16.3199 33.92 15.7799 33.92C15.2399 33.92 14.8799 33.53 14.8799 33.03Z" fill="#FF8C00"/>
9
+ <path d="M34.74 9.52L25.35 0.26C25.17 0.1 24.93 0 24.7 0H8.26C6.47 0 5 1.45 5 3.22V35.78C5 37.55 6.47 39 8.26 39H31.73C33.53 39 34.99 37.55 34.99 35.78V10.16C35 9.93 34.9 9.69 34.74 9.52ZM25.61 3.09L26.05 3.52L31.42 8.82L31.86 9.26H27.03C26.25 9.26 25.6 8.63 25.6 7.85V3.09H25.61ZM33.16 35.78C33.16 36.56 32.52 37.19 31.73 37.19H8.26C7.48 37.19 6.83 36.56 6.83 35.78V3.22C6.83 2.44 7.47 1.81 8.26 1.81H23.77V7.85C23.77 9.62 25.24 11.07 27.03 11.07H31.22L32.9 11.06H33.16V35.78Z" fill="#2680EB"/>
10
+ <path d="M16.0101 5.78003C12.4801 5.78003 9.61011 8.64003 9.61011 12.18C9.61011 15.72 12.4701 18.58 16.0101 18.58C19.5401 18.58 22.4101 15.72 22.4101 12.18C22.4101 8.64003 19.5401 5.78003 16.0101 5.78003ZM15.8301 16.69C15.2601 16.69 14.8101 16.26 14.8101 15.72C14.8101 15.18 15.2601 14.76 15.8301 14.76C16.3901 14.76 16.8501 15.19 16.8501 15.72C16.8501 16.26 16.3901 16.69 15.8301 16.69ZM17.5801 12.63C16.8401 13.06 16.6401 13.3 16.6401 13.8V14.05H14.9601L14.9401 13.83C14.8401 12.91 15.1101 12.42 15.8601 11.99C16.5901 11.56 16.7801 11.33 16.7801 10.86C16.7801 10.42 16.4201 10.12 15.9201 10.12C15.4001 10.12 15.0501 10.46 15.0301 10.99H13.2801C13.3001 9.58003 14.3201 8.66003 16.0401 8.66003C17.6801 8.66003 18.7401 9.52003 18.7401 10.82C18.7401 11.62 18.3701 12.17 17.5801 12.63Z" fill="#2680EB"/>
11
+ </svg>
@@ -1,37 +1,37 @@
1
1
  import { css } from '@emotion/core';
2
- import { typography } from '../../styles/typography';
3
- import { color as colors } from '../../styles/colors';
4
- import { alignCenter, backgroundTransparent, borderBox, borderRadius4px, breakWord, cursorPointer, displayInlineBlock, flexRow, flexRowReverse, inlineFlex, justifyBetween, justifyCenter, justifyEnd, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../styles/general';
2
+ import theme from '../../theme/settings';
3
+ import { alignCenter, alignStart, backgroundTransparent, borderBox, borderRadius4px, breakWord, cursorPointer, displayInlineBlock, flexRow, flexRowReverse, inlineFlex, justifyBetween, justifyCenter, justifyEnd, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../styles/general';
5
4
  const {
6
- heading3
7
- } = typography;
8
- const {
9
- system: {
10
- active,
11
- disabled: systemDisabled
5
+ colors: {
6
+ system: {
7
+ active,
8
+ disabled: systemDisabled
9
+ },
10
+ fill: {
11
+ disabled: fillDisabled,
12
+ headerbar,
13
+ focus,
14
+ hover,
15
+ pressed
16
+ }
12
17
  },
13
- fill: {
14
- disabled: fillDisabled,
15
- headerbar,
16
- focus,
17
- hover,
18
- pressed
19
- }
20
- } = colors;
21
- export const SummaryRootCSS = css`
18
+ typography: {
19
+ heading3
20
+ },
21
+ spacing
22
+ } = theme;
23
+ export const SummaryRootCSS = background => css`
22
24
  ${flexRow};
23
25
  ${positionRelative};
24
26
  ${justifyBetween};
25
- ${alignCenter};
27
+ ${alignStart};
26
28
  ${cursorPointer};
27
29
  ${borderBox};
28
30
  ${borderRadius4px};
29
31
  width: 100%;
30
32
  min-height: 56px;
31
- padding: 16px 24px;
32
- &.background {
33
- background-color: ${headerbar};
34
- }
33
+ padding: ${spacing(4)}px ${spacing(6)}px;
34
+ ${background && `background-color: ${background === true ? headerbar : theme.colors[background] || background};`};
35
35
  .Accordion-Expand-Icon,
36
36
  .Accordion-Collapse-Icon {
37
37
  ${cursorPointer};
@@ -47,8 +47,7 @@ export const SummaryRootCSS = css`
47
47
  ${flexRow};
48
48
  .Accordion-Icon.rotate-able {
49
49
  ${borderBox};
50
- width: 24px;
51
- height: 24px;
50
+ ${parseWidthHeight(24, 24)};
52
51
  &:not(.TreeView) {
53
52
  transform: rotateZ(0deg);
54
53
  transform-origin: center;
@@ -62,7 +61,7 @@ export const SummaryRootCSS = css`
62
61
  ${flexRowReverse};
63
62
  ${justifyEnd};
64
63
  .Accordion-Icon.rotate-able {
65
- margin-right: 8px;
64
+ margin-right: ${spacing(2)}px;
66
65
  &.TreeView {
67
66
  transform: rotateZ(-90deg);
68
67
  }
@@ -70,7 +69,7 @@ export const SummaryRootCSS = css`
70
69
  }
71
70
  &.end {
72
71
  .Accordion-Icon.rotate-able {
73
- margin-left: 8px;
72
+ margin-left: ${spacing(2)}px;
74
73
  &.TreeView {
75
74
  transform: rotateZ(90deg);
76
75
  }
@@ -144,8 +143,7 @@ export const SummaryRootCSS = css`
144
143
  ${displayInlineBlock};
145
144
  ${positionRelative};
146
145
  ${cursorPointer};
147
- width: 24px;
148
- height: 24px;
146
+ ${parseWidthHeight(24, 24)};
149
147
  transition: transform 200ms linear;
150
148
  .Accordion-Expand-Icon {
151
149
  transform: scale(1);
@@ -169,7 +167,6 @@ export const SummaryRootCSS = css`
169
167
  max-width: 34px;
170
168
  min-height: 24px;
171
169
  max-height: 34px;
172
- padding: 3px;
173
170
  }
174
171
  }
175
172
  `;
@@ -5,16 +5,18 @@ import { memo, forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import { borderBox, displayBlock, overflowHidden, pointerEventsNone, positionRelative, userSelectNone } from '../../styles/general';
8
- import { typography } from '../../styles/typography';
9
- import { color as colors } from '../../styles/colors';
8
+ import theme from '../../theme/settings';
10
9
  const {
11
- paragraph1
12
- } = typography;
13
- const {
14
- text: {
15
- main
16
- }
17
- } = colors;
10
+ colors: {
11
+ text: {
12
+ main
13
+ }
14
+ },
15
+ typography: {
16
+ paragraph1
17
+ },
18
+ spacing
19
+ } = theme;
18
20
  const AccordionDetails = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
19
21
  children,
20
22
  className,
@@ -52,7 +54,7 @@ const DetailsRootCSS = css`
52
54
  .DGN-UI-Accordion-Details-Content {
53
55
  ${borderBox};
54
56
  ${paragraph1};
55
- padding: 0 24px 16px 24px;
57
+ padding: 0 ${spacing(6)}px ${spacing(4)}px ${spacing(6)}px;
56
58
  color: ${main};
57
59
  &.disabled {
58
60
  ${pointerEventsNone}
@@ -66,13 +68,13 @@ AccordionDetails.defaultProps = {
66
68
  id: ''
67
69
  };
68
70
  AccordionDetails.propTypes = {
69
- /** The element to display in alert like text props (priority) */
71
+ /** The content of the component. */
70
72
  children: PropTypes.node,
71
73
 
72
- /** class for De */
73
- className: PropTypes.string,
74
+ /** Style inline of component. */
75
+ style: PropTypes.object,
74
76
 
75
- /** style inline of component */
76
- style: PropTypes.object
77
+ /** Class for component. */
78
+ className: PropTypes.string
77
79
  };
78
80
  export default AccordionDetails;
@@ -41,10 +41,10 @@ const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
41
41
  ref: ref,
42
42
  style: style,
43
43
  className: ['DGN-UI-Accordion-Group', className].join(' ').trim().replace(/\s+/g, ' ')
44
- }, Children.map(children, child => /*#__PURE__*/cloneElement(child, {
44
+ }, Children.map(children, child => child && /*#__PURE__*/cloneElement(child, {
45
45
  onExpand: e => onCollapseOther(e, child.props.onExpand)
46
46
  })));
47
- }, [className, children]);
47
+ }, [style, className, children]);
48
48
  }));
49
49
  const AccordionGroupRootCSS = css`
50
50
  ${borderRadius4px};
@@ -113,16 +113,16 @@ AccordionGroup.defaultProps = {
113
113
  style: {}
114
114
  };
115
115
  AccordionGroup.propTypes = {
116
- /** collapse other if true */
117
- collapseOther: PropTypes.bool,
116
+ /** The content of the component. */
117
+ children: PropTypes.node,
118
118
 
119
- /** class on element */
120
- className: PropTypes.string,
119
+ /** Style inline of component. */
120
+ style: PropTypes.object,
121
121
 
122
- /** insist <Accordion /> */
123
- children: PropTypes.node.isRequired,
122
+ /** Class for component. */
123
+ className: PropTypes.string,
124
124
 
125
- /** style inline of component */
126
- style: PropTypes.object
125
+ /** If `true`, collapse other when expand */
126
+ collapseOther: PropTypes.bool
127
127
  };
128
128
  export default AccordionGroup;
@@ -7,13 +7,16 @@ import { jsx, css } from '@emotion/core';
7
7
  import AccordionContext from './context';
8
8
  import Divider from '../divider';
9
9
  import { borderRadius4px, displayBlock, positionRelative } from '../../styles/general';
10
- import { color as colors } from '../../styles/colors';
10
+ import theme from '../../theme/settings';
11
11
  const {
12
- line: {
13
- category
12
+ colors: {
13
+ line: {
14
+ category
15
+ }
14
16
  }
15
- } = colors;
17
+ } = theme;
16
18
  const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
19
+ id,
17
20
  disabled,
18
21
  expand,
19
22
  expanded,
@@ -57,6 +60,7 @@ const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
57
60
  });
58
61
  return useMemo(() => {
59
62
  return jsx("div", {
63
+ id: id,
60
64
  css: AccordionRootCSS,
61
65
  ref: ref,
62
66
  style: style,
@@ -78,7 +82,7 @@ const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
78
82
  display: 'none'
79
83
  }
80
84
  })));
81
- }, [disabled, className, boxShadow, onClick, children, expanded, onExpand, onCollapse, expandState]);
85
+ }, [id, disabled, className, boxShadow, onClick, children, expanded, onExpand, onCollapse, expandState]);
82
86
  }));
83
87
  const AccordionRootCSS = css`
84
88
  ${displayBlock};
@@ -102,31 +106,31 @@ Accordion.defaultProps = {
102
106
  style: {}
103
107
  };
104
108
  Accordion.propTypes = {
105
- /** prevent all event if true */
109
+ /** The content of the component (insist <AccordionSummary />, <AccordionDetails />). */
110
+ children: PropTypes.node,
111
+
112
+ /** Style inline of component. */
113
+ style: PropTypes.object,
114
+
115
+ /** Class for component. */
116
+ className: PropTypes.string,
117
+
118
+ /** If `true`, the component is disabled. */
106
119
  disabled: PropTypes.bool,
107
120
 
108
- /** expand immediate after render if true (don't use this) */
121
+ /** If `true`, expand immediate after render (shouldn't use this). */
109
122
  expand: PropTypes.bool,
110
123
 
111
- /** expand state of accordion (use this) */
124
+ /** Expand state of accordion (should use this). */
112
125
  expanded: PropTypes.bool,
113
126
 
114
- /** class on element */
115
- className: PropTypes.string,
116
-
117
- /** class on element */
127
+ /** The box-shadow of component. */
118
128
  boxShadow: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
119
129
 
120
- /** The function will run after expand Accordion detail */
130
+ /** Callback fired when Accordion is expanded. */
121
131
  onExpand: PropTypes.func,
122
132
 
123
- /** The function will run after collapse Accordion detail */
124
- onCollapse: PropTypes.func,
125
-
126
- /** insist <AccordionSummary />, <AccordionDetails /> */
127
- children: PropTypes.node,
128
-
129
- /** style inline of component */
130
- style: PropTypes.object
133
+ /** Callback fired when Accordion is collapsed. */
134
+ onCollapse: PropTypes.func
131
135
  };
132
136
  export default Accordion;
@@ -8,6 +8,7 @@ import { renderIcon } from '../../utils';
8
8
  import { SummaryRootCSS } from './css';
9
9
  import AccordionContext from './context';
10
10
  const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
11
+ id,
11
12
  expandIcon,
12
13
  collapseIcon,
13
14
  expandIconAt,
@@ -18,9 +19,6 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
18
19
  expandIconProps,
19
20
  style
20
21
  }, reference) => {
21
- const ref = useRef(null);
22
- const expandIconRef = useRef(null);
23
- const timer = useRef(null);
24
22
  const {
25
23
  expanded,
26
24
  expandState,
@@ -30,8 +28,13 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
30
28
  onCollapse,
31
29
  setExpandState
32
30
  } = useContext(AccordionContext);
31
+ const ref = useRef(null);
32
+ const expandIconRef = useRef(null);
33
+ const timer = useRef(null);
33
34
 
34
- const onClickHandler = e => {
35
+ const _SummaryRootCSS = SummaryRootCSS(background);
36
+
37
+ const _onClick = e => {
35
38
  if (!disabled) {
36
39
  const target = e.target;
37
40
 
@@ -93,19 +96,6 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
93
96
  }
94
97
  };
95
98
 
96
- useEffect(() => {
97
- if (/^(#|rgb)/.test(background)) {
98
- if (ref.current) {
99
- ref.current.style.backgroundColor = background;
100
- }
101
-
102
- return () => {
103
- if (ref.current) {
104
- ref.current.style.backgroundColor = null;
105
- }
106
- };
107
- }
108
- }, [background]);
109
99
  useEffect(() => {
110
100
  if (expandState) {
111
101
  showHideDetailHandler('show');
@@ -124,19 +114,20 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
124
114
  });
125
115
  return useMemo(() => {
126
116
  return jsx("div", {
127
- css: SummaryRootCSS,
117
+ id: id,
118
+ css: _SummaryRootCSS,
128
119
  ref: ref,
129
120
  tabIndex: "-1",
130
- onClick: onClickHandler,
121
+ onClick: _onClick,
131
122
  style: style,
132
- className: ['DGN-UI-Accordion-Summary', disabled ? 'disabled' : '', expandIcon ? expandIconAt : '', className, background === true ? 'background' : '', expandState ? 'expanding' : ''].join(' ').trim().replace(/\s+/g, ' ')
123
+ className: ['DGN-UI-Accordion-Summary', disabled ? 'disabled' : '', expandIcon ? expandIconAt : '', expandState ? 'expanding' : '', className].join(' ').trim().replace(/\s+/g, ' ')
133
124
  }, jsx("div", {
134
125
  className: 'DGN-UI-Accordion-Summary-Content'
135
126
  }, children), !!expandIcon && jsx("div", {
136
127
  className: 'Accordion-Icon-Root'
137
128
  }, jsx("div", { ...expandIconProps,
138
129
  ref: expandIconRef,
139
- className: ['Accordion-Icon', collapseIcon ? '' : 'rotate-able', expandIconProps.className ? expandIconProps.className : ''].join(' ').trim()
130
+ className: ['Accordion-Icon', collapseIcon ? '' : 'rotate-able', expandIconProps.className ? expandIconProps.className : ''].join(' ').trim().replace(/\s+/g, ' ')
140
131
  }, typeof expandIcon === 'string' ? renderIcon(expandIcon, 'effect', {
141
132
  className: 'Accordion-Expand-Icon'
142
133
  }) : jsx("span", {
@@ -146,7 +137,7 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
146
137
  }) : jsx("span", {
147
138
  className: 'Accordion-Collapse-Icon effect'
148
139
  }, collapseIcon)))));
149
- }, [expandIcon, expandIconAt, className, background, children, collapseIcon, expandIconProps, expandState]);
140
+ }, [id, expandIcon, expandIconAt, className, background, children, collapseIcon, expandIconProps, expandState]);
150
141
  }));
151
142
  AccordionSummary.defaultProps = {
152
143
  expandIconAt: 'start',
@@ -156,28 +147,28 @@ AccordionSummary.defaultProps = {
156
147
  style: {}
157
148
  };
158
149
  AccordionSummary.propTypes = {
159
- /** the icon to display for expand icon */
150
+ /** The content of the component. */
151
+ children: PropTypes.node,
152
+
153
+ /** Style inline of component. */
154
+ style: PropTypes.object,
155
+
156
+ /** Class for component. */
157
+ className: PropTypes.string,
158
+
159
+ /** Icon display for expand icon. */
160
160
  expandIcon: PropTypes.any,
161
161
 
162
- /** the icon to display for collapse icon */
162
+ /** Icon display for collapse icon. */
163
163
  collapseIcon: PropTypes.any,
164
164
 
165
- /** the position to render expand icon */
165
+ /** Position to render icon. */
166
166
  expandIconAt: PropTypes.oneOf(['start', 'end']),
167
167
 
168
- /** background for label summary */
168
+ /** Background for label summary. */
169
169
  background: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
170
170
 
171
- /** class for Summary component */
172
- className: PropTypes.string,
173
-
174
- /** The element to display in alert like text props (priority) */
175
- children: PropTypes.node,
176
-
177
- /** props of expand and collapse icons */
178
- expandIconProps: PropTypes.any,
179
-
180
- /** style inline of component */
181
- style: PropTypes.object
171
+ /** Other props of icons. */
172
+ expandIconProps: PropTypes.any
182
173
  };
183
174
  export default AccordionSummary;
@@ -10,8 +10,8 @@ import ButtonIcon from '../button/icon';
10
10
  import Icon from '../../icons';
11
11
  import { hexToRGBA } from '../../styles/color-helper';
12
12
  import { typography } from '../../styles/typography';
13
- import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
14
13
  import { useTheme } from '../../theme';
14
+ import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
15
15
  const {
16
16
  heading3,
17
17
  heading4,
@@ -114,8 +114,7 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
114
114
  className: size
115
115
  }, jsx(Typography, {
116
116
  type: size === 'small' ? 'p2' : 'p1',
117
- color: 'inherit',
118
- lineClamp: 1
117
+ color: 'inherit'
119
118
  }, renderLabel()));
120
119
  }, [label, size, startIcon, endIcon, clearAble]);
121
120
  const endIconView = useMemo(() => {
@@ -41,8 +41,8 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
41
41
  children,
42
42
  inputProps,
43
43
  forTreeView,
44
- width,
45
44
  labelProps,
45
+ width,
46
46
  ...props
47
47
  }, reference) => {
48
48
  if (!inputRef) {