diginet-core-ui 1.3.56 → 1.3.58

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,13 @@
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M30.85 17.94V9.33C30.85 9.12 30.76 8.9 30.62 8.74L22.1 0.23C21.93 0.09 21.72 0 21.51 0H6.6C4.97 0 3.63 1.33 3.63 2.95V3.16H2.95C1.33 3.16 0 4.49 0 6.12V36.04C0 37.66 1.33 39 2.95 39H24.26C25.89 39 27.21 37.66 27.21 36.04V35.83H27.89C29.53 35.83 30.85 34.5 30.85 32.87V31.4H29.19V32.87C29.19 33.59 28.61 34.17 27.89 34.17H6.6C5.89 34.17 5.3 33.59 5.3 32.87V2.95C5.3 2.24 5.89 1.66 6.6 1.66H20.67V7.2C20.67 7.52 20.72 7.83 20.82 8.12C21.11 9.03 21.83 9.74 22.74 10.04H22.75C23.03 10.12 23.33 10.17 23.63 10.17H27.43L28.95 10.16H29.19V17.94H30.85ZM6.6 35.83H25.55V36.04C25.55 36.75 24.97 37.33 24.26 37.33H2.95C2.25 37.33 1.67 36.75 1.67 36.04V6.12C1.67 5.4 2.25 4.82 2.95 4.82H3.63V32.87C3.63 34.5 4.97 35.83 6.6 35.83Z" fill="#2680EB"/>
3
+ <path d="M25.3298 22.8899L24.6498 25.2699H26.0398L25.3598 22.8899H25.3298Z" fill="#FF8C00"/>
4
+ <path d="M37.0798 18.9399H16.1998C15.1398 18.9399 14.2798 19.7999 14.2798 20.8599V28.4799C14.2798 29.5399 15.1398 30.3999 16.1998 30.3999H37.0798C38.1398 30.3999 38.9998 29.5399 38.9998 28.4799V20.8599C38.9998 19.7999 38.1398 18.9399 37.0798 18.9399ZM20.3798 27.7499L19.3298 25.5899H18.5398V27.7499H16.9898V21.5799H19.5998C21.1198 21.5799 21.9398 22.3399 21.9398 23.6099C21.9398 24.3699 21.5598 25.0599 20.8998 25.3499L22.1198 27.7399H20.3798V27.7499ZM26.7298 27.7499L26.3498 26.3999H24.3598L23.9698 27.7499H22.3898L24.4398 21.5799H26.3398L28.3898 27.7499H26.7298ZM34.6898 27.7499H33.2298L32.1998 23.8999H32.1698L31.1398 27.7499H29.6798L28.0898 21.5799H29.6898L30.5098 25.7499H30.5398L31.5598 21.5799H32.7998L33.8198 25.7499H33.8498L34.6698 21.5799H36.2698L34.6898 27.7499Z" fill="#FF8C00"/>
5
+ <path d="M19.4498 22.7699H18.5498V24.5199H19.4598C20.0298 24.5199 20.3698 24.1799 20.3698 23.6499C20.3598 23.1199 19.9998 22.7699 19.4498 22.7699Z" fill="#FF8C00"/>
6
+ <path d="M7.49984 20.99C7.00984 20.99 6.60984 21.39 6.60984 21.88C6.60984 22.37 7.00984 22.77 7.49984 22.77H11.9498C12.4398 22.77 12.8398 22.37 12.8398 21.88C12.8398 21.39 12.4398 20.99 11.9498 20.99H7.49984Z" fill="#2680EB"/>
7
+ <path d="M7.47984 26.56C6.98984 26.56 6.58984 26.96 6.58984 27.45C6.58984 27.94 6.98984 28.34 7.47984 28.34H11.9298C12.4198 28.34 12.8198 27.94 12.8198 27.45C12.8198 26.96 12.4198 26.56 11.9298 26.56H7.47984Z" fill="#2680EB"/>
8
+ <path d="M13.5401 9.06006C13.5401 10.1301 13.5401 11.2101 13.5401 12.2801C13.5401 12.8201 13.3601 13.0101 12.8301 13.0101C12.3901 13.0101 11.9501 13.0201 11.5101 13.0101C11.0701 13.0001 10.8701 12.7901 10.8701 12.3401C10.8701 10.1501 10.8701 7.96006 10.8701 5.77006C10.8701 5.25006 11.0601 5.06006 11.5601 5.06006C12.0001 5.06006 12.4401 5.06006 12.8801 5.06006C13.3501 5.07006 13.5401 5.25006 13.5401 5.74006C13.5401 6.85006 13.5401 7.95006 13.5401 9.06006Z" fill="#2680EB"/>
9
+ <path d="M17.5501 9.49006C17.5501 10.4401 17.5501 11.4001 17.5501 12.3501C17.5501 12.8001 17.3601 13.0001 16.9101 13.0101C16.4501 13.0201 15.9901 13.0201 15.5301 13.0101C15.1001 13.0001 14.9001 12.7901 14.9001 12.3701C14.9001 10.4701 14.9001 8.58006 14.9001 6.68006C14.9001 6.17006 15.0801 6.00006 15.5701 5.99006C16.0201 5.99006 16.4701 5.99006 16.9201 5.99006C17.3501 5.99006 17.5501 6.19006 17.5501 6.62006C17.5501 7.58006 17.5401 8.54006 17.5501 9.49006Z" fill="#2680EB"/>
10
+ <path d="M6.81006 10.2501C6.81006 9.55006 6.81006 8.84006 6.81006 8.14006C6.81006 7.65006 6.98006 7.48006 7.47006 7.47006C7.94006 7.46006 8.41006 7.46006 8.88006 7.47006C9.26006 7.48006 9.45006 7.67006 9.46006 8.06006C9.47006 9.51006 9.47006 10.9701 9.46006 12.4201C9.46006 12.7801 9.27006 13.0001 8.91006 13.0101C8.40006 13.0301 7.88006 13.0301 7.37006 13.0101C7.01006 13.0001 6.81006 12.7701 6.81006 12.4001C6.81006 11.6801 6.81006 10.9701 6.81006 10.2501Z" fill="#2680EB"/>
11
+ <path d="M20.2401 10.5001C20.5001 10.5001 20.7501 10.4901 21.0101 10.5001C21.3501 10.5201 21.5501 10.7101 21.5601 11.0601C21.5801 11.5301 21.5801 11.9901 21.5601 12.4601C21.5501 12.7901 21.3501 12.9901 21.0301 13.0001C20.5101 13.0201 19.9801 13.0201 19.4601 13.0001C19.1401 12.9901 18.9101 12.7501 18.9001 12.4001C18.8901 11.9601 18.8901 11.5101 18.9001 11.0701C18.9101 10.7201 19.1201 10.5101 19.4701 10.5001C19.7301 10.4901 19.9801 10.5001 20.2401 10.5001Z" fill="#2680EB"/>
12
+ <path d="M21.0801 15.8601H7.30006C7.03006 15.8601 6.81006 15.6401 6.81006 15.3701C6.81006 15.1001 7.03006 14.8801 7.30006 14.8801H21.0801C21.3501 14.8801 21.5701 15.1001 21.5701 15.3701C21.5701 15.6401 21.3501 15.8601 21.0801 15.8601Z" fill="#2680EB"/>
13
+ </svg>
@@ -9,26 +9,26 @@ import { color as colors } from '../../styles/colors';
9
9
  import ButtonIcon from '../button/icon';
10
10
  import Icon from '../../icons';
11
11
  import { hexToRGBA } from '../../styles/color-helper';
12
- import { typography } from '../../styles/typography';
13
12
  import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
14
- import { useTheme } from '../../theme';
13
+ import theme from '../../theme/settings';
15
14
  const {
16
- heading3,
17
- heading4,
18
- heading5,
19
- paragraph1,
20
- paragraph2,
21
- paragraph3
22
- } = typography;
23
- const {
24
- system: {
25
- rest,
26
- white
27
- }
28
- } = colors;
29
- const {
30
- zIndex
31
- } = useTheme();
15
+ colors: {
16
+ system: {
17
+ rest,
18
+ white
19
+ }
20
+ },
21
+ typography: {
22
+ heading3,
23
+ heading4,
24
+ heading5,
25
+ paragraph1,
26
+ paragraph2,
27
+ paragraph3
28
+ },
29
+ spacing,
30
+ zIndex: zIndexCORE
31
+ } = theme;
32
32
  const iconMap = new Map([['info', 'Info'], ['success', 'ApprovalFilled'], ['warning', 'Warning'], ['danger', 'CancelFilled']]);
33
33
  const maxWidthMap = new Map([['tiny', 320], ['small', 400], ['medium', 480]]);
34
34
  const primaryTypoMap = new Map([['tiny', heading5], ['small', heading4], ['medium', heading3]]);
@@ -177,7 +177,7 @@ const AlertContainerCSS = (size, progressing, duration) => css`
177
177
  transition: opacity ${progressing ? duration / 2 + 1 : duration * 1}s ease ${progressing ? duration / 2 : 0}s;
178
178
  margin-bottom: 1rem;
179
179
  pointer-events: auto;
180
- z-index: ${zIndex(1)};
180
+ z-index: ${zIndexCORE(1)};
181
181
  `;
182
182
 
183
183
  const AlertInfoCSS = (mainColor, opacityColor) => css`
@@ -192,20 +192,21 @@ const AlertInfoCSS = (mainColor, opacityColor) => css`
192
192
  background-color: ${white};
193
193
  width: 100%;
194
194
  min-width: 320px;
195
- padding: 0 4px 0 16px;
195
+ padding: ${spacing([0, 1, 0, 4])};
196
196
  opacity: 1;
197
197
  `;
198
198
 
199
199
  const AlertIconCSS = css`
200
200
  display: inherit;
201
201
  margin-right: 10px;
202
- padding: 8px 0;
202
+ padding: ${spacing([2, 0])};
203
203
  `;
204
204
 
205
205
  const AlertTextCSS = clearAble => css`
206
206
  ${displayBlock};
207
207
  margin-right: ${clearAble ? '10px' : 0};
208
- padding: 8px 0;
208
+ padding: ${spacing([2, 0])};
209
+ align-self: center;
209
210
  `;
210
211
 
211
212
  const AlertPrimaryCSS = (secondary, size) => css`
@@ -214,13 +215,13 @@ const AlertPrimaryCSS = (secondary, size) => css`
214
215
  ${alignCenter};
215
216
  ${justifyStart};
216
217
  ${userSelectNone};
217
- ${secondary ? primaryTypoMap.get(size) : paragraph1}
218
+ ${secondary ? primaryTypoMap.get(size) : paragraph1};
218
219
  `;
219
220
 
220
221
  const AlertSecondaryCSS = size => css`
221
222
  ${displayBlock};
222
223
  ${userSelectNone};
223
- ${size === 'tiny' ? paragraph3 : paragraph2}
224
+ ${size === 'tiny' ? paragraph3 : paragraph2};
224
225
  `;
225
226
 
226
227
  const AlertClearIconCSS = css`
@@ -3,14 +3,14 @@ import ReactDOM from 'react-dom';
3
3
  import PropTypes from 'prop-types';
4
4
  import Alert from './';
5
5
  import { randomString } from '../../utils';
6
- import { useTheme } from '../../theme';
6
+ import theme from '../../theme/settings';
7
7
  const {
8
- zIndex
9
- } = useTheme();
8
+ zIndex: zIndexCORE
9
+ } = theme;
10
10
  const positions = {
11
11
  general: {
12
12
  position: 'fixed',
13
- zIndex: zIndex(2),
13
+ zIndex: zIndexCORE(2),
14
14
  backgroundColor: 'transparent',
15
15
  pointerEvents: 'none'
16
16
  },
@@ -123,15 +123,17 @@ const AlertNotify = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
123
123
 
124
124
  ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
125
125
  onClose: e => onClose(e, position),
126
+ secondary: message,
126
127
  ...props,
127
128
  ...options
128
- }, message), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
129
+ }), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
129
130
  } else {
130
131
  ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
131
132
  onClose: onClose,
133
+ secondary: message,
132
134
  ...props,
133
135
  ...options
134
- }, message), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
136
+ }), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
135
137
  }
136
138
  };
137
139
 
@@ -370,14 +370,14 @@ ButtonIcon.propTypes = {
370
370
  /** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
371
371
  name: PropTypes.string,
372
372
 
373
- /**
374
- * The size of the component.
375
- *
376
- * * tiny (button 24px, icon 16px)
377
- * * small (button 32px, icon 20px)
378
- * * medium (button 40px, icon 24px)
379
- * * large (button 48px, icon 32px)
380
- * * giant (button 56px, icon 40px)
373
+ /**
374
+ * The size of the component.
375
+ *
376
+ * * tiny (button 24px, icon 16px)
377
+ * * small (button 32px, icon 20px)
378
+ * * medium (button 40px, icon 24px)
379
+ * * large (button 48px, icon 32px)
380
+ * * giant (button 56px, icon 40px)
381
381
  * */
382
382
  size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant']),
383
383
 
@@ -393,19 +393,19 @@ ButtonIcon.propTypes = {
393
393
  /** Width of the component. */
394
394
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
395
395
 
396
- /**
397
- * ref methods (ref.current.instance.*method*)
398
- *
399
- * * option(): Gets all UI component properties
400
- * * Returns value - object
401
- * * option(optionName): Gets the value of a single property
402
- * * @param {optionName} - string
403
- * * Returns value - any
404
- * * option(optionName, optionValue): Updates the value of a single property
405
- * * @param {optionName} - string
406
- * * @param {optionValue} - any
407
- * * option(options): Updates the values of several properties
408
- * * @param {options} - object
396
+ /**
397
+ * ref methods (ref.current.instance.*method*)
398
+ *
399
+ * * option(): Gets all UI component properties
400
+ * * Returns value - object
401
+ * * option(optionName): Gets the value of a single property
402
+ * * @param {optionName} - string
403
+ * * Returns value - any
404
+ * * option(optionName, optionValue): Updates the value of a single property
405
+ * * @param {optionName} - string
406
+ * * @param {optionValue} - any
407
+ * * option(options): Updates the values of several properties
408
+ * * @param {options} - object
409
409
  */
410
410
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
411
411
  current: PropTypes.instanceOf(Element)