@aristobyte-ui/message-box 2.11.2 → 2.13.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.
@@ -37,60 +37,299 @@
37
37
  line-height: $line-height-normal;
38
38
  }
39
39
 
40
- @mixin message-box-variant($name, $color) {
41
- &--#{$name}.message-box-type--solid {
42
- background-color: rgba($color, 1);
40
+ &--default.message-box-appearance {
41
+ &--solid {
42
+ background-color: rgba($color-default, 1);
43
43
 
44
44
  .message-box__icon {
45
45
  color: $white;
46
46
  }
47
47
  }
48
48
 
49
- &--#{$name}.message-box-type--outline {
50
- background-color: rgba($color, 0.2);
51
- border: 1px solid $color;
49
+ &--outline {
50
+ background-color: rgba($color-default, 0.2);
51
+ border: 1px solid $color-default;
52
52
 
53
53
  .message-box__icon {
54
- color: $color;
54
+ color: $color-default;
55
55
  }
56
56
  }
57
57
 
58
- &--#{$name}.message-box-type--outline-dashed {
59
- background-color: rgba($color, 0.2);
60
- border: 1px dashed $color;
58
+ &--outline-dashed {
59
+ background-color: rgba($color-default, 0.2);
60
+ border: 1px dashed $color-default;
61
61
 
62
62
  .message-box__icon {
63
- color: $color;
63
+ color: $color-default;
64
64
  }
65
65
  }
66
66
 
67
- &--#{$name}.message-box-type--no-outline {
68
- background-color: rgba($color, 0.2);
67
+ &--no-outline {
68
+ background-color: rgba($color-default, 0.2);
69
69
 
70
70
  .message-box__icon {
71
- color: $color;
71
+ color: $color-default;
72
72
  }
73
73
  }
74
74
 
75
- &--#{$name}.message-box-type--glowing {
76
- background-color: rgba($color, 0.2);
77
- border: 1px solid $color;
75
+ &--glowing {
76
+ background-color: rgba($color-default, 0.2);
77
+ border: 1px solid $color-default;
78
78
  box-shadow:
79
- 0 0 8px rgba($color, 0.5),
80
- 0 0 16px rgba($color, 0.4),
81
- 0 0 24px rgba($color, 0.3);
79
+ 0 0 8px rgba($color-default, 0.5),
80
+ 0 0 16px rgba($color-default, 0.4),
81
+ 0 0 24px rgba($color-default, 0.3);
82
82
 
83
83
  .message-box__icon {
84
- color: $color;
84
+ color: $color-default;
85
85
  }
86
86
  }
87
87
  }
88
88
 
89
- @include message-box-variant('default', $grey-600);
90
- @include message-box-variant('info', $blue-600);
91
- @include message-box-variant('success', $green-600);
92
- @include message-box-variant('warning', $amber-600);
93
- @include message-box-variant('error', $red-600);
89
+ &--primary.message-box-appearance {
90
+ &--solid {
91
+ background-color: rgba($color-primary, 1);
92
+
93
+ .message-box__icon {
94
+ color: $white;
95
+ }
96
+ }
97
+
98
+ &--outline {
99
+ background-color: rgba($color-primary, 0.2);
100
+ border: 1px solid $color-primary;
101
+
102
+ .message-box__icon {
103
+ color: $color-primary;
104
+ }
105
+ }
106
+
107
+ &--outline-dashed {
108
+ background-color: rgba($color-primary, 0.2);
109
+ border: 1px dashed $color-primary;
110
+
111
+ .message-box__icon {
112
+ color: $color-primary;
113
+ }
114
+ }
115
+
116
+ &--no-outline {
117
+ background-color: rgba($color-primary, 0.2);
118
+
119
+ .message-box__icon {
120
+ color: $color-primary;
121
+ }
122
+ }
123
+
124
+ &--glowing {
125
+ background-color: rgba($color-primary, 0.2);
126
+ border: 1px solid $color-primary;
127
+ box-shadow:
128
+ 0 0 8px rgba($color-primary, 0.5),
129
+ 0 0 16px rgba($color-primary, 0.4),
130
+ 0 0 24px rgba($color-primary, 0.3);
131
+
132
+ .message-box__icon {
133
+ color: $color-primary;
134
+ }
135
+ }
136
+ }
137
+
138
+ &--secondary.message-box-appearance {
139
+ &--solid {
140
+ background-color: rgba($color-secondary, 1);
141
+
142
+ .message-box__icon {
143
+ color: $white;
144
+ }
145
+ }
146
+
147
+ &--outline {
148
+ background-color: rgba($color-secondary, 0.2);
149
+ border: 1px solid $color-secondary;
150
+
151
+ .message-box__icon {
152
+ color: $color-secondary;
153
+ }
154
+ }
155
+
156
+ &--outline-dashed {
157
+ background-color: rgba($color-secondary, 0.2);
158
+ border: 1px dashed $color-secondary;
159
+
160
+ .message-box__icon {
161
+ color: $color-secondary;
162
+ }
163
+ }
164
+
165
+ &--no-outline {
166
+ background-color: rgba($color-secondary, 0.2);
167
+
168
+ .message-box__icon {
169
+ color: $color-secondary;
170
+ }
171
+ }
172
+
173
+ &--glowing {
174
+ background-color: rgba($color-secondary, 0.2);
175
+ border: 1px solid $color-secondary;
176
+ box-shadow:
177
+ 0 0 8px rgba($color-secondary, 0.5),
178
+ 0 0 16px rgba($color-secondary, 0.4),
179
+ 0 0 24px rgba($color-secondary, 0.3);
180
+
181
+ .message-box__icon {
182
+ color: $color-secondary;
183
+ }
184
+ }
185
+ }
186
+
187
+ &--success.message-box-appearance {
188
+ &--solid {
189
+ background-color: rgba($color-success, 1);
190
+
191
+ .message-box__icon {
192
+ color: $white;
193
+ }
194
+ }
195
+
196
+ &--outline {
197
+ background-color: rgba($color-success, 0.2);
198
+ border: 1px solid $color-success;
199
+
200
+ .message-box__icon {
201
+ color: $color-success;
202
+ }
203
+ }
204
+
205
+ &--outline-dashed {
206
+ background-color: rgba($color-success, 0.2);
207
+ border: 1px dashed $color-success;
208
+
209
+ .message-box__icon {
210
+ color: $color-success;
211
+ }
212
+ }
213
+
214
+ &--no-outline {
215
+ background-color: rgba($color-success, 0.2);
216
+
217
+ .message-box__icon {
218
+ color: $color-success;
219
+ }
220
+ }
221
+
222
+ &--glowing {
223
+ background-color: rgba($color-success, 0.2);
224
+ border: 1px solid $color-success;
225
+ box-shadow:
226
+ 0 0 8px rgba($color-success, 0.5),
227
+ 0 0 16px rgba($color-success, 0.4),
228
+ 0 0 24px rgba($color-success, 0.3);
229
+
230
+ .message-box__icon {
231
+ color: $color-success;
232
+ }
233
+ }
234
+ }
235
+
236
+ &--warning.message-box-appearance {
237
+ &--solid {
238
+ background-color: rgba($color-warning, 1);
239
+
240
+ .message-box__icon {
241
+ color: $white;
242
+ }
243
+ }
244
+
245
+ &--outline {
246
+ background-color: rgba($color-warning, 0.2);
247
+ border: 1px solid $color-warning;
248
+
249
+ .message-box__icon {
250
+ color: $color-warning;
251
+ }
252
+ }
253
+
254
+ &--outline-dashed {
255
+ background-color: rgba($color-warning, 0.2);
256
+ border: 1px dashed $color-warning;
257
+
258
+ .message-box__icon {
259
+ color: $color-warning;
260
+ }
261
+ }
262
+
263
+ &--no-outline {
264
+ background-color: rgba($color-warning, 0.2);
265
+
266
+ .message-box__icon {
267
+ color: $color-warning;
268
+ }
269
+ }
270
+
271
+ &--glowing {
272
+ background-color: rgba($color-warning, 0.2);
273
+ border: 1px solid $color-warning;
274
+ box-shadow:
275
+ 0 0 8px rgba($color-warning, 0.5),
276
+ 0 0 16px rgba($color-warning, 0.4),
277
+ 0 0 24px rgba($color-warning, 0.3);
278
+
279
+ .message-box__icon {
280
+ color: $color-warning;
281
+ }
282
+ }
283
+ }
284
+
285
+ &--error.message-box-appearance {
286
+ &--solid {
287
+ background-color: rgba($color-error, 1);
288
+
289
+ .message-box__icon {
290
+ color: $white;
291
+ }
292
+ }
293
+
294
+ &--outline {
295
+ background-color: rgba($color-error, 0.2);
296
+ border: 1px solid $color-error;
297
+
298
+ .message-box__icon {
299
+ color: $color-error;
300
+ }
301
+ }
302
+
303
+ &--outline-dashed {
304
+ background-color: rgba($color-error, 0.2);
305
+ border: 1px dashed $color-error;
306
+
307
+ .message-box__icon {
308
+ color: $color-error;
309
+ }
310
+ }
311
+
312
+ &--no-outline {
313
+ background-color: rgba($color-error, 0.2);
314
+
315
+ .message-box__icon {
316
+ color: $color-error;
317
+ }
318
+ }
319
+
320
+ &--glowing {
321
+ background-color: rgba($color-error, 0.2);
322
+ border: 1px solid $color-error;
323
+ box-shadow:
324
+ 0 0 8px rgba($color-error, 0.5),
325
+ 0 0 16px rgba($color-error, 0.4),
326
+ 0 0 24px rgba($color-error, 0.3);
327
+
328
+ .message-box__icon {
329
+ color: $color-error;
330
+ }
331
+ }
332
+ }
94
333
 
95
334
  &__icon {
96
335
  align-items: center;
@@ -103,23 +342,27 @@
103
342
  min-width: 16px;
104
343
 
105
344
  &--default {
106
- color: $grey-600;
345
+ color: $color-default;
346
+ }
347
+
348
+ &--primary {
349
+ color: $color-primary;
107
350
  }
108
351
 
109
- &--info {
110
- color: $blue-600;
352
+ &--secondary {
353
+ color: $color-secondary;
111
354
  }
112
355
 
113
356
  &--success {
114
- color: $green-600;
357
+ color: $color-success;
115
358
  }
116
359
 
117
360
  &--warning {
118
- color: $amber-600;
361
+ color: $color-warning;
119
362
  }
120
363
 
121
364
  &--error {
122
- color: $red-600;
365
+ color: $color-error;
123
366
  }
124
367
 
125
368
  svg {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { type IconPropsType } from '@aristobyte-ui/utils';
3
3
  import './MessageBox.scss';
4
- type MessageBoxVariant = 'default' | 'info' | 'warning' | 'success' | 'error';
4
+ type MessageBoxVariant = 'default' | 'primary' | 'secondary' | 'warning' | 'success' | 'error';
5
5
  export interface IMessageBox {
6
6
  variant?: MessageBoxVariant;
7
7
  children?: React.ReactElement | React.ReactNode | string;
@@ -12,7 +12,7 @@ export interface IMessageBox {
12
12
  color?: string;
13
13
  };
14
14
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
15
- type?: 'solid' | 'outline' | 'outline-dashed' | 'no-outline' | 'glowing';
15
+ appearance?: 'solid' | 'outline' | 'outline-dashed' | 'no-outline' | 'glowing';
16
16
  className?: string;
17
17
  style?: React.CSSProperties;
18
18
  }
@@ -45,18 +45,28 @@ var renderIcon = function (variant) {
45
45
  return utils_1.Icons.Success;
46
46
  case 'error':
47
47
  return utils_1.Icons.Error;
48
- case 'info':
48
+ case 'default':
49
+ case 'primary':
50
+ case 'secondary':
49
51
  default:
50
52
  return utils_1.Icons.Info;
51
53
  }
52
54
  };
53
55
  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({
56
+ 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.appearance, appearance = _f === void 0 ? 'outline' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.style, style = _h === void 0 ? {} : _h;
57
+ return (React.createElement("div", { className: [
58
+ 'message-box',
59
+ "message-box-appearance--".concat(appearance),
60
+ "message-box-radius--".concat(radius),
61
+ "message-box--".concat(variant),
62
+ className,
63
+ ]
64
+ .filter(Boolean)
65
+ .join(' '), style: style },
66
+ withIcon && (React.createElement("span", { className: ['message-box__icon', "message-box__icon--".concat(variant)].filter(Boolean).join(' ') }, (customIcon === null || customIcon === void 0 ? void 0 : customIcon.component({
57
67
  size: customIcon.size,
58
68
  color: customIcon.color,
59
69
  })) || renderIcon(variant)({}))),
60
- React.createElement("p", { className: "message-box__content", dangerouslySetInnerHTML: { __html: children || '' } })));
70
+ React.createElement("p", { className: 'message-box__content', dangerouslySetInnerHTML: { __html: children || '' } })));
61
71
  };
62
72
  exports.MessageBox = MessageBox;
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.11.2",
4
+ "version": "2.13.0",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "author": "AristoByte <info@aristobyte.com>",
@@ -50,7 +50,7 @@
50
50
  "sass": "^1.97.3"
51
51
  },
52
52
  "dependencies": {
53
- "@aristobyte-ui/utils": "^2.11.2"
53
+ "@aristobyte-ui/utils": "^2.13.0"
54
54
  },
55
55
  "exports": {
56
56
  ".": {