diginet-core-ui 1.3.24 → 1.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/assets/fonts/SF-Pro-Display-Bold.otf +0 -0
  2. package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
  3. package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
  4. package/assets/images/icons/wifi.svg +3 -0
  5. package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
  6. package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
  7. package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
  8. package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
  9. package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
  10. package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
  11. package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
  12. package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
  13. package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
  14. package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
  15. package/assets/images/menu/dhr/TASK.svg +9 -0
  16. package/assets/images/menu/erp/D05.svg +8 -0
  17. package/assets/images/menu/erp/D06.svg +4 -0
  18. package/assets/images/menu/erp/D90R.svg +9 -0
  19. package/assets/images/menu/erp/DBC.svg +9 -0
  20. package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
  21. package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
  22. package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
  23. package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
  24. package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
  25. package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
  26. package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
  27. package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
  28. package/components/accordion/css.js +42 -33
  29. package/components/accordion/details.js +29 -17
  30. package/components/accordion/group.js +23 -23
  31. package/components/accordion/index.js +36 -27
  32. package/components/accordion/summary.js +10 -11
  33. package/components/alert/index.js +97 -91
  34. package/components/alert/notify.js +10 -8
  35. package/components/avatar/index.js +19 -17
  36. package/components/badge/index.js +122 -139
  37. package/components/button/icon.js +242 -334
  38. package/components/button/index.js +272 -427
  39. package/components/button/more.js +4 -5
  40. package/components/button/ripple-effect.js +4 -6
  41. package/components/card/body-card.js +4 -6
  42. package/components/card/card.js +4 -8
  43. package/components/card/index.js +4 -5
  44. package/components/chart/Pie/Sector.js +4 -5
  45. package/components/chart/Pie/Sectors.js +5 -5
  46. package/components/chart/Pie/index.js +8 -9
  47. package/components/chart/Pie-v2/Sector.js +4 -5
  48. package/components/chart/Pie-v2/Sectors.js +7 -8
  49. package/components/chart/Pie-v2/index.js +11 -16
  50. package/components/chart/bar/Bar.js +2 -3
  51. package/components/chart/bar/Labels.js +9 -11
  52. package/components/chart/bar/index.js +17 -9
  53. package/components/chart/bar-v2/Bar.js +2 -3
  54. package/components/chart/bar-v2/Labels.js +9 -11
  55. package/components/chart/bar-v2/index.js +17 -9
  56. package/components/chart/line/Labels.js +8 -10
  57. package/components/chart/line/Point.js +2 -3
  58. package/components/chart/line/index.js +17 -9
  59. package/components/chart/line-v2/Labels.js +8 -10
  60. package/components/chart/line-v2/Point.js +2 -3
  61. package/components/chart/line-v2/index.js +17 -9
  62. package/components/chip/attach.js +12 -16
  63. package/components/chip/index.js +8 -11
  64. package/components/collapse/index.js +4 -5
  65. package/components/divider/index.js +27 -14
  66. package/components/form-control/attachment/index.js +143 -87
  67. package/components/form-control/calendar/function.js +24 -23
  68. package/components/form-control/calendar/index.js +2 -4
  69. package/components/form-control/calendar/range.js +3 -4
  70. package/components/form-control/checkbox/index.js +85 -71
  71. package/components/form-control/control/index.js +4 -6
  72. package/components/form-control/date-picker/index-old.js +0 -2
  73. package/components/form-control/date-picker/index.js +39 -43
  74. package/components/form-control/date-range-picker/index.js +26 -28
  75. package/components/form-control/dropdown/index.js +173 -202
  76. package/components/form-control/dropdown-box/index.js +72 -49
  77. package/components/form-control/form-group/index.js +4 -5
  78. package/components/form-control/helper-text/index.js +4 -5
  79. package/components/form-control/input-base/index.js +28 -38
  80. package/components/form-control/label/index.js +23 -13
  81. package/components/form-control/money-input/index.js +6 -6
  82. package/components/form-control/number-input/index.js +12 -14
  83. package/components/form-control/phone-input/index.js +4 -5
  84. package/components/form-control/radio/index.js +7 -15
  85. package/components/form-control/text-input/index.js +14 -24
  86. package/components/form-control/time-picker/index.js +15 -26
  87. package/components/form-control/time-picker/swiper.js +2 -4
  88. package/components/form-control/toggle/index.js +22 -18
  89. package/components/form-view/helper-text.js +4 -5
  90. package/components/form-view/index.js +4 -5
  91. package/components/form-view/input.js +5 -7
  92. package/components/form-view/label.js +2 -6
  93. package/components/list/list-item-action.js +7 -8
  94. package/components/list/list-item-icon.js +4 -5
  95. package/components/list/list-item-text.js +4 -5
  96. package/components/list/list-item.js +4 -5
  97. package/components/list/list.js +4 -5
  98. package/components/list/sub-header.js +4 -5
  99. package/components/modal/body.js +4 -6
  100. package/components/modal/footer.js +4 -6
  101. package/components/modal/header.js +8 -14
  102. package/components/modal/index.js +4 -5
  103. package/components/modal/modal.js +6 -13
  104. package/components/others/extra/index.js +4 -8
  105. package/components/others/option-wrapper/index.js +57 -0
  106. package/components/others/scrollbar/index.js +4 -5
  107. package/components/paging/page-info.js +282 -231
  108. package/components/paging/page-selector.js +4 -7
  109. package/components/popover/index.js +6 -7
  110. package/components/popup/danger_popup.js +8 -18
  111. package/components/popup/index.js +26 -34
  112. package/components/popup/proposals_popup.js +9 -16
  113. package/components/popup/v2/danger-popup.js +4 -6
  114. package/components/popup/v2/index.js +116 -98
  115. package/components/popup/v2/info-popup.js +4 -6
  116. package/components/popup/v2/success-popup.js +4 -6
  117. package/components/popup/v2/warning-popup.js +4 -6
  118. package/components/popup/v2/yes-no-popup.js +4 -6
  119. package/components/progress/circular.js +17 -26
  120. package/components/progress/linear.js +11 -13
  121. package/components/rating/index.js +114 -233
  122. package/components/slider/slider-container.js +15 -10
  123. package/components/slider/slider-item.js +10 -12
  124. package/components/status/index.js +63 -57
  125. package/components/tab/tab-container.js +26 -24
  126. package/components/tab/tab-header.js +36 -27
  127. package/components/tab/tab-panel.js +32 -15
  128. package/components/tab/tab.js +79 -80
  129. package/components/tooltip/index.js +4 -4
  130. package/components/transfer/index.js +10 -11
  131. package/components/tree-view/css.js +2 -0
  132. package/components/tree-view/index.js +14 -13
  133. package/components/typography/index.js +6 -112
  134. package/css/styles.css +1 -1
  135. package/css/styles.css.map +1 -1
  136. package/global/index.js +2 -0
  137. package/icons/basic.js +1648 -959
  138. package/icons/effect.js +45 -103
  139. package/package.json +1 -1
  140. package/readme.md +66 -0
  141. package/styles/color-helper.js +7 -146
  142. package/styles/colors.js +6 -2
  143. package/styles/font.js +9 -0
  144. package/styles/general.js +100 -7
  145. package/styles/typography.js +25 -26
  146. package/theme/settings.js +9 -2
  147. package/theme/theme-provider.js +15 -7
  148. package/theme/with-styles.js +2 -4
  149. package/theme/with-theme.js +2 -4
  150. package/utils/isMobile.js +21 -0
  151. package/utils/renderHTML.js +4 -5
  152. package/utils/renderIcon.js +15 -11
  153. package/utils/updatePosition.js +2 -2
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -8,6 +6,7 @@ import PropTypes from 'prop-types';
8
6
  import { forwardRef, memo, useState, useEffect, useRef } from 'react';
9
7
  import theme from '../../../theme/settings';
10
8
  import { randomString } from '../../../utils';
9
+ import { typography } from '../../../styles/typography';
11
10
  const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
12
11
  id,
13
12
  disabled,
@@ -44,10 +43,6 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
44
43
  display: none;
45
44
  position: absolute;
46
45
  box-sizing: border-box;
47
- padding-left: 2.19rem;
48
- height: 1.57rem;
49
- line-height: 1.57rem;
50
- font-size: 16px;
51
46
  &:disabled + label {
52
47
  pointer-events: none;
53
48
  }
@@ -103,11 +98,7 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
103
98
  cursor: pointer;
104
99
  position: relative;
105
100
  padding-left: 2.19rem;
106
- line-height: 1.57rem;
107
- font-size: 1rem;
108
- font-size: 16px;
109
- font-weight: 500;
110
- font-family: ${theme.typography.fontFamily};
101
+ ${typography.paragraph1};
111
102
  margin-bottom: 0;
112
103
  transition: .28s ease;
113
104
  -o-transition: .28s ease;
@@ -191,12 +182,13 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
191
182
  }
192
183
  };
193
184
  }, [checked]);
194
- return jsx("div", _extends({
185
+ return jsx("div", {
195
186
  id: 'DGN-Core-Radio-' + (id || unique),
196
187
  css: formCheck,
197
188
  className: ['DGN-UI-Radio', disabled ? 'disabled' : '', className].join(' ').trim(),
198
- ref: ref
199
- }, props), jsx("input", _extends({}, inputProps, {
189
+ ref: ref,
190
+ ...props
191
+ }, jsx("input", { ...inputProps,
200
192
  disabled: disabled,
201
193
  ref: inputRef,
202
194
  name: name,
@@ -206,7 +198,7 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
206
198
  css: formCheckInput,
207
199
  id: id || unique,
208
200
  onChange: !!onChange ? handleChange : null
209
- })), jsx("label", {
201
+ }), jsx("label", {
210
202
  css: formCheckLabel,
211
203
  htmlFor: id || unique
212
204
  }, " ", label || value));
@@ -1,13 +1,10 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
6
4
  import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
7
5
  import PropTypes from 'prop-types';
8
6
  import { jsx, css } from '@emotion/core';
9
- import { CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
10
- import Icon from '../../../icons';
7
+ import { ButtonIcon, CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
11
8
  import { renderIcon, onValidate } from '../../../utils';
12
9
  const icons = {
13
10
  default: `<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -307,46 +304,39 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
307
304
  })) : /^(quick)?Edit/i.test(type) ? jsx("div", {
308
305
  ref: iconRef,
309
306
  css: TextInputIcon
310
- }, jsx(Icon, {
307
+ }, jsx(ButtonIcon, {
308
+ viewType: 'ghost',
311
309
  name: 'Edit',
312
310
  className: 'edit-icon-pen',
313
- width: 20,
314
- height: 20,
315
- style: {
316
- padding: 0
317
- },
318
311
  onClick: onClickQuickEdit
319
- }), jsx(Icon, {
312
+ }), jsx(ButtonIcon, {
313
+ viewType: 'ghost',
320
314
  name: 'Approval',
321
315
  className: 'edit-icon-confirm',
322
- width: 20,
323
- height: 20,
324
- style: {
325
- padding: 0
326
- },
327
316
  onClick: onConfirmEdit
328
317
  }), jsx("span", {
329
318
  className: 'circular'
330
319
  }, jsx(Circular, {
331
320
  width: 24,
332
321
  strokeWidth: 2
333
- })), jsx(Icon, {
322
+ })), jsx(ButtonIcon, {
323
+ viewType: 'ghost',
334
324
  name: 'Close',
335
325
  className: 'edit-icon-clear',
336
- width: 16,
337
- height: 16,
338
326
  onClick: onClear,
339
327
  onMouseDown: onMouseDownHandler
340
328
  })) : endIcon;
341
- return jsx("div", _extends({
329
+ return jsx("div", {
342
330
  ref: ref,
343
331
  css: TextInputRoot,
344
332
  className: ['DGN-UI-TextInput', className].join(' ').trim(),
345
- style: style
346
- }, props), !!label && jsx(Label, _extends({
333
+ style: style,
334
+ ...props
335
+ }, !!label && jsx(Label, {
347
336
  required: required,
348
- disabled: disabled
349
- }, labelProps), label), jsx(InputBase, {
337
+ disabled: disabled,
338
+ ...labelProps
339
+ }, label), jsx(InputBase, {
350
340
  type: /text|number|password/.test(type) ? type : 'text',
351
341
  autoComplete: autoComplete,
352
342
  inputRef: inputRef,
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -10,6 +8,7 @@ import { Cancel as CancelIcon, Clock as ClockIcon } from '../../../icons';
10
8
  import { randomString, useOnClickOutside } from '../../../utils';
11
9
  import theme from '../../../theme/settings';
12
10
  import Swiper from './swiper';
11
+ import { typography } from '../../../styles/typography';
13
12
 
14
13
  const formatDimension = x => {
15
14
  const regexPercent = /^\d+%$/;
@@ -140,7 +139,6 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
140
139
  outlined: css`
141
140
  * {
142
141
  box-sizing: border-box;
143
- font-family: ${theme.typography.fontFamily};
144
142
  }
145
143
  margin: 0;
146
144
  padding: 0;
@@ -210,16 +208,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
210
208
  margin-bottom: 4px;
211
209
  label {
212
210
  color: ${theme.colors.label};
213
- font-size: 12px;
214
- font-weight: 700;
211
+ ${typography.heading6};
215
212
  pointer-events: initial;
216
213
  user-select: initial;
217
214
  }
218
215
  `,
219
216
  required: css`
220
217
  color: ${theme.colors.danger};
221
- font-size: 12px;
222
- font-weight: bold;
218
+ ${typography.heading6};
223
219
  `
224
220
  },
225
221
  main: {
@@ -360,7 +356,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
360
356
  outlined: css`
361
357
  background-color: transparent;
362
358
  border: 0;
363
- font-size: 16px;
359
+ ${typography.paragraph1};
364
360
  margin: 0;
365
361
  outline: none;
366
362
  padding: 10px 16px;
@@ -375,8 +371,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
375
371
  underlined: css`
376
372
  background-color: white;
377
373
  border: 0;
378
- font-size: 16px;
379
- line-height: 20px;
374
+ ${typography.paragraph1};
380
375
  margin: auto 0;
381
376
  outline: none;
382
377
  padding: 0;
@@ -395,15 +390,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
395
390
  color: ${theme.colors.border};
396
391
  cursor: pointer;
397
392
  display: flex;
398
- font-size: 20px;
399
- height: 20px;
393
+ height: 24px;
400
394
  justify-content: center;
401
395
  position: absolute;
402
396
  top: 50%;
403
397
  right: 20px;
404
398
  transform: translateY(-50%);
405
399
  transition: opacity 0.2s ease, color 0.2s ease;
406
- width: 20px;
400
+ width: 24px;
407
401
  &.svg-active {
408
402
  opacity: 0;
409
403
  visibility: hidden;
@@ -417,15 +411,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
417
411
  color: ${theme.colors.border};
418
412
  cursor: pointer;
419
413
  display: flex;
420
- font-size: 20px;
421
- height: 20px;
414
+ height: 24px;
422
415
  justify-content: center;
423
416
  position: absolute;
424
417
  top: 50%;
425
418
  right: 6px;
426
419
  transform: translateY(-50%);
427
420
  transition: opacity 0.2s ease, color 0.2s ease;
428
- width: 20px;
421
+ width: 24px;
429
422
  &.svg-active {
430
423
  opacity: 0;
431
424
  visibility: hidden;
@@ -438,17 +431,13 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
438
431
  error: {
439
432
  outlined: css`
440
433
  color: ${theme.colors.danger};
441
- font-size: 12px;
442
- font-weight: 400;
443
- line-height: 12px;
434
+ ${typography.paragraph3};
444
435
  margin-top: 8px;
445
436
  pointer-events: none;
446
437
  `,
447
438
  underlined: css`
448
439
  color: ${theme.colors.danger};
449
- font-size: 12px;
450
- font-weight: 400;
451
- line-height: 12px;
440
+ ${typography.paragraph3};
452
441
  bottom: -20px;
453
442
  position: absolute;
454
443
  pointer-events: none;
@@ -699,7 +688,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
699
688
  id: IDs.label,
700
689
  htmlFor: IDs.inputTypeText
701
690
  }, label), RequireMemo), [label, required, error, disabled]);
702
- const InputMemo = useMemo(() => jsx("input", _extends({}, inputProps, {
691
+ const InputMemo = useMemo(() => jsx("input", { ...inputProps,
703
692
  css: styles.input[viewType],
704
693
  disabled: disabled,
705
694
  id: IDs.inputTypeText,
@@ -708,7 +697,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
708
697
  readOnly: true,
709
698
  ref: inputRef,
710
699
  type: 'text'
711
- })), [allowSeconds, disabled, viewType]);
700
+ }), [allowSeconds, disabled, viewType]);
712
701
  const IconMemo = useMemo(() => jsx(React.Fragment, null, jsx("span", {
713
702
  css: styles.icon[viewType],
714
703
  className: `${IDs.icon} svg-default`,
@@ -776,10 +765,10 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
776
765
  css: styles.main[viewType],
777
766
  ref: mainRef
778
767
  }, InputMemo, IconMemo, ErrorMemo), [activeHeight, activeWidth, allowSeconds, defaultValue, disabled, error, value, viewType]);
779
- return jsx("div", _extends({}, props, {
768
+ return jsx("div", { ...props,
780
769
  css: styles.container[viewType],
781
770
  ref: ref
782
- }), LabelMemo, MainMemo, ClockMemo);
771
+ }, LabelMemo, MainMemo, ClockMemo);
783
772
  }));
784
773
  TimePicker.defaultProps = {
785
774
  activeHeight: 200,
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -540,13 +538,13 @@ const Swiper = props => {
540
538
  select(value);
541
539
  }
542
540
  }, [value]);
543
- return jsx("div", _extends({}, other, {
541
+ return jsx("div", { ...other,
544
542
  className: IDs.container,
545
543
  css: styles.container,
546
544
  ref: containerRef,
547
545
  style: { ...containerStyle
548
546
  }
549
- }), jsx("ul", {
547
+ }, jsx("ul", {
550
548
  className: IDs.mainSelector,
551
549
  css: styles.mainSelector,
552
550
  ref: mainSelectorRef,
@@ -1,11 +1,9 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
6
4
  import { css, jsx } from '@emotion/core';
7
5
  import PropTypes from 'prop-types';
8
- import { forwardRef, memo, useEffect, useMemo, useRef } from 'react';
6
+ import { forwardRef, memo, useEffect, useMemo, useRef, useState } from 'react';
9
7
  import theme from '../../../theme/settings';
10
8
  import generateRandom from '../../../utils/randomString';
11
9
  import Typography from '../../typography';
@@ -28,6 +26,8 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
28
26
  inputRef = useRef(null);
29
27
  }
30
28
 
29
+ const [checkedState, setCheckedState] = useState(checked || defaultChecked);
30
+
31
31
  if (size === 'small') {
32
32
  height = 10;
33
33
  width = 20;
@@ -146,13 +146,10 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
146
146
  });
147
147
 
148
148
  const handleClick = () => {
149
- if (disabled) {
150
- return;
151
- }
152
-
153
- inputRef.current.checked = !inputRef.current.checked;
149
+ if (disabled) return;
150
+ setChecked(checked !== undefined ? checked : !checkedState);
154
151
  const e = {
155
- value: inputRef.current.checked,
152
+ value: !checkedState,
156
153
  target: inputRef.current
157
154
  };
158
155
  if (onChange) onChange(e);
@@ -171,22 +168,29 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
171
168
  }
172
169
  };
173
170
  }, [disabled, onChange]);
174
- useEffect(() => {
175
- if (typeof checked === 'boolean') {
176
- inputRef.current.checked = checked;
171
+
172
+ const setChecked = check => {
173
+ if (typeof check === 'boolean') {
174
+ setCheckedState(check);
177
175
  }
176
+ };
177
+
178
+ useEffect(() => {
179
+ if (checked !== undefined) setChecked(checked);
178
180
  }, [checked]);
179
- return useMemo(() => jsx("div", _extends({
181
+ return useMemo(() => jsx("div", {
180
182
  id: 'DGN-Core-Toggle-' + (id ? id : idDefault),
181
183
  css: formCheck,
182
- ref: ref
183
- }, props), jsx("input", _extends({}, inputProps, {
184
+ ref: ref,
185
+ ...props
186
+ }, jsx("input", { ...inputProps,
184
187
  ref: inputRef,
185
188
  hidden: true,
186
189
  type: "checkbox",
187
190
  css: checkbox,
188
- defaultChecked: defaultChecked || checked
189
- })), jsx("label", {
191
+ checked: checkedState,
192
+ onChange: handleClick
193
+ }), jsx("label", {
190
194
  css: toggle,
191
195
  onClick: handleClick
192
196
  }, jsx("span", {
@@ -197,7 +201,7 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
197
201
  marginBottom: 0
198
202
  },
199
203
  mapping: 'label'
200
- }, label))), [disabled, onChange]);
204
+ }, label))), [disabled, onChange, checkedState]);
201
205
  }));
202
206
  Toggle.defaultProps = {
203
207
  disabled: false,
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React, { memo } from 'react';
4
2
  import PropTypes from 'prop-types';
5
3
  import { Typography } from '../';
@@ -13,12 +11,13 @@ const HelperText = /*#__PURE__*/memo(({
13
11
  marginTop: 5,
14
12
  marginBottom: 5
15
13
  };
16
- return /*#__PURE__*/React.createElement(Typography, _extends({
14
+ return /*#__PURE__*/React.createElement(Typography, {
17
15
  type: 'p3',
18
16
  style: { ...helperText,
19
17
  ...style
20
- }
21
- }, props), text);
18
+ },
19
+ ...props
20
+ }, text);
22
21
  });
23
22
  HelperText.defaultProps = {
24
23
  text: ''
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -51,9 +49,10 @@ const FormLabel = ({
51
49
  utc: utc,
52
50
  thousandSeparator: thousandSeparator,
53
51
  thousandChar: thousandChar
54
- }), jsx(HelperText, _extends({
55
- text: text
56
- }, helperTextProps)));
52
+ }), jsx(HelperText, {
53
+ text: text,
54
+ ...helperTextProps
55
+ }));
57
56
  };
58
57
 
59
58
  FormLabel.defaultProps = {
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -7,7 +5,7 @@ import { jsx, css } from '@emotion/core';
7
5
  import PropTypes from 'prop-types';
8
6
  import { forwardRef, useRef, memo, useEffect, useMemo } from 'react';
9
7
  import { dark4 } from '../../styles/colors';
10
- import { fontFamily } from '../../styles/typography';
8
+ import { typography } from '../../styles/typography';
11
9
  import { formatDate } from '../../utils';
12
10
  const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
13
11
  inputProps,
@@ -29,7 +27,7 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
29
27
  flex: 1 1 auto;
30
28
  align-items: center;
31
29
  position: relative;
32
- font-family: ${fontFamily};
30
+ ${typography.paragraph1};
33
31
  padding-bottom: 6px;
34
32
  padding-top: 6px;
35
33
  &::before {
@@ -56,7 +54,7 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
56
54
  flex: 1 1 auto;
57
55
  align-items: center;
58
56
  position: relative;
59
- font-family: ${fontFamily};
57
+ ${typography.paragraph1};
60
58
  border: 1px solid ${dark4};
61
59
  border-radius: 4px;
62
60
  height: 40px;
@@ -107,11 +105,11 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
107
105
  inputRef.current.innerHTML = dateWithFormat(value);
108
106
  }
109
107
  }, [value]);
110
- return useMemo(() => jsx("span", _extends({}, inputProps, {
108
+ return useMemo(() => jsx("span", { ...inputProps,
111
109
  style: inputStyleProps,
112
110
  css: TextInput,
113
111
  ref: inputRef
114
- }), value));
112
+ }, value));
115
113
  }));
116
114
  InputView.defaultProps = {
117
115
  label: ''
@@ -5,7 +5,7 @@ import { jsx, css } from '@emotion/core';
5
5
  import PropTypes from 'prop-types';
6
6
  import { memo } from 'react';
7
7
  import { dark8 } from '../../styles/colors';
8
- import { fontFamily } from '../../styles/typography';
8
+ import { typography } from '../../styles/typography';
9
9
  const Label = /*#__PURE__*/memo(({
10
10
  label,
11
11
  labelProps
@@ -13,11 +13,7 @@ const Label = /*#__PURE__*/memo(({
13
13
  const labelText = css`
14
14
  display: block;
15
15
  color: ${dark8};
16
- font-family: ${fontFamily};
17
- font-style: normal;
18
- font-weight: 500;
19
- font-size: 12px;
20
- line-height: 16px;
16
+ ${typography.paragraph3};
21
17
  margin-bottom: 5px;
22
18
  `;
23
19
  return jsx("label", {
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -7,7 +5,7 @@ import { memo, useRef, forwardRef, useEffect, useMemo } from 'react';
7
5
  import PropTypes from 'prop-types';
8
6
  import { jsx, css } from '@emotion/core';
9
7
  import theme from '../../theme/settings';
10
- import Icon from '../../icons';
8
+ import { ButtonIcon } from '..';
11
9
  const ListItemAction = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
12
10
  children,
13
11
  name,
@@ -41,19 +39,20 @@ const ListItemAction = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
41
39
  let node = children;
42
40
 
43
41
  if (!node) {
44
- node = jsx(Icon, {
42
+ node = jsx(ButtonIcon, {
43
+ viewType: 'ghost',
45
44
  name: name,
46
- viewBox: true,
47
45
  onClick: onClick
48
46
  });
49
47
  }
50
48
 
51
- return jsx("div", _extends({
49
+ return jsx("div", {
52
50
  className: 'DGN-UI-List-Item-Action ' + className,
53
51
  css: ListItemActionRoot,
54
52
  ref: ref,
55
- style: style
56
- }, props), node);
53
+ style: style,
54
+ ...props
55
+ }, node);
57
56
  }, [children, name, style]);
58
57
  return ListItemActionView;
59
58
  }));
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -45,12 +43,13 @@ const ListItemIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
45
43
  }
46
44
  }
47
45
 
48
- return jsx("div", _extends({
46
+ return jsx("div", {
49
47
  css: ListItemIconRoot,
50
48
  className: 'DGN-UI-List-Item-Icon ' + className,
51
49
  ref: ref,
52
- style: style
53
- }, props), node);
50
+ style: style,
51
+ ...props
52
+ }, node);
54
53
  }, [children, name]);
55
54
  return ListItemIconView;
56
55
  }));
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -30,12 +28,13 @@ const ListItemText = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
30
28
  useEffect(() => {
31
29
  if (refs) refs(ref);
32
30
  }, []);
33
- const ListItemTextView = useMemo(() => jsx("div", _extends({
31
+ const ListItemTextView = useMemo(() => jsx("div", {
34
32
  css: ListItemTextRoot,
35
33
  className: 'DGN-UI-List-Item-Text ' + className,
36
34
  ref: ref,
37
- style: style
38
- }, props), jsx(Typography, null, children)), [children]);
35
+ style: style,
36
+ ...props
37
+ }, jsx(Typography, null, children)), [children]);
39
38
  return ListItemTextView;
40
39
  }));
41
40
  ListItemText.defaultProps = {
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -78,13 +76,14 @@ const ListItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
78
76
  }
79
77
  };
80
78
  }, [inset]);
81
- const ListItemView = useMemo(() => jsx("div", _extends({
79
+ const ListItemView = useMemo(() => jsx("div", {
82
80
  css: ListItemRoot,
83
81
  className: 'DGN-UI-List-Item ' + (onClick ? 'click-able ' : '') + className,
84
82
  ref: ref,
85
83
  onClick: onClick ? handleClick : null,
86
- style: style
87
- }, props), children, button && jsx(Ripple, {
84
+ style: style,
85
+ ...props
86
+ }, children, button && jsx(Ripple, {
88
87
  color: '#8F9BB3'
89
88
  })), [children, button, style]);
90
89
  return ListItemView;
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -110,11 +108,12 @@ const List = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
110
108
  }
111
109
  };
112
110
  }, [style]);
113
- const ListView = useMemo(() => jsx("div", _extends({
111
+ const ListView = useMemo(() => jsx("div", {
114
112
  css: ListRoot,
115
113
  ref: ref,
116
- className: ('DGN-UI-List ' + className).trim()
117
- }, props), children), [children]);
114
+ className: ('DGN-UI-List ' + className).trim(),
115
+ ...props
116
+ }, children), [children]);
118
117
  return ListView;
119
118
  }));
120
119
  List.defaultProps = {
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -34,11 +32,12 @@ const ListSubHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
34
32
  useEffect(() => {
35
33
  if (refs) refs(ref);
36
34
  }, []);
37
- const ListSubHeaderRootView = useMemo(() => jsx("div", _extends({
35
+ const ListSubHeaderRootView = useMemo(() => jsx("div", {
38
36
  css: ListSubHeaderRoot,
39
37
  ref: ref,
40
- style: style
41
- }, props), jsx(Typography, {
38
+ style: style,
39
+ ...props
40
+ }, jsx(Typography, {
42
41
  type: 'h4',
43
42
  color: theme.colors.disabled,
44
43
  style: {