diginet-core-ui 1.3.75 → 1.3.76-beta.2

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.
@@ -1,21 +1,21 @@
1
1
  /** @jsxRuntime classic */
2
2
 
3
3
  /** @jsx jsx */
4
- import { memo, useState, useEffect, useMemo, useRef, forwardRef } from 'react';
4
+ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import LinearProgress from '../progress/linear';
8
- import { color as colors } from '../../styles/colors';
9
8
  import ButtonIcon from '../button/icon';
10
9
  import Icon from '../../icons';
11
10
  import { hexToRGBA } from '../../styles/color-helper';
11
+ import { animations } from '../../styles/animation';
12
+ import { classNames, useDelayUnmount } from '../../utils';
12
13
  import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
13
- import theme from '../../theme/settings';
14
+ import { useTheme, useColor as colors } from '../../theme';
14
15
  const {
15
16
  colors: {
16
17
  system: {
17
- rest,
18
- white
18
+ white: systemWhite
19
19
  }
20
20
  },
21
21
  typography: {
@@ -28,31 +28,40 @@ const {
28
28
  },
29
29
  spacing,
30
30
  zIndex: zIndexCORE
31
- } = theme;
31
+ } = useTheme();
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]]);
35
35
  const iconSizeMap = new Map([['tiny', 16], ['small', 20], ['medium', 24]]);
36
36
  const linearProgressSizeMap = new Map([['tiny', 2], ['small', 3], ['medium', 4]]);
37
+ const transitionTime = 300;
37
38
  const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
38
- color,
39
- text,
40
- secondary,
41
- size,
42
- className,
43
- progressing,
39
+ action = {},
44
40
  autoDisappear,
45
- duration,
41
+ children,
42
+ className,
46
43
  clearAble,
44
+ color,
45
+ duration,
47
46
  onClose,
48
- children
49
- }, ref) => {
47
+ progressing,
48
+ secondary,
49
+ size,
50
+ text,
51
+ type
52
+ }, reference) => {
53
+ type = type || color;
54
+ const ref = useRef(null);
50
55
  const clearIconRef = useRef(null);
51
56
  const [percentState, setPercentState] = useState(100);
52
- const mainColor = colors[color];
57
+ const [isClose, setIsClose] = useState(false);
58
+ const showAlert = useDelayUnmount(!isClose, transitionTime);
59
+ const mainColor = colors[type];
53
60
  const opacityColor = hexToRGBA(mainColor, 0.15);
61
+ const iconName = iconMap.get(type);
62
+ const iconSize = iconSizeMap.get(size);
54
63
 
55
- const _AlertContainerCSS = AlertContainerCSS(size, progressing, duration);
64
+ const _AlertContainerCSS = AlertContainerCSS(size);
56
65
 
57
66
  const _AlertInfoCSS = AlertInfoCSS(mainColor, opacityColor);
58
67
 
@@ -64,53 +73,51 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
64
73
 
65
74
  const _linearProgressCSS = linearProgressCSS(size);
66
75
 
67
- const onClearAlert = (el, urgency) => {
68
- var _el$parentNode;
69
-
70
- if (!el) return;
71
- el.style.pointerEvent = 'none';
72
- const alertNode = el === null || el === void 0 ? void 0 : (_el$parentNode = el.parentNode) === null || _el$parentNode === void 0 ? void 0 : _el$parentNode.parentNode;
73
-
74
- if (alertNode) {
75
- if (urgency) {
76
- alertNode.style.transition = `opacity 1s ease`;
77
- alertNode.style.opacity = 1;
78
- }
79
-
80
- setTimeout(() => {
81
- alertNode.style.opacity = 0;
82
- }, 0);
83
- setTimeout(() => {
84
- if (onClose) onClose(alertNode);
85
- alertNode.remove();
86
- }, !urgency && progressing ? duration * 1000 + 300 : duration * 1000);
87
- }
76
+ const _onClose = () => {
77
+ setIsClose(true);
78
+ onClose === null || onClose === void 0 ? void 0 : onClose();
88
79
  };
89
80
 
81
+ useEffect(() => {
82
+ setTimeout(() => {
83
+ setPercentState(0);
84
+ }, 100);
85
+ }, []);
86
+ useEffect(() => {
87
+ if (ref.current && isClose) ref.current.style.opacity = 0;
88
+ }, [isClose]);
89
+ useEffect(() => {
90
+ setTimeout(() => {
91
+ if (autoDisappear) _onClose();
92
+ }, duration);
93
+ }, [autoDisappear]);
94
+ useImperativeHandle(reference, () => {
95
+ const currentRef = ref.current || {};
96
+ currentRef.element = ref.current;
97
+ const _instance = { ...action
98
+ }; // methods
99
+
100
+ _instance.__proto__ = {}; // hidden methods
101
+
102
+ currentRef.instance = _instance;
103
+ return currentRef;
104
+ });
90
105
  const AlertView = useMemo(() => {
91
106
  let node = children;
92
107
 
93
108
  if (!node) {
94
- const iconName = iconMap.get(color);
95
-
96
- if (iconName) {
97
- node = jsx(Icon, {
98
- name: iconName,
99
- width: iconSizeMap.get(size),
100
- height: iconSizeMap.get(size),
101
- color: 'currentColor',
102
- viewBox: true
103
- });
104
- } else {
105
- node = jsx("span", {
106
- css: NotFoundIconCSS
107
- });
108
- }
109
+ node = jsx(Icon, {
110
+ name: iconName,
111
+ width: iconSize,
112
+ height: iconSize,
113
+ color: 'currentColor',
114
+ viewBox: true
115
+ });
109
116
  }
110
117
 
111
118
  return jsx("div", {
112
119
  css: _AlertInfoCSS,
113
- className: ['DGN-UI-Alert', className].join(' ').trim().replace(/\s+/g, ' ')
120
+ className: classNames('DGN-UI-Alert', className)
114
121
  }, jsx("span", {
115
122
  css: AlertIconCSS,
116
123
  className: 'DGN-UI-Alert-Icon'
@@ -125,17 +132,17 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
125
132
  className: 'DGN-UI-Alert-Content-Secondary'
126
133
  }, secondary)), jsx("span", {
127
134
  css: AlertClearIconCSS,
128
- onClick: e => onClearAlert(e.currentTarget, true),
135
+ onClick: _onClose,
129
136
  ref: clearIconRef,
130
137
  className: 'DGN-UI-Alert-Clear'
131
138
  }, clearAble ? jsx(ButtonIcon, {
132
139
  circular: true,
133
140
  viewType: 'text',
134
141
  size: size,
135
- color: color,
142
+ color: type,
136
143
  name: 'Close'
137
144
  }) : null));
138
- }, [color, text, clearAble, secondary, size, children, className]);
145
+ }, [color, text, clearAble, secondary, size, children, className, type, onClose, mainColor, opacityColor, isClose]);
139
146
  const LinearView = useMemo(() => {
140
147
  return progressing ? jsx("span", {
141
148
  css: _linearProgressCSS,
@@ -145,39 +152,30 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
145
152
  background: 'transparent',
146
153
  color: mainColor,
147
154
  percent: percentState,
148
- duration: duration,
155
+ duration: duration / 1000,
149
156
  height: linearProgressSizeMap.get(size),
150
157
  style: {
151
158
  boxShadow: 'none'
152
159
  }
153
160
  })) : null;
154
- }, [progressing, size, percentState]);
155
- useEffect(() => {
156
- if (progressing) {
157
- setTimeout(() => {
158
- setPercentState(0);
159
- }, 1);
160
- }
161
-
162
- if (autoDisappear) {
163
- onClearAlert(clearIconRef.current);
164
- }
165
- }, []);
166
- return jsx("div", {
161
+ }, [progressing, size, duration, percentState]);
162
+ return showAlert ? jsx("div", {
167
163
  css: _AlertContainerCSS,
168
164
  className: 'DGN-UI-Container-Alert',
169
165
  ref: ref
170
- }, AlertView, LinearView);
166
+ }, AlertView, LinearView) : null;
171
167
  }));
168
+ const fadeIn = animations.fadeIn;
172
169
 
173
- const AlertContainerCSS = (size, progressing, duration) => css`
170
+ const AlertContainerCSS = size => css`
174
171
  ${positionRelative};
175
172
  ${displayBlock};
176
173
  max-width: ${maxWidthMap.get(size)}px;
177
- transition: opacity ${progressing ? duration / 2 + 1 : duration * 1}s ease ${progressing ? duration / 2 : 0}s;
174
+ transition: opacity ${transitionTime}ms ease;
178
175
  margin-bottom: 1rem;
179
176
  pointer-events: auto;
180
177
  z-index: ${zIndexCORE(1)};
178
+ animation: ${fadeIn} ${transitionTime}ms ease;
181
179
  `;
182
180
 
183
181
  const AlertInfoCSS = (mainColor, opacityColor) => css`
@@ -189,7 +187,7 @@ const AlertInfoCSS = (mainColor, opacityColor) => css`
189
187
  ${border(1, mainColor)};
190
188
  color: ${mainColor};
191
189
  background-image: linear-gradient(${opacityColor}, ${opacityColor});
192
- background-color: ${white};
190
+ background-color: ${systemWhite};
193
191
  width: 100%;
194
192
  min-width: 320px;
195
193
  padding: ${spacing([0, 1, 0, 4])};
@@ -198,13 +196,13 @@ const AlertInfoCSS = (mainColor, opacityColor) => css`
198
196
 
199
197
  const AlertIconCSS = css`
200
198
  display: inherit;
201
- margin-right: 10px;
199
+ margin-right: ${spacing([2.5])};
202
200
  padding: ${spacing([2, 0])};
203
201
  `;
204
202
 
205
203
  const AlertTextCSS = clearAble => css`
206
204
  ${displayBlock};
207
- margin-right: ${clearAble ? '10px' : 0};
205
+ margin-right: ${spacing([clearAble ? 2.5 : 0])};
208
206
  padding: ${spacing([2, 0])};
209
207
  align-self: center;
210
208
  `;
@@ -231,57 +229,51 @@ const AlertClearIconCSS = css`
231
229
  const linearProgressCSS = size => css`
232
230
  ${displayBlock};
233
231
  ${positionRelative};
234
- margin-top: ${size === 'medium' ? '4px' : '2px'};
235
- padding: 0 5px;
232
+ margin-top: ${spacing([size === 'medium' ? 1 : 0.5])};
233
+ padding: ${spacing([0, 1.25])};
236
234
  `;
237
235
 
238
- const NotFoundIconCSS = css`
239
- ${displayBlock};
240
- width: 70%;
241
- height: 70%;
242
- border: 1px dashed ${rest};
243
- `;
244
236
  Alert.defaultProps = {
245
- color: 'info',
246
- size: 'medium',
237
+ autoDisappear: false,
247
238
  className: '',
248
239
  clearAble: true,
240
+ color: 'info',
241
+ duration: 2000,
249
242
  progressing: false,
250
- autoDisappear: false,
251
- duration: 5
243
+ size: 'medium'
252
244
  };
253
245
  Alert.propTypes = {
254
- /** color is a string, it's background color of Alert */
255
- color: PropTypes.oneOf(['info', 'success', 'warning', 'danger']),
246
+ /** Automatically remove the Alert component after the timer ends (milliseconds). */
247
+ autoDisappear: PropTypes.bool,
256
248
 
257
- /** class for Alert component */
258
- className: PropTypes.string,
249
+ /** The element to display in alert like text props (priority). */
250
+ children: PropTypes.node,
259
251
 
260
- /** The text to show in alert */
261
- text: PropTypes.string,
252
+ /** Class for component. */
253
+ className: PropTypes.string,
262
254
 
263
- /** The secondary text to show in alert (under primary) */
264
- secondary: PropTypes.string,
255
+ /** If `true`, show clear icon to close alert. */
256
+ clearAble: PropTypes.bool,
265
257
 
266
- /** size is a string, size of Alert */
267
- size: PropTypes.oneOf(['tiny', 'small', 'medium']),
258
+ /** The amount of time the alert is displayed. The unit is the milliseconds. */
259
+ duration: PropTypes.number,
268
260
 
269
- /** Display clear icon to close alert */
270
- clearAble: PropTypes.bool,
261
+ /** Callback fired when the component closed. */
262
+ onClose: PropTypes.func,
271
263
 
272
- /** use to display linear progress in duration time show Alert */
264
+ /** If `true`, show linear progress in duration time.*/
273
265
  progressing: PropTypes.bool,
274
266
 
275
- /** Automatically remove the Alert component after the timer ends (duration) */
276
- autoDisappear: PropTypes.bool,
267
+ /** The secondary text to show in alert (under primary). */
268
+ secondary: PropTypes.string,
277
269
 
278
- /** The amount of time the alert is displayed. The unit is the second */
279
- duration: PropTypes.number,
270
+ /** The size of the component. */
271
+ size: PropTypes.oneOf(['tiny', 'small', 'medium']),
280
272
 
281
- /** The function will run after remove an Alert component */
282
- onClose: PropTypes.func,
273
+ /** The text to show in alert. */
274
+ text: PropTypes.string,
283
275
 
284
- /** The element to display in alert like text props (priority) */
285
- children: PropTypes.node
276
+ /** Type of the component. */
277
+ type: PropTypes.oneOf(['info', 'success', 'warning', 'danger'])
286
278
  };
287
279
  export default Alert;
@@ -1,198 +1,139 @@
1
- import React, { memo, useEffect, forwardRef, useImperativeHandle } from 'react';
2
- import ReactDOM from 'react-dom';
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import { memo, useEffect, forwardRef, useImperativeHandle, useRef, useState } from 'react';
5
+ import ReactDOM, { createPortal } from 'react-dom';
3
6
  import PropTypes from 'prop-types';
7
+ import { jsx, css } from '@emotion/core';
4
8
  import Alert from './';
5
- import { randomString } from '../../utils';
6
9
  import theme from '../../theme/settings';
10
+ import { classNames, refType as ref } from '../../utils';
11
+ import { backgroundTransparent, pointerEventsNone, positionFixed } from '../../styles/general';
7
12
  const {
8
13
  zIndex: zIndexCORE
9
14
  } = theme;
10
- const positions = {
11
- general: {
12
- position: 'fixed',
13
- zIndex: zIndexCORE(2),
14
- backgroundColor: 'transparent',
15
- pointerEvents: 'none'
16
- },
17
- vertical: {
18
- top: {
19
- top: '15px'
20
- },
21
- center: {
22
- top: '50%',
23
- transform: 'translateY(-50%)'
24
- },
25
- bottom: {
26
- display: 'flex',
27
- flexDirection: 'column-reverse',
28
- bottom: 0
29
- }
30
- },
31
- horizontal: {
32
- left: {
33
- left: '15px'
34
- },
35
- center: {
36
- left: '50%',
37
- transform: 'translateX(-50%)'
38
- },
39
- right: {
40
- right: '15px'
41
- }
42
- }
43
- };
44
- const str = randomString(6, {
45
- allowSymbol: false
46
- });
47
- const AlertNotify = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
48
- position,
15
+ const positionVerticalMap = new Map([['top', css`
16
+ top: 15px;
17
+ `], ['center', css`
18
+ top: 50%;
19
+ transform: translateY(-50%);
20
+ `], ['bottom', css`
21
+ display: flex;
22
+ flex-direction: column-reverse;
23
+ bottom: 0;
24
+ `]]);
25
+ const positionHorizontalMap = new Map([['left', css`
26
+ left: 15px;
27
+ `], ['center', css`
28
+ left: 50%;
29
+ transform: translateX(-50%);
30
+ `], ['right', css`
31
+ right: 15px;
32
+ `]]);
33
+ const Notify = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
34
+ action = {},
35
+ className,
49
36
  getAddNotify,
50
- width,
51
- maxWidth,
52
- height,
53
- maxHeight,
37
+ id,
38
+ position,
39
+ style,
54
40
  ...props
55
41
  }, reference) => {
56
- // Return true if it's a new position
57
- const checkPosition = pos => {
58
- if (pos === position || pos.vertical === (position.vertical || 'bottom') && pos.horizontal === (position.horizontal || 'center')) {
59
- return false;
60
- }
61
-
62
- if (pos === 'center') {
63
- pos = {
64
- vertical: 'center',
65
- horizontal: 'center'
66
- };
67
- }
68
-
69
- if (pos.vertical && pos.horizontal && /^top|center|bottom$/.test(pos.vertical) && /^left|center|right$/.test(pos.horizontal)) {
70
- return true;
71
- }
72
-
73
- return false;
74
- };
75
-
76
- const renderNotifyAlertPosition = (pos, className) => {
77
- if (pos === 'center') {
78
- pos = {
79
- vertical: 'center',
80
- horizontal: 'center'
81
- };
82
- }
83
-
84
- const el = document.createElement('div');
85
- el.className = `Notify-Alert-${className || pos.vertical + '-' + pos.horizontal}`;
86
- Object.assign(el.style, positions.general, positions.vertical[pos.vertical || 'bottom'], positions.horizontal[pos.horizontal || 'center'], pos.vertical === pos.horizontal ? {
87
- transform: 'translate(-50%, -50%)'
88
- } : {}, {
89
- width,
90
- maxWidth,
91
- height,
92
- maxHeight
93
- });
94
- document.body.appendChild(el);
95
- };
96
-
97
- const onClose = (e, removePosition) => {
98
- var _e$parentNode;
99
-
100
- (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.remove();
101
-
102
- if (removePosition) {
103
- const node = document.querySelector(`div[class^="Notify-Alert-${removePosition.vertical}-${removePosition.horizontal}"]`);
104
-
105
- if (node && node.childNodes && !node.childNodes.length) {
106
- node.remove();
107
- }
108
- }
109
- };
42
+ const ref = useRef(null);
43
+ const [positionState, setPositionState] = useState(position);
44
+ const PositionVerticalCSS = positionVerticalMap.get((positionState === null || positionState === void 0 ? void 0 : positionState.vertical) || 'bottom');
45
+ const PositionHorizontalCSS = positionHorizontalMap.get((positionState === null || positionState === void 0 ? void 0 : positionState.horizontal) || 'center');
110
46
 
111
- const onAddAlert = (message, {
47
+ const showNotify = (message, {
112
48
  position,
113
49
  ...options
114
50
  } = {}) => {
115
51
  options = typeof options === 'object' ? options : {};
116
- const el = document.createElement('div');
117
- el.className = `Notify-Alert-${str}-item`;
118
52
 
119
- if (position && checkPosition(position)) {
120
- if (!document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`)) {
121
- renderNotifyAlertPosition(position);
122
- }
123
-
124
- ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
125
- onClose: e => onClose(e, position),
126
- secondary: message,
127
- ...props,
128
- ...options
129
- }), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
130
- } else {
131
- ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
132
- onClose: onClose,
133
- secondary: message,
134
- ...props,
135
- ...options
136
- }), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
53
+ if (position) {
54
+ setPositionState(position);
137
55
  }
56
+
57
+ const el = document.createElement('div');
58
+ el.className = 'DGN-UI-Notify-Alert-Item';
59
+ ReactDOM.render(jsx(Alert // onClose={() => el.remove()}
60
+ , {
61
+ secondary: message,
62
+ ...props,
63
+ ...options
64
+ }), ref.current.appendChild(el));
138
65
  };
139
66
 
140
67
  useEffect(() => {
141
- if (getAddNotify && typeof getAddNotify === 'function') getAddNotify(onAddAlert);
68
+ if (getAddNotify && typeof getAddNotify === 'function') getAddNotify(showNotify);
142
69
  }, [props]);
143
70
  useEffect(() => {
144
- renderNotifyAlertPosition(position, str);
145
- return () => {
146
- document.querySelector(`div[class^="Notify-Alert-${str}"]`).remove();
147
- };
148
- }, [position, width, maxWidth, height, maxHeight]);
149
- useImperativeHandle(reference, () => ({
150
- add: onAddAlert
151
- }));
152
- return null;
71
+ setPositionState(position);
72
+ }, [position]);
73
+ useImperativeHandle(reference, () => {
74
+ const currentRef = ref.current || {};
75
+ currentRef.element = ref.current;
76
+ const _instance = {
77
+ show: showNotify,
78
+ ...action
79
+ }; // methods
80
+
81
+ _instance.__proto__ = {}; // hidden methods
82
+
83
+ currentRef.instance = _instance;
84
+ currentRef.add = showNotify;
85
+ return currentRef;
86
+ });
87
+ const NotifyContainerView = jsx("div", {
88
+ ref: ref,
89
+ css: [AlertCSS, PositionVerticalCSS, PositionHorizontalCSS],
90
+ id: id,
91
+ style: style,
92
+ className: classNames('DGN-UI-Notify-Alert', (position === null || position === void 0 ? void 0 : position.vertical) || 'center' + '-' + (position === null || position === void 0 ? void 0 : position.horizontal) || 'center', className)
93
+ });
94
+ return /*#__PURE__*/createPortal(NotifyContainerView, document.body);
153
95
  }));
154
- AlertNotify.defaultProps = {
96
+ const AlertCSS = css`
97
+ ${positionFixed};
98
+ ${pointerEventsNone};
99
+ ${backgroundTransparent};
100
+ z-index: ${zIndexCORE(2)};
101
+ `;
102
+ Notify.defaultProps = {
103
+ className: '',
155
104
  position: {
156
105
  vertical: 'bottom',
157
106
  horizontal: 'center'
158
- }
107
+ },
108
+ style: {}
159
109
  };
160
- AlertNotify.propTypes = {
110
+ Notify.propTypes = {
111
+ /** Class for component. */
112
+ className: PropTypes.string,
113
+
161
114
  /**
162
115
  * used to set position of Alert (is a string or an object)
163
116
  * string is center (obligatory) as {vertical: 'center', horizontal: 'center'}
164
117
  */
165
118
  position: PropTypes.oneOfType([PropTypes.oneOf(['center']), PropTypes.shape({
166
- vertical: PropTypes.oneOf(['top', 'center', 'bottom']).isRequired,
167
- horizontal: PropTypes.oneOf(['left', 'center', 'right']).isRequired
119
+ horizontal: PropTypes.oneOf(['center', 'left', 'right']),
120
+ vertical: PropTypes.oneOf(['bottom', 'center', 'top'])
168
121
  })]),
169
122
 
170
- /**
171
- * get the function used to add a new alert<br />
172
- * 2 parameters:<br />
173
- * + message: message for notify<br />
174
- * + options: is an object insist {<br />
175
- * position: position other than the default (if necessary)<br />
176
- * duration: new duration,<br />
177
- * color: new color,<br />
178
- * progressing: new progressing value,<br />
179
- * autoDisappear: new autoDisappear value,<br />
180
- * size: new autoDisappear,<br />
181
- * and any props else in Alert component <br />
182
- * }
183
- */
184
- getAddNotify: PropTypes.func.isRequired,
123
+ /** Style inline of component. */
124
+ style: PropTypes.object,
185
125
 
186
- /** the width of the alert box */
187
- width: PropTypes.string,
126
+ /** Any [props](https://core.diginet.com.vn/ui/?path=/docs/alert--basic) of Alert */
127
+ props: PropTypes.any,
188
128
 
189
- /** the maximum width of the alert box */
190
- maxWidth: PropTypes.string,
191
-
192
- /** the height of the alert box */
193
- height: PropTypes.string,
194
-
195
- /** the maximum height of the alert box */
196
- maxHeight: PropTypes.string
129
+ /**
130
+ * ref methods (ref.current.instance.*method*)
131
+ *
132
+ * * show(message, option): Show notify
133
+ * * @param {message} - number
134
+ * * @param {options} - object
135
+ * * {[Props](https://core.diginet.com.vn/ui/?path=/docs/alert--basic) applied to the `Alert`.}
136
+ */
137
+ reference: ref
197
138
  };
198
- export default AlertNotify;
139
+ export default Notify;