@xaypay/tui 0.0.61 → 0.0.63
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.
- package/dist/index.es.js +518 -209
- package/dist/index.js +414 -84
- package/package.json +3 -2
- package/src/assets/icons/toaster-close.svg +3 -0
- package/src/assets/icons/toaster-error.svg +3 -0
- package/src/assets/icons/toaster-info.svg +3 -0
- package/src/assets/icons/toaster-success.svg +3 -0
- package/src/assets/icons/toaster-warning.svg +3 -0
- package/src/components/file/index.js +9 -6
- package/src/components/icon/Arrow.js +19 -0
- package/src/components/icon/CheckboxChecked.js +21 -0
- package/src/components/icon/CheckboxUnchecked.js +21 -0
- package/src/components/icon/CloseIcon.js +19 -0
- package/src/components/icon/ToasterClose.js +19 -0
- package/src/components/icon/ToasterError.js +19 -0
- package/src/components/icon/ToasterInfo.js +19 -0
- package/src/components/icon/ToasterSuccess.js +19 -0
- package/src/components/icon/ToasterWarning.js +19 -0
- package/src/components/icon/Tooltip.js +19 -0
- package/src/components/icon/index.js +10 -6
- package/src/components/input/index.js +3 -1
- package/src/components/input/input.stories.js +5 -0
- package/src/components/select/index.js +24 -9
- package/src/components/select/select.module.css +3 -2
- package/src/components/toaster/Toast.js +179 -0
- package/src/components/toaster/index.js +72 -0
- package/src/components/toaster/toaster.module.css +188 -0
- package/src/components/toaster/toaster.stories.js +296 -0
- package/src/index.js +2 -1
- package/src/stories/configuration.stories.mdx +16 -0
- package/src/stories/static/select-usage.png +0 -0
- package/src/stories/static/toaster-container-usage.png +0 -0
- package/src/stories/static/toaster-usage.png +0 -0
- package/src/stories/usage.stories.mdx +16 -1
- package/src/components/icon/LikeFilled.js +0 -24
- package/src/components/icon/LikeOutline.js +0 -24
- package/src/components/icon/StarFilled.js +0 -24
- package/src/components/icon/StarOutline.js +0 -24
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
|
|
4
|
+
import { Toast } from './Toast';
|
|
5
|
+
|
|
6
|
+
import styles from './toaster.module.css';
|
|
7
|
+
|
|
8
|
+
let toastify;
|
|
9
|
+
|
|
10
|
+
const removeToast = (ref, position) => {
|
|
11
|
+
const parent = document.getElementById(styles[position]);
|
|
12
|
+
const node = ReactDOM.findDOMNode(ref.current);
|
|
13
|
+
const removeElem = node.parentNode;
|
|
14
|
+
parent.removeChild(removeElem);
|
|
15
|
+
|
|
16
|
+
if (!parent.hasChildNodes()) {
|
|
17
|
+
toastify.removeChild(parent);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const createToast = ({
|
|
22
|
+
type,
|
|
23
|
+
title,
|
|
24
|
+
timer,
|
|
25
|
+
position,
|
|
26
|
+
description,
|
|
27
|
+
}) => {
|
|
28
|
+
let toastParentBlock;
|
|
29
|
+
|
|
30
|
+
const toastBlock = document.createElement('div');
|
|
31
|
+
toastBlock.style.position = 'relative';
|
|
32
|
+
toastBlock.style.flexShrink = 0;
|
|
33
|
+
toastBlock.style.width = '440px';
|
|
34
|
+
toastBlock.style.height = '83px';
|
|
35
|
+
toastBlock.style.marginBottom = '20px';
|
|
36
|
+
const newElem = React.createElement(Toast, {
|
|
37
|
+
type,
|
|
38
|
+
timer,
|
|
39
|
+
title,
|
|
40
|
+
position,
|
|
41
|
+
removeToast,
|
|
42
|
+
description
|
|
43
|
+
});
|
|
44
|
+
ReactDOM.render(newElem, toastBlock);
|
|
45
|
+
|
|
46
|
+
if (!toastify) {
|
|
47
|
+
toastify = document.getElementById('toastify');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!document.getElementById(styles[position])) {
|
|
51
|
+
toastParentBlock = document.createElement('div');
|
|
52
|
+
toastParentBlock.style.position = 'fixed';
|
|
53
|
+
toastParentBlock.style.display = 'flex';
|
|
54
|
+
toastParentBlock.style.zIndex = 99999;
|
|
55
|
+
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
56
|
+
toastParentBlock.setAttribute('id', styles[position]);
|
|
57
|
+
toastParentBlock.appendChild(toastBlock);
|
|
58
|
+
toastify.appendChild(toastParentBlock);
|
|
59
|
+
} else {
|
|
60
|
+
document.getElementById(styles[position]).appendChild(toastBlock);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Toaster = () => {
|
|
65
|
+
const handleToasterClick = (e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<div onClick={handleToasterClick} id='toastify'></div>
|
|
71
|
+
)
|
|
72
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#top-left {
|
|
2
|
+
top: 1em;
|
|
3
|
+
left: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
#top-right {
|
|
7
|
+
top: 1em;
|
|
8
|
+
right: 0
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#top-center {
|
|
12
|
+
top: 1em;
|
|
13
|
+
left: 50%;
|
|
14
|
+
transform: translateX(-50%);
|
|
15
|
+
-webkit-transform: translateX(-50%);
|
|
16
|
+
-moz-transform: translateX(-50%);
|
|
17
|
+
-ms-transform: translateX(-50%);
|
|
18
|
+
-o-transform: translateX(-50%);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#bottom-left {
|
|
22
|
+
left: 0;
|
|
23
|
+
bottom: 1em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#bottom-right {
|
|
27
|
+
right: 0;
|
|
28
|
+
bottom: 1em;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#bottom-center {
|
|
32
|
+
bottom: 1em;
|
|
33
|
+
left: 50%;
|
|
34
|
+
transform: translateX(-50%);
|
|
35
|
+
-webkit-transform: translateX(-50%);
|
|
36
|
+
-moz-transform: translateX(-50%);
|
|
37
|
+
-ms-transform: translateX(-50%);
|
|
38
|
+
-o-transform: translateX(-50%);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.top-left {
|
|
42
|
+
top: 1em;
|
|
43
|
+
left: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.top-right {
|
|
47
|
+
top: 1em;
|
|
48
|
+
right: 0
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.top-center {
|
|
52
|
+
top: 1em;
|
|
53
|
+
left: 50%;
|
|
54
|
+
transform: translateX(-50%);
|
|
55
|
+
-webkit-transform: translateX(-50%);
|
|
56
|
+
-moz-transform: translateX(-50%);
|
|
57
|
+
-ms-transform: translateX(-50%);
|
|
58
|
+
-o-transform: translateX(-50%);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.bottom-left {
|
|
62
|
+
left: 0;
|
|
63
|
+
bottom: 1em;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bottom-right {
|
|
67
|
+
right: 0;
|
|
68
|
+
bottom: 1em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bottom-center {
|
|
72
|
+
bottom: 1em;
|
|
73
|
+
left: 50%;
|
|
74
|
+
transform: translateX(-50%);
|
|
75
|
+
-webkit-transform: translateX(-50%);
|
|
76
|
+
-moz-transform: translateX(-50%);
|
|
77
|
+
-ms-transform: translateX(-50%);
|
|
78
|
+
-o-transform: translateX(-50%);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.notify-block {
|
|
82
|
+
-webkit-animation-duration: 0.5s;
|
|
83
|
+
animation-duration: 0.5s;
|
|
84
|
+
-webkit-animation-fill-mode: both;
|
|
85
|
+
animation-fill-mode: both;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bounce-in-right {
|
|
89
|
+
-webkit-animation-name: bounceInRight;
|
|
90
|
+
animation-name: bounceInRight;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.bounce-out-right {
|
|
94
|
+
-webkit-animation-name: bounceOutRight;
|
|
95
|
+
animation-name: bounceOutRight;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes bounceInRight {
|
|
99
|
+
from {
|
|
100
|
+
opacity: 0;
|
|
101
|
+
right: -100%;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
60% {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
right: 40px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
75% {
|
|
110
|
+
right: 0px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
90% {
|
|
114
|
+
right: 30px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
to {
|
|
118
|
+
right: 20px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes bounceOutRight {
|
|
123
|
+
from {
|
|
124
|
+
opacity: 1;
|
|
125
|
+
right: 20px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
60% {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
right: 60px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
to {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
right: -100%;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.bounce-in-left {
|
|
140
|
+
-webkit-animation-name: bounceInLeft;
|
|
141
|
+
animation-name: bounceInLeft;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.bounce-out-left {
|
|
145
|
+
-webkit-animation-name: bounceOutLeft;
|
|
146
|
+
animation-name: bounceOutLeft;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@keyframes bounceInLeft {
|
|
150
|
+
from {
|
|
151
|
+
opacity: 0;
|
|
152
|
+
left: -100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
60% {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
left: 40px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
75% {
|
|
161
|
+
left: 0px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
90% {
|
|
165
|
+
left: 30px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
to {
|
|
169
|
+
left: 20px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@keyframes bounceOutLeft {
|
|
174
|
+
from {
|
|
175
|
+
opacity: 1;
|
|
176
|
+
left: 20px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
60% {
|
|
180
|
+
opacity: 1;
|
|
181
|
+
left: 60px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
to {
|
|
185
|
+
opacity: 0;
|
|
186
|
+
left: -100%;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Toaster, createToast } from './index';
|
|
3
|
+
import { Button } from './../button';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: Toaster,
|
|
7
|
+
title: 'Components/Toaster',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = (args) => {
|
|
11
|
+
const handleAddToaster = (type, timer, title, position, description) => {
|
|
12
|
+
createToast({
|
|
13
|
+
type,
|
|
14
|
+
timer,
|
|
15
|
+
title,
|
|
16
|
+
position,
|
|
17
|
+
description
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
style={{
|
|
24
|
+
height: 'calc(100vh - 100px)',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
justifyContent: 'center'
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
display: 'flex',
|
|
33
|
+
marginBottom: '30px',
|
|
34
|
+
paddingBottom: '20px',
|
|
35
|
+
borderBottom: '1.5px solid gray',
|
|
36
|
+
justifyContent: 'space-between'
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Button
|
|
40
|
+
outline
|
|
41
|
+
radius='8px'
|
|
42
|
+
contentWidth
|
|
43
|
+
color='white'
|
|
44
|
+
label="Success top left"
|
|
45
|
+
backgroundColor='#10a574'
|
|
46
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'top-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
47
|
+
/>
|
|
48
|
+
<Button
|
|
49
|
+
outline
|
|
50
|
+
radius='8px'
|
|
51
|
+
contentWidth
|
|
52
|
+
color='white'
|
|
53
|
+
label="Success top right"
|
|
54
|
+
backgroundColor='#10a574'
|
|
55
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'top-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
56
|
+
/>
|
|
57
|
+
<Button
|
|
58
|
+
outline
|
|
59
|
+
radius='8px'
|
|
60
|
+
contentWidth
|
|
61
|
+
color='white'
|
|
62
|
+
label="Success top center"
|
|
63
|
+
backgroundColor='#10a574'
|
|
64
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'top-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
65
|
+
/>
|
|
66
|
+
<Button
|
|
67
|
+
outline
|
|
68
|
+
radius='8px'
|
|
69
|
+
contentWidth
|
|
70
|
+
color='white'
|
|
71
|
+
label="Success bottom left"
|
|
72
|
+
backgroundColor='#10a574'
|
|
73
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'bottom-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
74
|
+
/>
|
|
75
|
+
<Button
|
|
76
|
+
outline
|
|
77
|
+
radius='8px'
|
|
78
|
+
contentWidth
|
|
79
|
+
color='white'
|
|
80
|
+
label="Success bottom right"
|
|
81
|
+
backgroundColor='#10a574'
|
|
82
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'bottom-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
83
|
+
/>
|
|
84
|
+
<Button
|
|
85
|
+
outline
|
|
86
|
+
radius='8px'
|
|
87
|
+
contentWidth
|
|
88
|
+
color='white'
|
|
89
|
+
label="Success bottom center"
|
|
90
|
+
backgroundColor='#10a574'
|
|
91
|
+
onClick={() => handleAddToaster('success', 4000, 'Հաջողված', 'bottom-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
display: 'flex',
|
|
98
|
+
marginBottom: '30px',
|
|
99
|
+
paddingBottom: '20px',
|
|
100
|
+
borderBottom: '1.5px solid gray',
|
|
101
|
+
justifyContent: 'space-between'
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<Button
|
|
105
|
+
outline
|
|
106
|
+
radius='8px'
|
|
107
|
+
contentWidth
|
|
108
|
+
color='white'
|
|
109
|
+
label="Info top left"
|
|
110
|
+
backgroundColor='#02246b'
|
|
111
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'top-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
112
|
+
/>
|
|
113
|
+
<Button
|
|
114
|
+
outline
|
|
115
|
+
radius='8px'
|
|
116
|
+
contentWidth
|
|
117
|
+
color='white'
|
|
118
|
+
label="Info top right"
|
|
119
|
+
backgroundColor='#02246b'
|
|
120
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'top-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
121
|
+
/>
|
|
122
|
+
<Button
|
|
123
|
+
outline
|
|
124
|
+
radius='8px'
|
|
125
|
+
contentWidth
|
|
126
|
+
color='white'
|
|
127
|
+
label="Info top center"
|
|
128
|
+
backgroundColor='#02246b'
|
|
129
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'top-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
130
|
+
/>
|
|
131
|
+
<Button
|
|
132
|
+
outline
|
|
133
|
+
radius='8px'
|
|
134
|
+
contentWidth
|
|
135
|
+
color='white'
|
|
136
|
+
label="Info bottom left"
|
|
137
|
+
backgroundColor='#02246b'
|
|
138
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'bottom-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
139
|
+
/>
|
|
140
|
+
<Button
|
|
141
|
+
outline
|
|
142
|
+
radius='8px'
|
|
143
|
+
contentWidth
|
|
144
|
+
color='white'
|
|
145
|
+
label="Info bottom right"
|
|
146
|
+
backgroundColor='#02246b'
|
|
147
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'bottom-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
148
|
+
/>
|
|
149
|
+
<Button
|
|
150
|
+
outline
|
|
151
|
+
radius='8px'
|
|
152
|
+
contentWidth
|
|
153
|
+
color='white'
|
|
154
|
+
label="Info bottom center"
|
|
155
|
+
backgroundColor='#02246b'
|
|
156
|
+
onClick={() => handleAddToaster('info', 4000, 'Տեղեկատվություն', 'bottom-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div
|
|
161
|
+
style={{
|
|
162
|
+
display: 'flex',
|
|
163
|
+
marginBottom: '30px',
|
|
164
|
+
paddingBottom: '20px',
|
|
165
|
+
borderBottom: '1.5px solid gray',
|
|
166
|
+
justifyContent: 'space-between'
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<Button
|
|
170
|
+
outline
|
|
171
|
+
radius='8px'
|
|
172
|
+
contentWidth
|
|
173
|
+
color='white'
|
|
174
|
+
label="Warning top left"
|
|
175
|
+
backgroundColor='#ff8a04'
|
|
176
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'top-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
177
|
+
/>
|
|
178
|
+
<Button
|
|
179
|
+
outline
|
|
180
|
+
radius='8px'
|
|
181
|
+
contentWidth
|
|
182
|
+
color='white'
|
|
183
|
+
label="Warning top right"
|
|
184
|
+
backgroundColor='#ff8a04'
|
|
185
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'top-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
186
|
+
/>
|
|
187
|
+
<Button
|
|
188
|
+
outline
|
|
189
|
+
radius='8px'
|
|
190
|
+
contentWidth
|
|
191
|
+
color='white'
|
|
192
|
+
label="Warning top center"
|
|
193
|
+
backgroundColor='#ff8a04'
|
|
194
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'top-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
195
|
+
/>
|
|
196
|
+
<Button
|
|
197
|
+
outline
|
|
198
|
+
radius='8px'
|
|
199
|
+
contentWidth
|
|
200
|
+
color='white'
|
|
201
|
+
label="Warning bottom left"
|
|
202
|
+
backgroundColor='#ff8a04'
|
|
203
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'bottom-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
204
|
+
/>
|
|
205
|
+
<Button
|
|
206
|
+
outline
|
|
207
|
+
radius='8px'
|
|
208
|
+
contentWidth
|
|
209
|
+
color='white'
|
|
210
|
+
label="Warning bottom right"
|
|
211
|
+
backgroundColor='#ff8a04'
|
|
212
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'bottom-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
213
|
+
/>
|
|
214
|
+
<Button
|
|
215
|
+
outline
|
|
216
|
+
radius='8px'
|
|
217
|
+
contentWidth
|
|
218
|
+
color='white'
|
|
219
|
+
label="Warning bottom center"
|
|
220
|
+
backgroundColor='#ff8a04'
|
|
221
|
+
onClick={() => handleAddToaster('warn', 4000, 'Զգուշացում', 'bottom-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div
|
|
226
|
+
style={{
|
|
227
|
+
display: 'flex',
|
|
228
|
+
marginBottom: '30px',
|
|
229
|
+
paddingBottom: '20px',
|
|
230
|
+
borderBottom: '1.5px solid gray',
|
|
231
|
+
justifyContent: 'space-between'
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
<Button
|
|
235
|
+
outline
|
|
236
|
+
radius='8px'
|
|
237
|
+
contentWidth
|
|
238
|
+
color='white'
|
|
239
|
+
label="Error top left"
|
|
240
|
+
backgroundColor='#ed0000'
|
|
241
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'top-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
242
|
+
/>
|
|
243
|
+
<Button
|
|
244
|
+
outline
|
|
245
|
+
radius='8px'
|
|
246
|
+
contentWidth
|
|
247
|
+
color='white'
|
|
248
|
+
label="Error top right"
|
|
249
|
+
backgroundColor='#ed0000'
|
|
250
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'top-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
251
|
+
/>
|
|
252
|
+
<Button
|
|
253
|
+
outline
|
|
254
|
+
radius='8px'
|
|
255
|
+
contentWidth
|
|
256
|
+
color='white'
|
|
257
|
+
label="Error top center"
|
|
258
|
+
backgroundColor='#ed0000'
|
|
259
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'top-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
260
|
+
/>
|
|
261
|
+
|
|
262
|
+
<Button
|
|
263
|
+
outline
|
|
264
|
+
radius='8px'
|
|
265
|
+
contentWidth
|
|
266
|
+
color='white'
|
|
267
|
+
label="Error bottom left"
|
|
268
|
+
backgroundColor='#ed0000'
|
|
269
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'bottom-left', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
270
|
+
/>
|
|
271
|
+
<Button
|
|
272
|
+
outline
|
|
273
|
+
radius='8px'
|
|
274
|
+
contentWidth
|
|
275
|
+
color='white'
|
|
276
|
+
label="Error bottom right"
|
|
277
|
+
backgroundColor='#ed0000'
|
|
278
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'bottom-right', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
279
|
+
/>
|
|
280
|
+
<Button
|
|
281
|
+
outline
|
|
282
|
+
radius='8px'
|
|
283
|
+
contentWidth
|
|
284
|
+
color='white'
|
|
285
|
+
label="Error bottom center"
|
|
286
|
+
backgroundColor='#ed0000'
|
|
287
|
+
onClick={() => handleAddToaster('error', 4000, 'Սխալ', 'bottom-center', 'lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla, lorem ipsum bla bla bla')}
|
|
288
|
+
/>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<Toaster />
|
|
292
|
+
</div>
|
|
293
|
+
)
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export const Default = Template.bind({});
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from './components/input';
|
|
|
5
5
|
export * from './components/radio';
|
|
6
6
|
export * from './components/button';
|
|
7
7
|
export * from './components/select';
|
|
8
|
+
export * from './components/toaster';
|
|
8
9
|
export * from './components/tooltip';
|
|
9
10
|
export * from './components/captcha';
|
|
10
11
|
export * from './components/stepper';
|
|
@@ -13,4 +14,4 @@ export * from './components/icon/Icon';
|
|
|
13
14
|
export * from './components/typography';
|
|
14
15
|
export * from './components/pagination';
|
|
15
16
|
export * from './components/autocomplate';
|
|
16
|
-
export * from './components/selectCheckbox';
|
|
17
|
+
export * from './components/selectCheckbox';
|
|
@@ -365,3 +365,19 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
365
365
|
optionItemBackgroudColorHover: 'unset', // for option background color ( when hover )
|
|
366
366
|
}
|
|
367
367
|
```
|
|
368
|
+
|
|
369
|
+
### Toaster
|
|
370
|
+
|
|
371
|
+
#### toaster props are not global, you should set directly
|
|
372
|
+
##### all properties are required except description
|
|
373
|
+
```
|
|
374
|
+
{
|
|
375
|
+
createToast({
|
|
376
|
+
type, ---> one of this strings ['info', 'warn', 'error', 'success']
|
|
377
|
+
timer, ---> timer must be a number, for example 5000, is a 5 seconds
|
|
378
|
+
title, ---> title is a string for toast title
|
|
379
|
+
description ---> description is a string for toast description
|
|
380
|
+
position ---> one of this strings ['top-left', 'top-right', 'top-center', 'bottom-left', 'bottom-right', 'bottom-center']
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,7 +9,10 @@ import Repo from './assets/repo.svg';
|
|
|
9
9
|
import StackAlt from './assets/stackalt.svg';
|
|
10
10
|
|
|
11
11
|
import buttonImage from './static/button-usage.png';
|
|
12
|
+
import selectImage from './static/select-usage.png';
|
|
12
13
|
import inputTooltipImage from './static/input-tooltip-usage.png';
|
|
14
|
+
import toasterImage from './static/toaster-container-usage.png';
|
|
15
|
+
import toastImage from './static/toaster-usage.png'
|
|
13
16
|
|
|
14
17
|
<Meta title="Intro/Usage" />
|
|
15
18
|
|
|
@@ -129,4 +132,16 @@ import inputTooltipImage from './static/input-tooltip-usage.png';
|
|
|
129
132
|
|
|
130
133
|
### Input / Tooltip
|
|
131
134
|
|
|
132
|
-
<img src={inputTooltipImage} alt="
|
|
135
|
+
<img src={inputTooltipImage} alt="input tooltip image" />
|
|
136
|
+
|
|
137
|
+
### Select
|
|
138
|
+
|
|
139
|
+
<img src={selectImage} alt="select image" />
|
|
140
|
+
|
|
141
|
+
### Toaster
|
|
142
|
+
|
|
143
|
+
#### Toaster container usage
|
|
144
|
+
<img src={toasterImage} alt="toaster image" />
|
|
145
|
+
|
|
146
|
+
#### createToast function usage
|
|
147
|
+
<img src={toastImage} alt="toaster image" />
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgLikeFilled = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="1em"
|
|
6
|
-
height="1em"
|
|
7
|
-
viewBox="0 0 23 20"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
role="img"
|
|
10
|
-
aria-labelledby={titleId}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
14
|
-
<g fill="none" fillRule="evenodd">
|
|
15
|
-
<path opacity={0.87} d="M-1-1h24v24H-1z" />
|
|
16
|
-
<path
|
|
17
|
-
d="M12.12 1.06 6.58 6.6c-.37.37-.58.88-.58 1.41V18c0 1.1.9 2 2 2h9c.8 0 1.52-.48 1.84-1.21l3.26-7.61C22.94 9.2 21.49 7 19.34 7h-5.65l.95-4.58c.1-.5-.05-1.01-.41-1.37-.59-.58-1.53-.58-2.11.01ZM2 20c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2s-2 .9-2 2v8c0 1.1.9 2 2 2Z"
|
|
18
|
-
fill="currentColor"
|
|
19
|
-
/>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgLikeFilled;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const SvgLikeOutline = ({ title, titleId, ...props }) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="1em"
|
|
6
|
-
height="1em"
|
|
7
|
-
viewBox="0 0 22 20"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
role="img"
|
|
10
|
-
aria-labelledby={titleId}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{title ? <title id={titleId}>{title}</title> : null}
|
|
14
|
-
<g fill="none" fillRule="evenodd">
|
|
15
|
-
<path opacity={0.87} d="M-1-1h24v24H-1z" />
|
|
16
|
-
<path
|
|
17
|
-
d="M20 7h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L13.17 0 6.59 6.59C6.22 6.95 6 7.45 6 8v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73V9c0-1.1-.9-2-2-2Zm0 4-3 7H8V8l4.34-4.34L11.23 9H20v2ZM0 8h4v12H0V8Z"
|
|
18
|
-
fill="currentColor"
|
|
19
|
-
/>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default SvgLikeOutline;
|