@aristobyte-ui/message-box 2.1.8 → 2.2.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/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.1.8",
4
+ "version": "2.2.0",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "author": "AristoByte <info@aristobyte.com>",
@@ -35,7 +35,8 @@
35
35
  "composable"
36
36
  ],
37
37
  "files": [
38
- "dist"
38
+ "es",
39
+ "lib"
39
40
  ],
40
41
  "publishConfig": {
41
42
  "access": "public"
@@ -47,6 +48,6 @@
47
48
  "react-dom": "^19.1.0"
48
49
  },
49
50
  "dependencies": {
50
- "@aristobyte-ui/utils": "2.1.8"
51
+ "@aristobyte-ui/utils": "2.2.0"
51
52
  }
52
53
  }
@@ -1,320 +0,0 @@
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
- }
@@ -1,25 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export * from './MessageBox';
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1,320 +0,0 @@
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
- }
@@ -1,62 +0,0 @@
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;
@@ -1,17 +0,0 @@
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);
@@ -1,17 +0,0 @@
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);