@aristobyte-ui/message-box 2.3.6 → 2.5.0
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/es/src/main/components/MessageBox/MessageBox.scss +320 -0
- package/es/src/main/components/MessageBox/index.js +25 -0
- package/es/src/main/components/index.js +1 -0
- package/es/src/main/index.js +1 -0
- package/lib/src/main/components/MessageBox/MessageBox.scss +320 -0
- package/lib/src/main/components/MessageBox/index.js +62 -0
- package/lib/src/main/components/index.js +17 -0
- package/lib/src/main/index.js +17 -0
- package/package.json +4 -3
- package/README.md +0 -87
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
@use '@aristobyte-ui/utils/styles' as *;
|
|
2
|
+
|
|
3
|
+
.message-box {
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
color: $white;
|
|
6
|
+
|
|
7
|
+
display: flex;
|
|
8
|
+
padding: 0.75rem 1rem;
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
|
|
11
|
+
&-radius {
|
|
12
|
+
&--none {
|
|
13
|
+
border-radius: 0rem; // 0px
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&--sm {
|
|
17
|
+
border-radius: 0.25rem; // 4px
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--md {
|
|
21
|
+
border-radius: 0.5rem; // 8px
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--lg {
|
|
25
|
+
border-radius: 0.625rem; // 10px
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--full {
|
|
29
|
+
border-radius: 1.5rem; // 24px
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__content {
|
|
34
|
+
color: $white;
|
|
35
|
+
font-family: $font-family-sans;
|
|
36
|
+
font-size: $font-size-body-sm;
|
|
37
|
+
font-weight: $font-weight-regular;
|
|
38
|
+
line-height: $line-height-normal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--default.message-box-type {
|
|
42
|
+
&--solid {
|
|
43
|
+
background-color: rgba($grey-600, 1);
|
|
44
|
+
|
|
45
|
+
.message-box__icon {
|
|
46
|
+
color: $white;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--outline {
|
|
51
|
+
background-color: rgba($grey-600, 0.2);
|
|
52
|
+
border: 1px solid $grey-600;
|
|
53
|
+
|
|
54
|
+
.message-box__icon {
|
|
55
|
+
color: $grey-600;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--outline-dashed {
|
|
60
|
+
background-color: rgba($grey-600, 0.2);
|
|
61
|
+
border: 1px dashed $grey-600;
|
|
62
|
+
|
|
63
|
+
.message-box__icon {
|
|
64
|
+
color: $grey-600;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--no-outline {
|
|
69
|
+
background-color: rgba($grey-600, 0.2);
|
|
70
|
+
|
|
71
|
+
.message-box__icon {
|
|
72
|
+
color: $grey-600;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--glowing {
|
|
77
|
+
background-color: rgba($grey-600, 0.2);
|
|
78
|
+
border: 1px solid $grey-600;
|
|
79
|
+
box-shadow:
|
|
80
|
+
0 0 8px rgba($grey-600, 0.5),
|
|
81
|
+
0 0 16px rgba($grey-600, 0.4),
|
|
82
|
+
0 0 24px rgba($grey-600, 0.3);
|
|
83
|
+
|
|
84
|
+
.message-box__icon {
|
|
85
|
+
color: $grey-600;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--info.message-box-type {
|
|
91
|
+
&--solid {
|
|
92
|
+
background-color: rgba($blue-600, 1);
|
|
93
|
+
|
|
94
|
+
.message-box__icon {
|
|
95
|
+
color: $white;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--outline {
|
|
100
|
+
background-color: rgba($blue-600, 0.2);
|
|
101
|
+
border: 1px solid $blue-600;
|
|
102
|
+
|
|
103
|
+
.message-box__icon {
|
|
104
|
+
color: $blue-600;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--outline-dashed {
|
|
109
|
+
background-color: rgba($blue-600, 0.2);
|
|
110
|
+
border: 1px dashed $blue-600;
|
|
111
|
+
|
|
112
|
+
.message-box__icon {
|
|
113
|
+
color: $blue-600;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--no-outline {
|
|
118
|
+
background-color: rgba($blue-600, 0.2);
|
|
119
|
+
|
|
120
|
+
.message-box__icon {
|
|
121
|
+
color: $blue-600;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--glowing {
|
|
126
|
+
background-color: rgba($blue-600, 0.2);
|
|
127
|
+
border: 1px solid $blue-600;
|
|
128
|
+
box-shadow:
|
|
129
|
+
0 0 8px rgba($blue-600, 0.5),
|
|
130
|
+
0 0 16px rgba($blue-600, 0.4),
|
|
131
|
+
0 0 24px rgba($blue-600, 0.3);
|
|
132
|
+
|
|
133
|
+
.message-box__icon {
|
|
134
|
+
color: $blue-600;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&--success.message-box-type {
|
|
140
|
+
&--solid {
|
|
141
|
+
background-color: rgba($green-600, 1);
|
|
142
|
+
|
|
143
|
+
.message-box__icon {
|
|
144
|
+
color: $white;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&--outline {
|
|
149
|
+
background-color: rgba($green-600, 0.2);
|
|
150
|
+
border: 1px solid $green-600;
|
|
151
|
+
|
|
152
|
+
.message-box__icon {
|
|
153
|
+
color: $green-600;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--outline-dashed {
|
|
158
|
+
background-color: rgba($green-600, 0.2);
|
|
159
|
+
border: 1px dashed $green-600;
|
|
160
|
+
|
|
161
|
+
.message-box__icon {
|
|
162
|
+
color: $green-600;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&--no-outline {
|
|
167
|
+
background-color: rgba($green-600, 0.2);
|
|
168
|
+
|
|
169
|
+
.message-box__icon {
|
|
170
|
+
color: $green-600;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&--glowing {
|
|
175
|
+
background-color: rgba($green-600, 0.2);
|
|
176
|
+
border: 1px solid $green-600;
|
|
177
|
+
box-shadow:
|
|
178
|
+
0 0 8px rgba($green-600, 0.5),
|
|
179
|
+
0 0 16px rgba($green-600, 0.4),
|
|
180
|
+
0 0 24px rgba($green-600, 0.3);
|
|
181
|
+
|
|
182
|
+
.message-box__icon {
|
|
183
|
+
color: $green-600;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&--warning.message-box-type {
|
|
189
|
+
&--solid {
|
|
190
|
+
background-color: rgba($amber-600, 1);
|
|
191
|
+
|
|
192
|
+
.message-box__icon {
|
|
193
|
+
color: $white;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&--outline {
|
|
198
|
+
background-color: rgba($amber-600, 0.2);
|
|
199
|
+
border: 1px solid $amber-600;
|
|
200
|
+
|
|
201
|
+
.message-box__icon {
|
|
202
|
+
color: $amber-600;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&--outline-dashed {
|
|
207
|
+
background-color: rgba($amber-600, 0.2);
|
|
208
|
+
border: 1px dashed $amber-600;
|
|
209
|
+
|
|
210
|
+
.message-box__icon {
|
|
211
|
+
color: $amber-600;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&--no-outline {
|
|
216
|
+
background-color: rgba($amber-600, 0.2);
|
|
217
|
+
|
|
218
|
+
.message-box__icon {
|
|
219
|
+
color: $amber-600;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&--glowing {
|
|
224
|
+
background-color: rgba($amber-600, 0.2);
|
|
225
|
+
border: 1px solid $amber-600;
|
|
226
|
+
box-shadow:
|
|
227
|
+
0 0 8px rgba($amber-600, 0.5),
|
|
228
|
+
0 0 16px rgba($amber-600, 0.4),
|
|
229
|
+
0 0 24px rgba($amber-600, 0.3);
|
|
230
|
+
|
|
231
|
+
.message-box__icon {
|
|
232
|
+
color: $amber-600;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&--error.message-box-type {
|
|
238
|
+
&--solid {
|
|
239
|
+
background-color: rgba($red-600, 1);
|
|
240
|
+
|
|
241
|
+
.message-box__icon {
|
|
242
|
+
color: $white;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&--outline {
|
|
247
|
+
background-color: rgba($red-600, 0.2);
|
|
248
|
+
border: 1px solid $red-600;
|
|
249
|
+
|
|
250
|
+
.message-box__icon {
|
|
251
|
+
color: $red-600;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&--outline-dashed {
|
|
256
|
+
background-color: rgba($red-600, 0.2);
|
|
257
|
+
border: 1px dashed $red-600;
|
|
258
|
+
|
|
259
|
+
.message-box__icon {
|
|
260
|
+
color: $red-600;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&--no-outline {
|
|
265
|
+
background-color: rgba($red-600, 0.2);
|
|
266
|
+
|
|
267
|
+
.message-box__icon {
|
|
268
|
+
color: $red-600;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&--glowing {
|
|
273
|
+
background-color: rgba($red-600, 0.2);
|
|
274
|
+
border: 1px solid $red-600;
|
|
275
|
+
box-shadow:
|
|
276
|
+
0 0 8px rgba($red-600, 0.5),
|
|
277
|
+
0 0 16px rgba($red-600, 0.4),
|
|
278
|
+
0 0 24px rgba($red-600, 0.3);
|
|
279
|
+
|
|
280
|
+
.message-box__icon {
|
|
281
|
+
color: $red-600;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&__icon {
|
|
287
|
+
align-items: center;
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
margin: 0 10px 0 0;
|
|
291
|
+
max-height: 16px;
|
|
292
|
+
max-width: 16px;
|
|
293
|
+
min-height: 16px;
|
|
294
|
+
min-width: 16px;
|
|
295
|
+
|
|
296
|
+
&--default {
|
|
297
|
+
color: $grey-600;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&--info {
|
|
301
|
+
color: $blue-600;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&--success {
|
|
305
|
+
color: $green-600;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&--warning {
|
|
309
|
+
color: $amber-600;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&--error {
|
|
313
|
+
color: $red-600;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
svg {
|
|
317
|
+
width: 100%;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icons } from '@aristobyte-ui/utils';
|
|
3
|
+
import './MessageBox.scss';
|
|
4
|
+
var renderIcon = function (variant) {
|
|
5
|
+
switch (variant) {
|
|
6
|
+
case 'warning':
|
|
7
|
+
return Icons.Warning;
|
|
8
|
+
case 'success':
|
|
9
|
+
return Icons.Success;
|
|
10
|
+
case 'error':
|
|
11
|
+
return Icons.Error;
|
|
12
|
+
case 'info':
|
|
13
|
+
default:
|
|
14
|
+
return Icons.Info;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export var MessageBox = function (_a) {
|
|
18
|
+
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.withIcon, withIcon = _c === void 0 ? false : _c, _d = _a.customIcon, customIcon = _d === void 0 ? null : _d, _e = _a.radius, radius = _e === void 0 ? 'md' : _e, _f = _a.type, type = _f === void 0 ? 'outline' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.style, style = _h === void 0 ? {} : _h;
|
|
19
|
+
return (React.createElement("div", { className: "message-box ".concat("message-box-type--".concat(type), " ").concat("message-box-radius--".concat(radius), " ").concat("message-box--".concat(variant), " ").concat(className), style: style },
|
|
20
|
+
withIcon && (React.createElement("span", { className: "message-box__icon ".concat("message-box__icon--".concat(variant)) }, (customIcon === null || customIcon === void 0 ? void 0 : customIcon.component({
|
|
21
|
+
size: customIcon.size,
|
|
22
|
+
color: customIcon.color,
|
|
23
|
+
})) || renderIcon(variant)({}))),
|
|
24
|
+
React.createElement("p", { className: "message-box__content", dangerouslySetInnerHTML: { __html: children || '' } })));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MessageBox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
@use '@aristobyte-ui/utils/styles' as *;
|
|
2
|
+
|
|
3
|
+
.message-box {
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
color: $white;
|
|
6
|
+
|
|
7
|
+
display: flex;
|
|
8
|
+
padding: 0.75rem 1rem;
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
|
|
11
|
+
&-radius {
|
|
12
|
+
&--none {
|
|
13
|
+
border-radius: 0rem; // 0px
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&--sm {
|
|
17
|
+
border-radius: 0.25rem; // 4px
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--md {
|
|
21
|
+
border-radius: 0.5rem; // 8px
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--lg {
|
|
25
|
+
border-radius: 0.625rem; // 10px
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--full {
|
|
29
|
+
border-radius: 1.5rem; // 24px
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__content {
|
|
34
|
+
color: $white;
|
|
35
|
+
font-family: $font-family-sans;
|
|
36
|
+
font-size: $font-size-body-sm;
|
|
37
|
+
font-weight: $font-weight-regular;
|
|
38
|
+
line-height: $line-height-normal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--default.message-box-type {
|
|
42
|
+
&--solid {
|
|
43
|
+
background-color: rgba($grey-600, 1);
|
|
44
|
+
|
|
45
|
+
.message-box__icon {
|
|
46
|
+
color: $white;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--outline {
|
|
51
|
+
background-color: rgba($grey-600, 0.2);
|
|
52
|
+
border: 1px solid $grey-600;
|
|
53
|
+
|
|
54
|
+
.message-box__icon {
|
|
55
|
+
color: $grey-600;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--outline-dashed {
|
|
60
|
+
background-color: rgba($grey-600, 0.2);
|
|
61
|
+
border: 1px dashed $grey-600;
|
|
62
|
+
|
|
63
|
+
.message-box__icon {
|
|
64
|
+
color: $grey-600;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--no-outline {
|
|
69
|
+
background-color: rgba($grey-600, 0.2);
|
|
70
|
+
|
|
71
|
+
.message-box__icon {
|
|
72
|
+
color: $grey-600;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--glowing {
|
|
77
|
+
background-color: rgba($grey-600, 0.2);
|
|
78
|
+
border: 1px solid $grey-600;
|
|
79
|
+
box-shadow:
|
|
80
|
+
0 0 8px rgba($grey-600, 0.5),
|
|
81
|
+
0 0 16px rgba($grey-600, 0.4),
|
|
82
|
+
0 0 24px rgba($grey-600, 0.3);
|
|
83
|
+
|
|
84
|
+
.message-box__icon {
|
|
85
|
+
color: $grey-600;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--info.message-box-type {
|
|
91
|
+
&--solid {
|
|
92
|
+
background-color: rgba($blue-600, 1);
|
|
93
|
+
|
|
94
|
+
.message-box__icon {
|
|
95
|
+
color: $white;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--outline {
|
|
100
|
+
background-color: rgba($blue-600, 0.2);
|
|
101
|
+
border: 1px solid $blue-600;
|
|
102
|
+
|
|
103
|
+
.message-box__icon {
|
|
104
|
+
color: $blue-600;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--outline-dashed {
|
|
109
|
+
background-color: rgba($blue-600, 0.2);
|
|
110
|
+
border: 1px dashed $blue-600;
|
|
111
|
+
|
|
112
|
+
.message-box__icon {
|
|
113
|
+
color: $blue-600;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--no-outline {
|
|
118
|
+
background-color: rgba($blue-600, 0.2);
|
|
119
|
+
|
|
120
|
+
.message-box__icon {
|
|
121
|
+
color: $blue-600;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--glowing {
|
|
126
|
+
background-color: rgba($blue-600, 0.2);
|
|
127
|
+
border: 1px solid $blue-600;
|
|
128
|
+
box-shadow:
|
|
129
|
+
0 0 8px rgba($blue-600, 0.5),
|
|
130
|
+
0 0 16px rgba($blue-600, 0.4),
|
|
131
|
+
0 0 24px rgba($blue-600, 0.3);
|
|
132
|
+
|
|
133
|
+
.message-box__icon {
|
|
134
|
+
color: $blue-600;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&--success.message-box-type {
|
|
140
|
+
&--solid {
|
|
141
|
+
background-color: rgba($green-600, 1);
|
|
142
|
+
|
|
143
|
+
.message-box__icon {
|
|
144
|
+
color: $white;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&--outline {
|
|
149
|
+
background-color: rgba($green-600, 0.2);
|
|
150
|
+
border: 1px solid $green-600;
|
|
151
|
+
|
|
152
|
+
.message-box__icon {
|
|
153
|
+
color: $green-600;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--outline-dashed {
|
|
158
|
+
background-color: rgba($green-600, 0.2);
|
|
159
|
+
border: 1px dashed $green-600;
|
|
160
|
+
|
|
161
|
+
.message-box__icon {
|
|
162
|
+
color: $green-600;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&--no-outline {
|
|
167
|
+
background-color: rgba($green-600, 0.2);
|
|
168
|
+
|
|
169
|
+
.message-box__icon {
|
|
170
|
+
color: $green-600;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&--glowing {
|
|
175
|
+
background-color: rgba($green-600, 0.2);
|
|
176
|
+
border: 1px solid $green-600;
|
|
177
|
+
box-shadow:
|
|
178
|
+
0 0 8px rgba($green-600, 0.5),
|
|
179
|
+
0 0 16px rgba($green-600, 0.4),
|
|
180
|
+
0 0 24px rgba($green-600, 0.3);
|
|
181
|
+
|
|
182
|
+
.message-box__icon {
|
|
183
|
+
color: $green-600;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&--warning.message-box-type {
|
|
189
|
+
&--solid {
|
|
190
|
+
background-color: rgba($amber-600, 1);
|
|
191
|
+
|
|
192
|
+
.message-box__icon {
|
|
193
|
+
color: $white;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&--outline {
|
|
198
|
+
background-color: rgba($amber-600, 0.2);
|
|
199
|
+
border: 1px solid $amber-600;
|
|
200
|
+
|
|
201
|
+
.message-box__icon {
|
|
202
|
+
color: $amber-600;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&--outline-dashed {
|
|
207
|
+
background-color: rgba($amber-600, 0.2);
|
|
208
|
+
border: 1px dashed $amber-600;
|
|
209
|
+
|
|
210
|
+
.message-box__icon {
|
|
211
|
+
color: $amber-600;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&--no-outline {
|
|
216
|
+
background-color: rgba($amber-600, 0.2);
|
|
217
|
+
|
|
218
|
+
.message-box__icon {
|
|
219
|
+
color: $amber-600;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&--glowing {
|
|
224
|
+
background-color: rgba($amber-600, 0.2);
|
|
225
|
+
border: 1px solid $amber-600;
|
|
226
|
+
box-shadow:
|
|
227
|
+
0 0 8px rgba($amber-600, 0.5),
|
|
228
|
+
0 0 16px rgba($amber-600, 0.4),
|
|
229
|
+
0 0 24px rgba($amber-600, 0.3);
|
|
230
|
+
|
|
231
|
+
.message-box__icon {
|
|
232
|
+
color: $amber-600;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&--error.message-box-type {
|
|
238
|
+
&--solid {
|
|
239
|
+
background-color: rgba($red-600, 1);
|
|
240
|
+
|
|
241
|
+
.message-box__icon {
|
|
242
|
+
color: $white;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&--outline {
|
|
247
|
+
background-color: rgba($red-600, 0.2);
|
|
248
|
+
border: 1px solid $red-600;
|
|
249
|
+
|
|
250
|
+
.message-box__icon {
|
|
251
|
+
color: $red-600;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&--outline-dashed {
|
|
256
|
+
background-color: rgba($red-600, 0.2);
|
|
257
|
+
border: 1px dashed $red-600;
|
|
258
|
+
|
|
259
|
+
.message-box__icon {
|
|
260
|
+
color: $red-600;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&--no-outline {
|
|
265
|
+
background-color: rgba($red-600, 0.2);
|
|
266
|
+
|
|
267
|
+
.message-box__icon {
|
|
268
|
+
color: $red-600;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&--glowing {
|
|
273
|
+
background-color: rgba($red-600, 0.2);
|
|
274
|
+
border: 1px solid $red-600;
|
|
275
|
+
box-shadow:
|
|
276
|
+
0 0 8px rgba($red-600, 0.5),
|
|
277
|
+
0 0 16px rgba($red-600, 0.4),
|
|
278
|
+
0 0 24px rgba($red-600, 0.3);
|
|
279
|
+
|
|
280
|
+
.message-box__icon {
|
|
281
|
+
color: $red-600;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&__icon {
|
|
287
|
+
align-items: center;
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
margin: 0 10px 0 0;
|
|
291
|
+
max-height: 16px;
|
|
292
|
+
max-width: 16px;
|
|
293
|
+
min-height: 16px;
|
|
294
|
+
min-width: 16px;
|
|
295
|
+
|
|
296
|
+
&--default {
|
|
297
|
+
color: $grey-600;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&--info {
|
|
301
|
+
color: $blue-600;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&--success {
|
|
305
|
+
color: $green-600;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&--warning {
|
|
309
|
+
color: $amber-600;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&--error {
|
|
313
|
+
color: $red-600;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
svg {
|
|
317
|
+
width: 100%;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.MessageBox = void 0;
|
|
37
|
+
var React = __importStar(require("react"));
|
|
38
|
+
var utils_1 = require("@aristobyte-ui/utils");
|
|
39
|
+
require("./MessageBox.scss");
|
|
40
|
+
var renderIcon = function (variant) {
|
|
41
|
+
switch (variant) {
|
|
42
|
+
case 'warning':
|
|
43
|
+
return utils_1.Icons.Warning;
|
|
44
|
+
case 'success':
|
|
45
|
+
return utils_1.Icons.Success;
|
|
46
|
+
case 'error':
|
|
47
|
+
return utils_1.Icons.Error;
|
|
48
|
+
case 'info':
|
|
49
|
+
default:
|
|
50
|
+
return utils_1.Icons.Info;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var MessageBox = function (_a) {
|
|
54
|
+
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.withIcon, withIcon = _c === void 0 ? false : _c, _d = _a.customIcon, customIcon = _d === void 0 ? null : _d, _e = _a.radius, radius = _e === void 0 ? 'md' : _e, _f = _a.type, type = _f === void 0 ? 'outline' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.style, style = _h === void 0 ? {} : _h;
|
|
55
|
+
return (React.createElement("div", { className: "message-box ".concat("message-box-type--".concat(type), " ").concat("message-box-radius--".concat(radius), " ").concat("message-box--".concat(variant), " ").concat(className), style: style },
|
|
56
|
+
withIcon && (React.createElement("span", { className: "message-box__icon ".concat("message-box__icon--".concat(variant)) }, (customIcon === null || customIcon === void 0 ? void 0 : customIcon.component({
|
|
57
|
+
size: customIcon.size,
|
|
58
|
+
color: customIcon.color,
|
|
59
|
+
})) || renderIcon(variant)({}))),
|
|
60
|
+
React.createElement("p", { className: "message-box__content", dangerouslySetInnerHTML: { __html: children || '' } })));
|
|
61
|
+
};
|
|
62
|
+
exports.MessageBox = MessageBox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MessageBox"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristobyte-ui/message-box",
|
|
3
3
|
"description": "A fully-typed, modular, and flexible MessageBox component for AristoByteUI, supporting multiple variants, types, border-radius options, and optional icons.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "AristoByte <info@aristobyte.com>",
|
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
"module": "es/src/main/index.js",
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^19.1.0",
|
|
48
|
-
"react-dom": "^19.1.0"
|
|
48
|
+
"react-dom": "^19.1.0",
|
|
49
|
+
"sass": "^1.97.3"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@aristobyte-ui/utils": "2.
|
|
52
|
+
"@aristobyte-ui/utils": "2.5.0"
|
|
52
53
|
}
|
|
53
54
|
}
|
package/README.md
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# @aristobyte-ui/message-box
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://img.shields.io/badge/TypeScript-5.8-blue?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
|
|
5
|
-
<img src="https://img.shields.io/badge/Build-Turbo-green?style=for-the-badge&logo=turbo&logoColor=white" alt="TurboRepo" />
|
|
6
|
-
<img src="https://img.shields.io/badge/Lint-Strict-red?style=for-the-badge&logo=eslint&logoColor=white" alt="ESLint" />
|
|
7
|
-
<img src="https://img.shields.io/badge/License-MIT-black?style=for-the-badge&logo=open-source-initiative&logoColor=white" alt="License" />
|
|
8
|
-
<img src="https://img.shields.io/badge/AristoByte-UI-purple?style=for-the-badge&logo=react&logoColor=white" alt="AristoByte UI" />
|
|
9
|
-
<img src="https://img.shields.io/badge/Node-20.17.0+-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js >=20.17.0" />
|
|
10
|
-
<img src="https://img.shields.io/badge/Yarn-1.22+-2C8EBB?style=for-the-badge&logo=yarn&logoColor=white" alt="Yarn >=1.22" />
|
|
11
|
-
<img src="https://img.shields.io/badge/NPM-10.8+-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM >=10.8" />
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
A fully typed, customizable MessageBox component for React, supporting multiple variants, types, border-radius options, and optional icons. Built with AristoByteUI design tokens and SCSS modules, leveraging the `@aristobyte-ui/utils` package for icons.
|
|
15
|
-
|
|
16
|
-
## 📦 Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install via Yarn
|
|
20
|
-
yarn add -D @aristobyte-ui/message-box
|
|
21
|
-
|
|
22
|
-
# Or via npm
|
|
23
|
-
npm install -D @aristobyte-ui/message-box
|
|
24
|
-
|
|
25
|
-
# Or via pnpm
|
|
26
|
-
pnpm add -D @aristobyte-ui/message-box
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 🛠 Usage
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
import { MessageBox } from '@aristobyte-ui/message-box';
|
|
33
|
-
|
|
34
|
-
export default function App() {
|
|
35
|
-
return (
|
|
36
|
-
<div>
|
|
37
|
-
<MessageBox variant="success" type="solid" radius="md" withIcon>
|
|
38
|
-
This is a success message!
|
|
39
|
-
</MessageBox>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## 📂 Presets Available
|
|
46
|
-
|
|
47
|
-
- **Variants**: `default`, `info`, `warning`, `success`, `error`
|
|
48
|
-
- **Types**: `solid`, `outline`, `outline-dashed`, `no-outline`, `glowing`
|
|
49
|
-
- **Radius options**: `none`, `sm`, `md`, `lg`, `full`
|
|
50
|
-
- **Icons**: optional via `withIcon` or custom via `customIcon` prop
|
|
51
|
-
|
|
52
|
-
## 🔧 Example in a Package
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
<MessageBox variant="warning" type="outline-dashed" radius="lg" withIcon>
|
|
56
|
-
Warning! Check your input.
|
|
57
|
-
</MessageBox>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## 📊 Why This Matters
|
|
61
|
-
|
|
62
|
-
- **Performance-first:** Lightweight CSS ensures fast rendering and smooth transitions.
|
|
63
|
-
- **Fully typed:** TypeScript-first API ensures predictable usage and IDE autocomplete.
|
|
64
|
-
- **AristoByteUI ready:** Seamlessly integrates with design tokens and SCSS modules.
|
|
65
|
-
- **Flexible:** Supports multiple variants, types, border-radius options, and optional icons.
|
|
66
|
-
|
|
67
|
-
## 🏆 Philosophy
|
|
68
|
-
|
|
69
|
-
- **Modular architecture:** MessageBox component is fully composable.
|
|
70
|
-
- **Declarative styling:** SCSS modules keep styles maintainable and scoped.
|
|
71
|
-
- **Strict typing & runtime flexibility:** Props fully typed while allowing runtime overrides.
|
|
72
|
-
- **Developer experience optimized:** Easy to use with predictable behavior and minimal boilerplate.
|
|
73
|
-
|
|
74
|
-
## 📜 License
|
|
75
|
-
|
|
76
|
-
[MIT](./LICENSE) © AristoByte
|
|
77
|
-
|
|
78
|
-
## 🛡 Shields Showcase
|
|
79
|
-
|
|
80
|
-
<p align="center">
|
|
81
|
-
<img src="https://img.shields.io/badge/Consistency-100%25-green?style=for-the-badge&logo=typescript" />
|
|
82
|
-
<img src="https://img.shields.io/badge/Maintained-Active-brightgreen?style=for-the-badge&logo=github" />
|
|
83
|
-
<img src="https://img.shields.io/badge/Strictness-High-critical?style=for-the-badge&logo=eslint" />
|
|
84
|
-
<img src="https://img.shields.io/badge/Declarations-Enabled-blue?style=for-the-badge&logo=typescript" />
|
|
85
|
-
<img src="https://img.shields.io/badge/Monorepo-Turbo-green?style=for-the-badge&logo=monorepo" />
|
|
86
|
-
<img src="https://img.shields.io/badge/Interop-ESM%2FCJS-orange?style=for-the-badge&logo=javascript" />
|
|
87
|
-
</p>
|