diginet-core-ui 1.3.63 → 1.3.65-beta.1

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 (125) hide show
  1. package/assets/images/menu/dhr/MHRP39N0009.svg +2 -2
  2. package/assets/images/menu/dhr/MHRP39N0010.svg +6 -6
  3. package/assets/images/menu/dhr/MHRP39N0011.svg +6 -13
  4. package/assets/images/menu/dhr/MHRP39N0015.svg +4 -4
  5. package/assets/images/menu/dhr/MHRP89N1000.svg +4 -5
  6. package/assets/images/menu/dhr/MHRP89N1001.svg +4 -5
  7. package/assets/images/menu/dhr/W09F2000.svg +3 -5
  8. package/components/accordion/css.js +6 -6
  9. package/components/accordion/details.js +13 -18
  10. package/components/accordion/group.js +16 -17
  11. package/components/accordion/index.js +17 -22
  12. package/components/accordion/summary.js +55 -32
  13. package/components/avatar/index.js +4 -9
  14. package/components/badge/index.js +4 -9
  15. package/components/button/icon.js +7 -9
  16. package/components/button/index.js +275 -281
  17. package/components/button/more.js +16 -16
  18. package/components/button/ripple-effect.js +2 -0
  19. package/components/card/card.js +30 -28
  20. package/components/card/index.js +1 -0
  21. package/components/chart/Pie/Circle.js +2 -1
  22. package/components/chart/Pie-v2/Circle.js +4 -5
  23. package/components/chart/Pie-v2/Sector.js +19 -25
  24. package/components/chart/Pie-v2/Sectors.js +16 -15
  25. package/components/chart/Pie-v2/index.js +141 -16
  26. package/components/chart/bar/Bar.js +20 -18
  27. package/components/chart/bar/Labels.js +20 -18
  28. package/components/chart/bar/index.js +3 -2
  29. package/components/chart/bar-v2/Bar.js +23 -21
  30. package/components/chart/bar-v2/Labels.js +21 -19
  31. package/components/chart/bar-v2/index.js +3 -2
  32. package/components/chart/line/Labels.js +21 -18
  33. package/components/chart/line/Path.js +7 -6
  34. package/components/chart/line/Point.js +2 -0
  35. package/components/chart/line/Title.js +1 -2
  36. package/components/chart/line/index.js +22 -1
  37. package/components/chart/line-v2/Labels.js +21 -18
  38. package/components/chart/line-v2/Path.js +15 -14
  39. package/components/chart/line-v2/Point.js +4 -2
  40. package/components/chart/line-v2/Title.js +1 -2
  41. package/components/chart/line-v2/index.js +8 -7
  42. package/components/check-text/index.js +22 -21
  43. package/components/chip/attach.js +3 -3
  44. package/components/chip/index.js +1 -2
  45. package/components/form-control/attachment/index.js +5 -3
  46. package/components/form-control/calendar/function.js +20 -10
  47. package/components/form-control/calendar/index.js +1 -1
  48. package/components/form-control/calendar/range.js +33 -33
  49. package/components/form-control/checkbox/index.js +6 -6
  50. package/components/form-control/date-picker/index.js +2 -2
  51. package/components/form-control/dropdown/index.js +10 -9
  52. package/components/form-control/form/index.js +1 -0
  53. package/components/form-control/helper-text/index.js +8 -3
  54. package/components/form-control/input-base/index.js +47 -10
  55. package/components/form-control/label/index.js +67 -43
  56. package/components/form-control/money-input/index.js +6 -2
  57. package/components/form-control/number-input/index.js +5 -18
  58. package/components/form-control/number-input/index2.js +13 -4
  59. package/components/form-control/phone-input/index.js +18 -28
  60. package/components/form-control/text-input/index.js +22 -9
  61. package/components/form-control/time-picker/index.js +2 -1
  62. package/components/form-control/time-picker/swiper.js +80 -76
  63. package/components/form-view/helper-text.js +1 -0
  64. package/components/grid/Col.js +1 -1
  65. package/components/modal/index.js +1 -0
  66. package/components/others/extra/index.js +2 -0
  67. package/components/others/option-wrapper/index.js +21 -27
  68. package/components/others/scrollbar/index.js +25 -26
  69. package/components/paging/page-info.js +262 -88
  70. package/components/paging/page-selector2.js +95 -56
  71. package/components/popover/body.js +74 -0
  72. package/components/popover/footer.js +76 -0
  73. package/components/popover/header.js +79 -0
  74. package/components/popover/index.js +123 -88
  75. package/components/popup/danger_popup.js +3 -1
  76. package/components/popup/index.js +2 -2
  77. package/components/popup/proposals_popup.js +1 -0
  78. package/components/progress/circular.js +2 -0
  79. package/components/status/index.js +92 -89
  80. package/components/tooltip/index.js +53 -52
  81. package/components/transfer/index.js +83 -91
  82. package/components/tree-view/index.js +10 -6
  83. package/icons/effect.js +21 -28
  84. package/icons/general/clock/clock.js +1 -0
  85. package/icons/general/color-handler/background.js +1 -0
  86. package/icons/general/color-handler/text.js +1 -0
  87. package/icons/general/emoji/emoji.js +1 -0
  88. package/icons/general/font-properties/bold.js +1 -0
  89. package/icons/general/font-properties/font-family.js +1 -0
  90. package/icons/general/font-properties/font-size.js +1 -0
  91. package/icons/general/font-properties/italic.js +1 -0
  92. package/icons/general/font-properties/underline.js +1 -0
  93. package/icons/general/hyperlink/hyperlink.js +1 -0
  94. package/icons/general/indent/decrease.js +1 -0
  95. package/icons/general/indent/increase.js +1 -0
  96. package/icons/general/list/bullets.js +1 -0
  97. package/icons/general/list/numbering.js +1 -0
  98. package/icons/general/picture/picture.js +1 -0
  99. package/icons/general/steps/redo.js +1 -0
  100. package/icons/general/steps/undo.js +1 -0
  101. package/icons/general/text-align/center.js +1 -0
  102. package/icons/general/text-align/justify.js +1 -0
  103. package/icons/general/text-align/left.js +1 -0
  104. package/icons/general/text-align/right.js +1 -0
  105. package/icons/menu/dhr.js +2 -1
  106. package/icons/menu/erp.js +1 -0
  107. package/package.json +56 -31
  108. package/readme.md +10 -0
  109. package/styles/animation.js +2 -1
  110. package/styles/color-helper.js +5 -3
  111. package/styles/colors.js +11 -1
  112. package/styles/font.js +5 -4
  113. package/theme/index.js +1 -3
  114. package/theme/make-styles.js +25 -105
  115. package/theme/theme-provider.js +0 -9
  116. package/utils/console.js +0 -1
  117. package/utils/error/error.js +0 -1
  118. package/utils/index.js +0 -1
  119. package/utils/promisify.js +2 -1
  120. package/utils/renderIcon.js +8 -6
  121. package/utils/useInput.js +1 -8
  122. package/styles/media-queries.js +0 -10
  123. package/theme/with-styles.js +0 -15
  124. package/theme/with-theme.js +0 -9
  125. package/utils/number.js +0 -63
@@ -1,3 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M21 3.00006L3 10.5301V11.5101L9.84 14.1601L12.48 21.0001H13.46L21 3.00006Z" fill="#7F828E"/>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M39 0L0 16.315V18.4383L14.82 24.18L20.54 39H22.6633L39 0Z" fill="#FFAA00"/>
3
3
  </svg>
@@ -1,7 +1,7 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M16 9.50006C17.46 9.50006 18.78 10.0701 19.76 11.0001H21V9.00006H3V11.0001H12.24C13.22 10.0701 14.54 9.50006 16 9.50006Z" fill="#7F828E"/>
3
- <path d="M21 5.00006H3V7.00006H21V5.00006Z" fill="#7F828E"/>
4
- <path d="M10.88 17.0001H3V19.0001H12.24C11.65 18.4501 11.18 17.7701 10.88 17.0001Z" fill="#7F828E"/>
5
- <path d="M10.88 13.0001H3V15.0001H10.5C10.5 14.2901 10.64 13.6201 10.88 13.0001Z" fill="#7F828E"/>
6
- <path d="M19.43 17.0201C19.79 16.4301 20 15.7401 20 15.0001C20 12.7901 18.21 11.0001 16 11.0001C13.79 11.0001 12 12.7901 12 15.0001C12 17.2101 13.79 19.0001 16 19.0001C16.74 19.0001 17.43 18.7801 18.02 18.4301L20.59 21.0001L22 19.5901L19.43 17.0201ZM16 17.0001C14.9 17.0001 14 16.1001 14 15.0001C14 13.9001 14.9 13.0001 16 13.0001C17.1 13.0001 18 13.9001 18 15.0001C18 16.1001 17.1 17.0001 16 17.0001Z" fill="#7F828E"/>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M26.6842 15.0263C29.6811 15.0263 32.3906 16.1964 34.4021 18.1053H36.9474V14H0V18.1053H18.9663C20.9779 16.1964 23.6874 15.0263 26.6842 15.0263Z" fill="#2680EB"/>
3
+ <path d="M36.9474 5.78943H0V9.8947H36.9474V5.78943Z" fill="#2680EB"/>
4
+ <path d="M16.1748 30.4211H0V34.5264H18.9663C17.7553 33.3975 16.7905 32.0017 16.1748 30.4211Z" fill="#2680EB"/>
5
+ <path d="M16.1748 22.2106H0V26.3159H15.3948C15.3948 24.8585 15.6821 23.4833 16.1748 22.2106Z" fill="#2680EB"/>
6
+ <path d="M33.7247 30.4622C34.4637 29.2512 34.8947 27.8349 34.8947 26.3159C34.8947 21.7796 31.2205 18.1054 26.6842 18.1054C22.1479 18.1054 18.4737 21.7796 18.4737 26.3159C18.4737 30.8522 22.1479 34.5264 26.6842 34.5264C28.2032 34.5264 29.6195 34.0749 30.8305 33.3564L36.1058 38.6317L39 35.7375L33.7247 30.4622ZM26.6842 30.4212C24.4263 30.4212 22.5789 28.5738 22.5789 26.3159C22.5789 24.058 24.4263 22.2106 26.6842 22.2106C28.9421 22.2106 30.7895 24.058 30.7895 26.3159C30.7895 28.5738 28.9421 30.4212 26.6842 30.4212Z" fill="#2680EB"/>
7
7
  </svg>
@@ -1,14 +1,7 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0)">
3
- <path d="M16.08 11.5401H18.08V4.5401C18.08 3.4401 17.18 2.5401 16.08 2.5401H4.07996C2.97996 2.5401 2.07996 3.4401 2.07996 4.5401V16.5401C2.07996 17.6401 2.97996 18.5401 4.07996 18.5401H11.08V16.5401H4.07996V4.3201H16.08V11.5401Z" fill="#7F828E"/>
4
- <path d="M14.08 12.5401H6.07996V14.5401H14.08V12.5401Z" fill="#7F828E"/>
5
- <path d="M11.08 11.5401H14.08V9.5401H6.07996V11.5401H11.08Z" fill="#7F828E"/>
6
- <path d="M14.08 6.5401H6.07996V8.5401H14.08V6.5401Z" fill="#7F828E"/>
7
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.39 21.4601L11.92 17.9601L13.32 16.5501L15.39 18.6301L20.52 13.4601L21.92 14.8701L15.39 21.4601Z" fill="#7F828E"/>
8
- </g>
9
- <defs>
10
- <clipPath id="clip0">
11
- <rect width="24" height="24" fill="white"/>
12
- </clipPath>
13
- </defs>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M27.3858 19.5953H31.298V5.90247C31.298 3.75074 29.5375 1.99023 27.3858 1.99023H3.91224C1.76051 1.99023 0 3.75074 0 5.90247V29.3759C0 31.5276 1.76051 33.2882 3.91224 33.2882H17.6052V29.3759H3.91224V5.47213H27.3858V19.5953Z" fill="#1CA261"/>
3
+ <path d="M23.4736 21.5514H7.82455V25.4637H23.4736V21.5514Z" fill="#1CA261"/>
4
+ <path d="M23.4736 19.5953V15.6831H7.82455V19.5953H23.4736Z" fill="#1CA261"/>
5
+ <path d="M23.4736 9.81473H7.82455V13.727H23.4736V9.81473Z" fill="#1CA261"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M26.0363 39L19.2485 32.1536L21.9871 29.3954L26.0363 33.4642L36.0712 23.351L38.8097 26.1092L26.0363 39Z" fill="#1CA261"/>
14
7
  </svg>
@@ -1,5 +1,5 @@
1
- <svg width="22" height="19" viewBox="0 0 22 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M16.7895 17.135L20.0096 19L19.1551 15.485L22 13.12L18.2536 12.815L16.7895 9.5L15.3253 12.815L11.5789 13.12L14.4239 15.485L13.5694 19L16.7895 17.135Z" fill="#7F828E"/>
3
- <path d="M9.26316 9.5C11.8221 9.5 13.8947 7.37438 13.8947 4.75C13.8947 2.12562 11.8221 0 9.26316 0C6.70421 0 4.63158 2.12562 4.63158 4.75C4.63158 7.37438 6.70421 9.5 9.26316 9.5Z" fill="#7F828E"/>
4
- <path d="M6.69907 12.1373C3.61621 12.7076 0 14.2071 0 16.625V19H11.2779L11.896 16.4575L6.69907 12.1373Z" fill="#7F828E"/>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M29.7632 35.7608L35.4715 39L33.9567 32.895L39 28.7874L32.3587 28.2576L29.7632 22.5L27.1676 28.2576L20.5263 28.7874L25.5696 32.895L24.0548 39L29.7632 35.7608Z" fill="#FF8C00"/>
3
+ <path d="M16.4211 22.5C20.9574 22.5 24.6316 18.8081 24.6316 14.25C24.6316 9.69187 20.9574 6 16.4211 6C11.8847 6 8.21053 9.69187 8.21053 14.25C8.21053 18.8081 11.8847 22.5 16.4211 22.5Z" fill="#FF8C00"/>
4
+ <path d="M11.8756 27.0805C6.41056 28.0711 0 30.6754 0 34.875V39H19.9926L21.0884 34.584L11.8756 27.0805Z" fill="#FF8C00"/>
5
5
  </svg>
@@ -1,6 +1,5 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
- <g id="Group_4" data-name="Group 4" transform="translate(-904.173 -528.063)">
3
- <rect id="Rectangle_2" data-name="Rectangle 2" width="24" height="24" transform="translate(904.173 528.063)" fill="none"/>
4
- <path id="Path_1" data-name="Path 1" d="M-14.66-100.938v20a10.017,10.017,0,0,1-9-10A10.017,10.017,0,0,1-14.66-100.938Zm2.03,0v8.99h8.97A10.044,10.044,0,0,0-12.63-100.938Zm0,11.011v8.989a10.034,10.034,0,0,0,8.97-8.989Z" transform="translate(929.832 631)"/>
5
- </g>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M17.55 0V39C7.66 38.03 0 29.66 0 19.5C0 9.34 7.66 0.98 17.55 0Z" fill="#1CA261"/>
3
+ <path d="M21.5098 0V17.53H38.9998C38.0798 8.29 30.7298 0.92 21.5098 0Z" fill="#FF8C00"/>
4
+ <path d="M21.5098 21.47V39C30.7498 38.08 38.0898 30.71 38.9998 21.47H21.5098Z" fill="#FF4444"/>
6
5
  </svg>
@@ -1,6 +1,5 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
- <g id="Group_4" data-name="Group 4" transform="translate(-904.173 -528.063)">
3
- <rect id="Rectangle_2" data-name="Rectangle 2" width="24" height="24" transform="translate(904.173 528.063)" fill="none"/>
4
- <path id="Path_1" data-name="Path 1" d="M-14.66-100.938v20a10.017,10.017,0,0,1-9-10A10.017,10.017,0,0,1-14.66-100.938Zm2.03,0v8.99h8.97A10.044,10.044,0,0,0-12.63-100.938Zm0,11.011v8.989a10.034,10.034,0,0,0,8.97-8.989Z" transform="translate(929.832 631)"/>
5
- </g>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M17.55 0V39C7.66 38.03 0 29.66 0 19.5C0 9.34 7.66 0.98 17.55 0Z" fill="#1CA261"/>
3
+ <path d="M21.5098 0V17.53H38.9998C38.0798 8.29 30.7298 0.92 21.5098 0Z" fill="#FF8C00"/>
4
+ <path d="M21.5098 21.47V39C30.7498 38.08 38.0898 30.71 38.9998 21.47H21.5098Z" fill="#FF4444"/>
6
5
  </svg>
@@ -1,6 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="26.293" height="24.102" viewBox="0 0 26.293 24.102">
2
- <g id="hosonhanvien_mss" transform="translate(0 -2.5)">
3
- <path id="Path_3972" data-name="Path 3972" d="M17.973,21.295,13.787,19.2a1.153,1.153,0,0,1-.64-1.036V16.684c.1-.123.206-.262.315-.417a10.029,10.029,0,0,0,1.294-2.541,1.739,1.739,0,0,0,1.02-1.585V10.388a1.748,1.748,0,0,0-.438-1.15V6.907a3.928,3.928,0,0,0-.917-2.859A5.516,5.516,0,0,0,10.079,2.5,5.517,5.517,0,0,0,5.737,4.047,3.929,3.929,0,0,0,4.82,6.906V9.237a1.748,1.748,0,0,0-.438,1.15V12.14A1.743,1.743,0,0,0,5.038,13.5a9.2,9.2,0,0,0,1.535,3.171v1.45a1.158,1.158,0,0,1-.6,1.017L2.06,21.273A3.953,3.953,0,0,0,0,24.745V26.6H20.158V24.83A3.932,3.932,0,0,0,17.973,21.295Z" transform="translate(0)" fill="#707070"/>
4
- <path id="Path_3973" data-name="Path 3973" d="M42,24.679l-4.261-1.845a.868.868,0,0,1-.308-.338l2.859,0s.165.016.422.016a4.6,4.6,0,0,0,1.753-.31,1.3,1.3,0,0,0,.545-1.941c-.817-1.163-2.725-4.2-2.784-7.284,0-.053-.174-5.295-5.351-5.337a6.5,6.5,0,0,0-1.478.181,4.734,4.734,0,0,1,.291,2.005V11.9a2.394,2.394,0,0,1,.438,1.376v1.753a2.409,2.409,0,0,1-1.142,2.043,10.651,10.651,0,0,1-1.292,2.463q-.1.14-.194.265v1.253a.492.492,0,0,0,.277.448l4.186,2.093a4.585,4.585,0,0,1,2.548,4.124v1.773h5.478v-1.62A3.543,3.543,0,0,0,42,24.679Z" transform="translate(-17.696 -2.886)" fill="#707070"/>
5
- </g>
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M36.1201 27.93L29.9501 25.26C29.7601 25.14 29.6101 24.97 29.5001 24.77H33.6401C33.6401 24.77 33.8801 24.79 34.2501 24.79C35.1201 24.81 35.9801 24.65 36.7901 24.34C37.7401 23.92 38.1801 22.81 37.7601 21.86C37.7101 21.75 37.6501 21.64 37.5801 21.53C36.4001 19.84 33.6301 15.44 33.5501 10.98C33.5501 10.9 33.3001 3.32 25.8001 3.25C25.7101 3.25 25.6301 3.26 25.5401 3.27C25.4501 3.27 25.3701 3.25 25.2801 3.25C25.2301 3.25 25.1801 3.26 25.1301 3.26C25.6001 4.4 25.8001 5.62 25.7101 6.87V9.75C26.1501 10.47 26.3801 11.31 26.3901 12.16V14.87C26.3901 16.39 25.6501 17.8 24.4501 18.67C23.9401 19.99 23.2701 21.24 22.4501 22.4C22.4101 22.46 22.3701 22.51 22.3301 22.57V24.05L28.6801 27.22C31.4501 28.6 33.1701 31.38 33.1601 34.48V38.98H39.0001V32.53C39.0001 30.58 37.8901 28.79 36.1201 27.93Z" fill="#6AD2FF"/>
3
+ <path d="M27.78 29.03L21.31 25.8C20.7 25.5 20.32 24.88 20.32 24.2V21.9C20.47 21.71 20.64 21.49 20.8 21.26C21.65 20.05 22.32 18.73 22.8 17.33C23.76 16.89 24.38 15.94 24.38 14.88V12.18C24.38 11.53 24.14 10.89 23.7 10.4V6.8C23.83 5.2 23.32 3.61 22.29 2.38C20.9 0.8 18.64 0 15.58 0C12.52 0 10.26 0.8 8.87 2.39C7.83 3.62 7.32 5.2 7.45 6.81V10.41C7.02 10.9 6.78 11.53 6.77 12.19V14.89C6.77 15.71 7.14 16.48 7.78 16.99C8.25 18.76 9.05 20.42 10.15 21.89V24.13C10.15 24.78 9.79 25.39 9.22 25.7L3.18 28.99C1.22 30.06 0 32.12 0 34.35V39H31.16V34.49C31.17 32.17 29.86 30.05 27.78 29.03Z" fill="#199FFF"/>
6
4
  </svg>
@@ -1,6 +1,6 @@
1
1
  import { css } from '@emotion/core';
2
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';
3
+ import { alignCenter, backgroundTransparent, borderBox, borderRadius4px, breakWord, cursorPointer, displayInlineBlock, flexRow, flexRowReverse, inlineFlex, justifyBetween, justifyCenter, justifyEnd, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../styles/general';
4
4
  const {
5
5
  colors: {
6
6
  system: {
@@ -24,13 +24,13 @@ export const SummaryRootCSS = background => css`
24
24
  ${flexRow};
25
25
  ${positionRelative};
26
26
  ${justifyBetween};
27
- ${alignStart};
27
+ ${alignCenter};
28
28
  ${cursorPointer};
29
29
  ${borderBox};
30
30
  ${borderRadius4px};
31
31
  width: 100%;
32
32
  min-height: 56px;
33
- padding: ${spacing(4)}px ${spacing(6)}px;
33
+ padding: ${spacing([4, 6])};
34
34
  ${background && `background-color: ${background === true ? headerbar : theme.colors[background] || background};`};
35
35
  .Accordion-Expand-Icon,
36
36
  .Accordion-Collapse-Icon {
@@ -61,7 +61,7 @@ export const SummaryRootCSS = background => css`
61
61
  ${flexRowReverse};
62
62
  ${justifyEnd};
63
63
  .Accordion-Icon.rotate-able {
64
- margin-right: ${spacing(2)}px;
64
+ margin-right: ${spacing([2])};
65
65
  &.TreeView {
66
66
  transform: rotateZ(-90deg);
67
67
  }
@@ -69,7 +69,7 @@ export const SummaryRootCSS = background => css`
69
69
  }
70
70
  &.end {
71
71
  .Accordion-Icon.rotate-able {
72
- margin-left: ${spacing(2)}px;
72
+ margin-left: ${spacing([2])};
73
73
  &.TreeView {
74
74
  transform: rotateZ(90deg);
75
75
  }
@@ -131,10 +131,10 @@ export const SummaryRootCSS = background => css`
131
131
  ${heading3};
132
132
  ${flexRow};
133
133
  ${positionRelative};
134
- ${alignCenter};
135
134
  ${breakWord};
136
135
  ${userSelectNone};
137
136
  ${borderBox}
137
+ ${alignCenter};
138
138
  color: ${active};
139
139
  width: 100%;
140
140
  min-height: 24px;
@@ -20,19 +20,14 @@ const {
20
20
  const AccordionDetails = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
21
21
  children,
22
22
  className,
23
- style,
24
- id
23
+ id,
24
+ style
25
25
  }, reference) => {
26
26
  const ref = useRef(null);
27
- useImperativeHandle(reference, () => {
28
- const currentRef = ref.current || {};
29
- const _instance = {}; // methods
30
-
31
- _instance.__proto__ = {}; // hidden methods
32
-
33
- currentRef.instance = _instance;
34
- return currentRef;
35
- });
27
+ useImperativeHandle(reference, () => ({
28
+ element: ref.current,
29
+ instance: {}
30
+ }));
36
31
  return useMemo(() => {
37
32
  return jsx("div", {
38
33
  css: DetailsRootCSS,
@@ -54,7 +49,7 @@ const DetailsRootCSS = css`
54
49
  .DGN-UI-Accordion-Details-Content {
55
50
  ${borderBox};
56
51
  ${paragraph1};
57
- padding: 0 ${spacing(6)}px ${spacing(4)}px ${spacing(6)}px;
52
+ padding: ${spacing([0, 6, 4, 6])};
58
53
  color: ${main};
59
54
  &.disabled {
60
55
  ${pointerEventsNone}
@@ -64,17 +59,17 @@ const DetailsRootCSS = css`
64
59
  `;
65
60
  AccordionDetails.defaultProps = {
66
61
  className: '',
67
- style: {},
68
- id: ''
62
+ id: '',
63
+ style: {}
69
64
  };
70
65
  AccordionDetails.propTypes = {
71
66
  /** The content of the component. */
72
67
  children: PropTypes.node,
73
68
 
74
- /** Style inline of component. */
75
- style: PropTypes.object,
76
-
77
69
  /** Class for component. */
78
- className: PropTypes.string
70
+ className: PropTypes.string,
71
+
72
+ /** Style inline of component. */
73
+ style: PropTypes.object
79
74
  };
80
75
  export default AccordionDetails;
@@ -5,9 +5,13 @@ import { memo, useRef, forwardRef, Children, cloneElement, useMemo, useImperativ
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import { borderRadius4px } from '../../styles/general';
8
+ import theme from '../../theme/settings';
9
+ const {
10
+ spacing
11
+ } = theme;
8
12
  const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
9
- className,
10
13
  children,
14
+ className,
11
15
  collapseOther,
12
16
  style
13
17
  }, reference) => {
@@ -26,15 +30,10 @@ const AccordionGroup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
26
30
  }
27
31
  };
28
32
 
29
- useImperativeHandle(reference, () => {
30
- const currentRef = ref.current || {};
31
- const _instance = {}; // methods
32
-
33
- _instance.__proto__ = {}; // hidden methods
34
-
35
- currentRef.instance = _instance;
36
- return currentRef;
37
- });
33
+ useImperativeHandle(reference, () => ({
34
+ element: ref.current,
35
+ instance: {}
36
+ }));
38
37
  return useMemo(() => {
39
38
  return jsx("div", {
40
39
  css: AccordionGroupRootCSS,
@@ -56,7 +55,7 @@ const AccordionGroupRootCSS = css`
56
55
  }
57
56
  &.expanding {
58
57
  ${borderRadius4px};
59
- margin: 0 0 16px 0;
58
+ margin: ${spacing([0, 0, 4, 0])};
60
59
  .DGN-UI-Divider {
61
60
  display: none !important;
62
61
  }
@@ -69,7 +68,7 @@ const AccordionGroupRootCSS = css`
69
68
  }
70
69
  &.expanding {
71
70
  ${borderRadius4px};
72
- margin: 16px 0 0 0;
71
+ margin: ${spacing([4, 0, 0, 0])};
73
72
  .DGN-UI-Accordion-Summary {
74
73
  border-radius: 4px 4px 0px 0px;
75
74
  }
@@ -85,7 +84,7 @@ const AccordionGroupRootCSS = css`
85
84
  }
86
85
  &.expanding {
87
86
  ${borderRadius4px};
88
- margin: 16px 0;
87
+ margin: ${spacing([4, 0])};
89
88
  .DGN-UI-Accordion-Summary {
90
89
  border-radius: 4px 4px 0px 0px;
91
90
  }
@@ -116,13 +115,13 @@ AccordionGroup.propTypes = {
116
115
  /** The content of the component. */
117
116
  children: PropTypes.node,
118
117
 
119
- /** Style inline of component. */
120
- style: PropTypes.object,
121
-
122
118
  /** Class for component. */
123
119
  className: PropTypes.string,
124
120
 
125
121
  /** If `true`, collapse other when expand */
126
- collapseOther: PropTypes.bool
122
+ collapseOther: PropTypes.bool,
123
+
124
+ /** Style inline of component. */
125
+ style: PropTypes.object
127
126
  };
128
127
  export default AccordionGroup;
@@ -16,16 +16,16 @@ const {
16
16
  }
17
17
  } = theme;
18
18
  const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
19
- id,
19
+ boxShadow,
20
+ children,
21
+ className,
20
22
  disabled,
21
23
  expand,
22
24
  expanded,
25
+ id,
23
26
  onClick,
24
- onExpand,
25
27
  onCollapse,
26
- boxShadow,
27
- className,
28
- children,
28
+ onExpand,
29
29
  style
30
30
  }, reference) => {
31
31
  const ref = useRef(null);
@@ -49,22 +49,17 @@ const Accordion = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
49
49
  });
50
50
  };
51
51
 
52
- useImperativeHandle(reference, () => {
53
- const currentRef = ref.current || {};
54
- const _instance = {}; // methods
55
-
56
- _instance.__proto__ = {}; // hidden methods
57
-
58
- currentRef.instance = _instance;
59
- return currentRef;
60
- });
52
+ useImperativeHandle(reference, () => ({
53
+ element: ref.current,
54
+ instance: {}
55
+ }));
61
56
  return useMemo(() => {
62
57
  return jsx("div", {
63
58
  id: id,
64
59
  css: AccordionRootCSS,
65
60
  ref: ref,
66
61
  style: style,
67
- className: ['DGN-UI-Accordion', disabled ? 'disabled' : '', className, boxShadow === true ? 'boxShadow' : '', expandState ? 'expanding' : ''].join(' ').trim().replace(/\s+/g, ' ')
62
+ className: ['DGN-UI-Accordion', disabled ? 'disabled' : '', boxShadow === true ? 'boxShadow' : '', expandState ? 'expanding' : '', className].join(' ').trim().replace(/\s+/g, ' ')
68
63
  }, jsx(AccordionContext.Provider, {
69
64
  value: {
70
65
  expanded,
@@ -106,12 +101,12 @@ Accordion.defaultProps = {
106
101
  style: {}
107
102
  };
108
103
  Accordion.propTypes = {
104
+ /** The box-shadow of component. */
105
+ boxShadow: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
106
+
109
107
  /** The content of the component (insist <AccordionSummary />, <AccordionDetails />). */
110
108
  children: PropTypes.node,
111
109
 
112
- /** Style inline of component. */
113
- style: PropTypes.object,
114
-
115
110
  /** Class for component. */
116
111
  className: PropTypes.string,
117
112
 
@@ -124,13 +119,13 @@ Accordion.propTypes = {
124
119
  /** Expand state of accordion (should use this). */
125
120
  expanded: PropTypes.bool,
126
121
 
127
- /** The box-shadow of component. */
128
- boxShadow: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
122
+ /** Callback fired when Accordion is collapsed. */
123
+ onCollapse: PropTypes.func,
129
124
 
130
125
  /** Callback fired when Accordion is expanded. */
131
126
  onExpand: PropTypes.func,
132
127
 
133
- /** Callback fired when Accordion is collapsed. */
134
- onCollapse: PropTypes.func
128
+ /** Style inline of component. */
129
+ style: PropTypes.object
135
130
  };
136
131
  export default Accordion;
@@ -4,20 +4,31 @@
4
4
  import { memo, useEffect, useRef, useContext, forwardRef, useMemo, useImperativeHandle } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx } from '@emotion/core';
7
- import { renderIcon } from '../../utils';
8
7
  import { SummaryRootCSS } from './css';
9
8
  import AccordionContext from './context';
9
+ import { ButtonIcon, Typography } from '..';
10
+ import theme from '../../theme/settings';
11
+ const {
12
+ colors: {
13
+ system: {
14
+ active,
15
+ disabled: systemDisabled
16
+ }
17
+ },
18
+ spacing
19
+ } = theme;
10
20
  const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
11
- id,
12
- expandIcon,
13
- collapseIcon,
14
- expandIconAt,
15
21
  background,
16
- className,
17
- onClick,
18
22
  children,
23
+ className,
24
+ collapseIcon,
25
+ expandIcon,
26
+ expandIconAt,
19
27
  expandIconProps,
20
- style
28
+ id,
29
+ onClick,
30
+ style,
31
+ title
21
32
  }, reference) => {
22
33
  const {
23
34
  expanded,
@@ -102,15 +113,10 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
102
113
  showHideDetailHandler('hide');
103
114
  }
104
115
  }, [expandState]);
105
- useImperativeHandle(reference, () => {
106
- const currentRef = ref.current || {};
107
- const _instance = {}; // methods
108
-
109
- _instance.__proto__ = {}; // hidden methods
110
-
111
- currentRef.instance = _instance;
112
- return currentRef;
113
- });
116
+ useImperativeHandle(reference, () => ({
117
+ element: ref.current,
118
+ instance: {}
119
+ }));
114
120
  return useMemo(() => {
115
121
  return jsx("div", {
116
122
  id: id,
@@ -122,16 +128,27 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
122
128
  className: ['DGN-UI-Accordion-Summary', disabled ? 'disabled' : '', expandIcon ? expandIconAt : '', expandState ? 'expanding' : '', className].join(' ').trim().replace(/\s+/g, ' ')
123
129
  }, jsx("div", {
124
130
  className: 'DGN-UI-Accordion-Summary-Content'
125
- }, children), !!expandIcon && jsx("div", {
131
+ }, jsx(Typography, {
132
+ type: 'h3',
133
+ lineClamp: 2,
134
+ color: disabled ? systemDisabled : active,
135
+ style: {
136
+ marginRight: children && title ? spacing([4]) : 0
137
+ }
138
+ }, title || ''), children), !!expandIcon && jsx("div", {
126
139
  className: 'Accordion-Icon-Root'
127
140
  }, jsx("div", { ...expandIconProps,
128
141
  ref: expandIconRef,
129
142
  className: ['Accordion-Icon', collapseIcon ? '' : 'rotate-able', expandIconProps.className ? expandIconProps.className : ''].join(' ').trim().replace(/\s+/g, ' ')
130
- }, typeof expandIcon === 'string' ? renderIcon(expandIcon, 'effect', {
143
+ }, typeof expandIcon === 'string' ? jsx(ButtonIcon, {
144
+ viewType: 'ghost',
145
+ name: expandIcon,
131
146
  className: 'Accordion-Expand-Icon'
132
147
  }) : jsx("span", {
133
148
  className: 'Accordion-Expand-Icon effect'
134
- }, expandIcon), !!collapseIcon && (typeof collapseIcon === 'string' ? renderIcon(collapseIcon, 'effect', {
149
+ }, expandIcon), !!collapseIcon && (typeof collapseIcon === 'string' ? jsx(ButtonIcon, {
150
+ viewType: 'ghost',
151
+ name: collapseIcon,
135
152
  className: 'Accordion-Collapse-Icon'
136
153
  }) : jsx("span", {
137
154
  className: 'Accordion-Collapse-Icon effect'
@@ -139,35 +156,41 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
139
156
  }, [id, expandIcon, expandIconAt, className, background, children, collapseIcon, expandIconProps, style, expandState, disabled]);
140
157
  }));
141
158
  AccordionSummary.defaultProps = {
142
- expandIconAt: 'start',
143
- expandIconProps: {},
144
159
  className: '',
145
160
  expandIcon: 'ArrowRight',
161
+ expandIconAt: 'start',
162
+ expandIconProps: {},
146
163
  style: {}
147
164
  };
148
165
  AccordionSummary.propTypes = {
166
+ /** Background for label summary. */
167
+ background: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
168
+
149
169
  /** The content of the component. */
150
170
  children: PropTypes.node,
151
171
 
152
- /** Style inline of component. */
153
- style: PropTypes.object,
154
-
155
172
  /** Class for component. */
156
173
  className: PropTypes.string,
157
174
 
158
- /** Icon display for expand icon. */
159
- expandIcon: PropTypes.any,
160
-
161
175
  /** Icon display for collapse icon. */
162
176
  collapseIcon: PropTypes.any,
163
177
 
178
+ /** Icon display for expand icon. */
179
+ expandIcon: PropTypes.any,
180
+
164
181
  /** Position to render icon. */
165
182
  expandIconAt: PropTypes.oneOf(['start', 'end']),
166
183
 
167
- /** Background for label summary. */
168
- background: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
169
-
170
184
  /** Other props of icons. */
171
- expandIconProps: PropTypes.any
185
+ expandIconProps: PropTypes.any,
186
+
187
+ /** Callback fired when the component is clicked. */
188
+ onClick: PropTypes.func,
189
+
190
+ /** Style inline of component. */
191
+ style: PropTypes.object,
192
+
193
+ /** The title of the component. */
194
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
172
195
  };
173
196
  export default AccordionSummary;
@@ -241,15 +241,10 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
241
241
  }
242
242
  }
243
243
  }, [src]);
244
- useImperativeHandle(reference, () => {
245
- const currentRef = ref.current || {};
246
- const _instance = {}; // methods
247
-
248
- _instance.__proto__ = {}; // hidden methods
249
-
250
- currentRef.instance = _instance;
251
- return currentRef;
252
- });
244
+ useImperativeHandle(reference, () => ({
245
+ element: ref.current,
246
+ instance: {}
247
+ }));
253
248
  return useMemo(() => {
254
249
  return jsx(Fragment, null, jsx("div", {
255
250
  css: _AvatarContainerCSS,
@@ -98,15 +98,10 @@ const Badge = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
98
98
 
99
99
  const _BadgeRootCSS = BadgeRootCSS(children, name, dotPos, _BadgeNumberCSS);
100
100
 
101
- useImperativeHandle(reference, () => {
102
- const currentRef = ref.current || {};
103
- const _instance = {}; // methods
104
-
105
- _instance.__proto__ = {}; // hidden methods
106
-
107
- currentRef.instance = _instance;
108
- return currentRef;
109
- });
101
+ useImperativeHandle(reference, () => ({
102
+ element: ref.current,
103
+ instance: {}
104
+ }));
110
105
  return useMemo(() => {
111
106
  let node = children;
112
107
 
@@ -104,15 +104,10 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
104
104
 
105
105
  const _ButtonRootCSS = ButtonRootCSS(circular, size, width, _width, height, _height, buttonSize, iconSize, colorHover, color, _color, name);
106
106
 
107
- useImperativeHandle(reference, () => {
108
- const currentRef = ref.current || {};
109
- const _instance = {}; // methods
110
-
111
- _instance.__proto__ = {}; // hidden methods
112
-
113
- currentRef.instance = _instance;
114
- return currentRef;
115
- });
107
+ useImperativeHandle(reference, () => ({
108
+ element: ref.current,
109
+ instance: {}
110
+ }));
116
111
 
117
112
  const _onClick = event => {
118
113
  event.persist();
@@ -367,6 +362,9 @@ ButtonIcon.propTypes = {
367
362
  /** If `true`, the loading indicator is shown. */
368
363
  loading: PropTypes.bool,
369
364
 
365
+ /** Callback fired when the component is clicked. */
366
+ onClick: PropTypes.func,
367
+
370
368
  /** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
371
369
  name: PropTypes.string,
372
370