@aristobyte-ui/message-box 1.0.112 → 2.1.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/README.md CHANGED
@@ -29,7 +29,7 @@ pnpm add -D @aristobyte-ui/message-box
29
29
  ## 🛠 Usage
30
30
 
31
31
  ```tsx
32
- import { MessageBox } from "@aristobyte-ui/message-box";
32
+ import { MessageBox } from '@aristobyte-ui/message-box';
33
33
 
34
34
  export default function App() {
35
35
  return (
@@ -0,0 +1,320 @@
1
+ @use '@aristobyte-ui/utils/styles/settings' 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/settings' 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,11 +1,11 @@
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": "1.0.112",
4
+ "version": "2.1.0",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "author": "AristoByte <info@aristobyte.com>",
8
- "homepage": "https://www.npmjs.com/package/@aristobyte-ui/message-box",
8
+ "homepage": "https://www.npmjs.com/package/@aristobyte-ui/PACKAGE_NAME",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/aristobyte-team/aristobyte-ui.git",
@@ -40,37 +40,13 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "main": "dist/index.js",
44
- "module": "dist/index.mjs",
45
- "types": "dist/index.d.ts",
46
- "exports": {
47
- ".": {
48
- "import": "./dist/index.mjs",
49
- "require": "./dist/index.js"
50
- }
51
- },
52
- "scripts": {
53
- "build": "tsup",
54
- "lint": "eslint . --max-warnings 0",
55
- "generate:component": "turbo gen react-component",
56
- "check-types": "tsc --noEmit"
57
- },
43
+ "main": "dist/lib/main/index.js",
44
+ "module": "dist/es/main/index.js",
58
45
  "peerDependencies": {
59
46
  "react": "^19.1.0",
60
47
  "react-dom": "^19.1.0"
61
48
  },
62
49
  "dependencies": {
63
- "@aristobyte-ui/utils": "^1.0.112"
64
- },
65
- "devDependencies": {
66
- "@aristobyte-ui/eslint-config": "^1.0.112",
67
- "@aristobyte-ui/typescript-config": "^1.0.112",
68
- "@turbo/gen": "^2.5.0",
69
- "@types/node": "^24.3.0",
70
- "@types/react": "19.1.0",
71
- "@types/react-dom": "19.1.1",
72
- "eslint": "^9.27.0",
73
- "tsup": "^8.5.0",
74
- "typescript": "^5.8.3"
50
+ "@aristobyte-ui/utils": "^2.1.0"
75
51
  }
76
52
  }
package/dist/index.d.mts DELETED
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import { IconPropsType } from '@aristobyte-ui/utils';
3
-
4
- type MessageBoxVariant = "default" | "primary" | "secondary" | "warning" | "success" | "error";
5
- type MessageBoxType = "solid" | "outline" | "outline-dashed" | "no-outline" | "glowing";
6
- type MessageBoxRadius = "none" | "sm" | "md" | "lg" | "full";
7
- interface IMessageBox {
8
- variant?: MessageBoxVariant;
9
- children?: React.ReactElement | React.ReactNode | string;
10
- withIcon?: boolean;
11
- customIcon?: {
12
- component: (props: IconPropsType) => React.JSX.Element;
13
- size?: number;
14
- color?: string;
15
- };
16
- radius?: MessageBoxRadius;
17
- type?: MessageBoxType;
18
- className?: string;
19
- style?: React.CSSProperties;
20
- }
21
- declare const MessageBox: React.FC<IMessageBox>;
22
-
23
- export { type IMessageBox, MessageBox };
package/dist/index.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import { IconPropsType } from '@aristobyte-ui/utils';
3
-
4
- type MessageBoxVariant = "default" | "primary" | "secondary" | "warning" | "success" | "error";
5
- type MessageBoxType = "solid" | "outline" | "outline-dashed" | "no-outline" | "glowing";
6
- type MessageBoxRadius = "none" | "sm" | "md" | "lg" | "full";
7
- interface IMessageBox {
8
- variant?: MessageBoxVariant;
9
- children?: React.ReactElement | React.ReactNode | string;
10
- withIcon?: boolean;
11
- customIcon?: {
12
- component: (props: IconPropsType) => React.JSX.Element;
13
- size?: number;
14
- color?: string;
15
- };
16
- radius?: MessageBoxRadius;
17
- type?: MessageBoxType;
18
- className?: string;
19
- style?: React.CSSProperties;
20
- }
21
- declare const MessageBox: React.FC<IMessageBox>;
22
-
23
- export { type IMessageBox, MessageBox };
package/dist/index.js DELETED
@@ -1,102 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- MessageBox: () => MessageBox
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
-
28
- // ../../node_modules/clsx/dist/clsx.mjs
29
- function r(e) {
30
- var t, f, n = "";
31
- if ("string" == typeof e || "number" == typeof e) n += e;
32
- else if ("object" == typeof e) if (Array.isArray(e)) {
33
- var o = e.length;
34
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
35
- } else for (f in e) e[f] && (n && (n += " "), n += f);
36
- return n;
37
- }
38
- function clsx() {
39
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
40
- return n;
41
- }
42
- var clsx_default = clsx;
43
-
44
- // components/MessageBox.tsx
45
- var import_utils = require("@aristobyte-ui/utils");
46
- var import_jsx_runtime = require("react/jsx-runtime");
47
- var renderIcon = (variant) => {
48
- switch (variant) {
49
- case "warning":
50
- return import_utils.Icons.Warning;
51
- case "success":
52
- return import_utils.Icons.Success;
53
- case "error":
54
- return import_utils.Icons.Error;
55
- case "primary":
56
- case "secondary":
57
- default:
58
- return import_utils.Icons.Info;
59
- }
60
- };
61
- var MessageBox = ({
62
- children,
63
- variant = "default",
64
- withIcon = false,
65
- customIcon = null,
66
- radius = "md",
67
- type = "outline",
68
- className = "",
69
- style = {}
70
- }) => {
71
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
72
- "div",
73
- {
74
- className: clsx_default(
75
- "message-box",
76
- `message-box--${variant}`,
77
- `message-box-type--${type}`,
78
- `message-box-radius-${radius}`,
79
- className
80
- ),
81
- style,
82
- children: [
83
- withIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: clsx_default("message-box__icon"), children: (customIcon == null ? void 0 : customIcon.component({
84
- size: customIcon.size,
85
- color: customIcon.color
86
- })) || renderIcon(variant)({}) }),
87
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
- "p",
89
- {
90
- className: "message-box__content",
91
- dangerouslySetInnerHTML: { __html: children || "" }
92
- }
93
- )
94
- ]
95
- }
96
- );
97
- };
98
- // Annotate the CommonJS export names for ESM import in node:
99
- 0 && (module.exports = {
100
- MessageBox
101
- });
102
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../index.ts","../../../node_modules/clsx/dist/clsx.mjs","../components/MessageBox.tsx"],"sourcesContent":["export * from \"./components\";\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { type IconPropsType, Icons } from \"@aristobyte-ui/utils\";\n\ntype MessageBoxVariant =\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"warning\"\n | \"success\"\n | \"error\";\ntype MessageBoxType =\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\ntype MessageBoxRadius = \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n\nexport interface IMessageBox {\n variant?: MessageBoxVariant;\n children?: React.ReactElement | React.ReactNode | string;\n withIcon?: boolean;\n customIcon?: {\n component: (props: IconPropsType) => React.JSX.Element;\n size?: number;\n color?: string;\n };\n radius?: MessageBoxRadius;\n type?: MessageBoxType;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst renderIcon = (variant: MessageBoxVariant) => {\n switch (variant) {\n case \"warning\":\n return Icons.Warning;\n case \"success\":\n return Icons.Success;\n case \"error\":\n return Icons.Error;\n case \"primary\":\n case \"secondary\":\n default:\n return Icons.Info;\n }\n};\n\nexport const MessageBox: React.FC<IMessageBox> = ({\n children,\n variant = \"default\",\n withIcon = false,\n customIcon = null,\n radius = \"md\",\n type = \"outline\",\n className = \"\",\n style = {},\n}) => {\n return (\n <div\n className={clsx(\n \"message-box\",\n `message-box--${variant}`,\n `message-box-type--${type}`,\n `message-box-radius-${radius}`,\n className\n )}\n style={style}\n >\n {withIcon && (\n <span className={clsx(\"message-box__icon\")}>\n {customIcon?.component({\n size: customIcon.size,\n color: customIcon.color,\n }) || renderIcon(variant)({})}\n </span>\n )}\n <p\n className=\"message-box__content\"\n dangerouslySetInnerHTML={{ __html: children || \"\" }}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;;;ACI/X,mBAA0C;AA0DtC;AA1BJ,IAAM,aAAa,CAAC,YAA+B;AACjD,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO,mBAAM;AAAA,IACf,KAAK;AACH,aAAO,mBAAM;AAAA,IACf,KAAK;AACH,aAAO,mBAAM;AAAA,IACf,KAAK;AAAA,IACL,KAAK;AAAA,IACL;AACE,aAAO,mBAAM;AAAA,EACjB;AACF;AAEO,IAAM,aAAoC,CAAC;AAAA,EAChD;AAAA,EACA,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ,CAAC;AACX,MAAM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,OAAO;AAAA,QACvB,qBAAqB,IAAI;AAAA,QACzB,sBAAsB,MAAM;AAAA,QAC5B;AAAA,MACF;AAAA,MACA;AAAA,MAEC;AAAA,oBACC,4CAAC,UAAK,WAAW,aAAK,mBAAmB,GACtC,oDAAY,UAAU;AAAA,UACrB,MAAM,WAAW;AAAA,UACjB,OAAO,WAAW;AAAA,QACpB,OAAM,WAAW,OAAO,EAAE,CAAC,CAAC,GAC9B;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,yBAAyB,EAAE,QAAQ,YAAY,GAAG;AAAA;AAAA,QACpD;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
package/dist/index.mjs DELETED
@@ -1,76 +0,0 @@
1
- "use client";
2
-
3
- // ../../node_modules/clsx/dist/clsx.mjs
4
- function r(e) {
5
- var t, f, n = "";
6
- if ("string" == typeof e || "number" == typeof e) n += e;
7
- else if ("object" == typeof e) if (Array.isArray(e)) {
8
- var o = e.length;
9
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
10
- } else for (f in e) e[f] && (n && (n += " "), n += f);
11
- return n;
12
- }
13
- function clsx() {
14
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
15
- return n;
16
- }
17
- var clsx_default = clsx;
18
-
19
- // components/MessageBox.tsx
20
- import { Icons } from "@aristobyte-ui/utils";
21
- import { jsx, jsxs } from "react/jsx-runtime";
22
- var renderIcon = (variant) => {
23
- switch (variant) {
24
- case "warning":
25
- return Icons.Warning;
26
- case "success":
27
- return Icons.Success;
28
- case "error":
29
- return Icons.Error;
30
- case "primary":
31
- case "secondary":
32
- default:
33
- return Icons.Info;
34
- }
35
- };
36
- var MessageBox = ({
37
- children,
38
- variant = "default",
39
- withIcon = false,
40
- customIcon = null,
41
- radius = "md",
42
- type = "outline",
43
- className = "",
44
- style = {}
45
- }) => {
46
- return /* @__PURE__ */ jsxs(
47
- "div",
48
- {
49
- className: clsx_default(
50
- "message-box",
51
- `message-box--${variant}`,
52
- `message-box-type--${type}`,
53
- `message-box-radius-${radius}`,
54
- className
55
- ),
56
- style,
57
- children: [
58
- withIcon && /* @__PURE__ */ jsx("span", { className: clsx_default("message-box__icon"), children: (customIcon == null ? void 0 : customIcon.component({
59
- size: customIcon.size,
60
- color: customIcon.color
61
- })) || renderIcon(variant)({}) }),
62
- /* @__PURE__ */ jsx(
63
- "p",
64
- {
65
- className: "message-box__content",
66
- dangerouslySetInnerHTML: { __html: children || "" }
67
- }
68
- )
69
- ]
70
- }
71
- );
72
- };
73
- export {
74
- MessageBox
75
- };
76
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/clsx/dist/clsx.mjs","../components/MessageBox.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { type IconPropsType, Icons } from \"@aristobyte-ui/utils\";\n\ntype MessageBoxVariant =\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"warning\"\n | \"success\"\n | \"error\";\ntype MessageBoxType =\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\ntype MessageBoxRadius = \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n\nexport interface IMessageBox {\n variant?: MessageBoxVariant;\n children?: React.ReactElement | React.ReactNode | string;\n withIcon?: boolean;\n customIcon?: {\n component: (props: IconPropsType) => React.JSX.Element;\n size?: number;\n color?: string;\n };\n radius?: MessageBoxRadius;\n type?: MessageBoxType;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst renderIcon = (variant: MessageBoxVariant) => {\n switch (variant) {\n case \"warning\":\n return Icons.Warning;\n case \"success\":\n return Icons.Success;\n case \"error\":\n return Icons.Error;\n case \"primary\":\n case \"secondary\":\n default:\n return Icons.Info;\n }\n};\n\nexport const MessageBox: React.FC<IMessageBox> = ({\n children,\n variant = \"default\",\n withIcon = false,\n customIcon = null,\n radius = \"md\",\n type = \"outline\",\n className = \"\",\n style = {},\n}) => {\n return (\n <div\n className={clsx(\n \"message-box\",\n `message-box--${variant}`,\n `message-box-type--${type}`,\n `message-box-radius-${radius}`,\n className\n )}\n style={style}\n >\n {withIcon && (\n <span className={clsx(\"message-box__icon\")}>\n {customIcon?.component({\n size: customIcon.size,\n color: customIcon.color,\n }) || renderIcon(variant)({})}\n </span>\n )}\n <p\n className=\"message-box__content\"\n dangerouslySetInnerHTML={{ __html: children || \"\" }}\n />\n </div>\n );\n};\n"],"mappings":";;;AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;;;ACI/X,SAA6B,aAAa;AA0DtC,SAWI,KAXJ;AA1BJ,IAAM,aAAa,CAAC,YAA+B;AACjD,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AAAA,IACL,KAAK;AAAA,IACL;AACE,aAAO,MAAM;AAAA,EACjB;AACF;AAEO,IAAM,aAAoC,CAAC;AAAA,EAChD;AAAA,EACA,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ,CAAC;AACX,MAAM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,OAAO;AAAA,QACvB,qBAAqB,IAAI;AAAA,QACzB,sBAAsB,MAAM;AAAA,QAC5B;AAAA,MACF;AAAA,MACA;AAAA,MAEC;AAAA,oBACC,oBAAC,UAAK,WAAW,aAAK,mBAAmB,GACtC,oDAAY,UAAU;AAAA,UACrB,MAAM,WAAW;AAAA,UACjB,OAAO,WAAW;AAAA,QACpB,OAAM,WAAW,OAAO,EAAE,CAAC,CAAC,GAC9B;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,yBAAyB,EAAE,QAAQ,YAAY,GAAG;AAAA;AAAA,QACpD;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}