@weni/unnnic-system 2.33.6 → 2.34.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "2.33.6",
3
+ "version": "2.34.0",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -88,6 +88,7 @@
88
88
  @click.stop="status === 'failed' ? $emit('click') : () => {}"
89
89
  />
90
90
  </div>
91
+
91
92
  <UnnnicIconLoading
92
93
  v-if="sendingMedia"
93
94
  size="avatar-nano"
@@ -116,13 +117,20 @@
116
117
  />
117
118
  </UnnnicTooltip>
118
119
  </section>
119
-
120
- <p
120
+ <section
121
121
  v-else
122
- class="unnnic-chats-message__time"
122
+ class="unnnic-chats-message__time-container"
123
123
  >
124
- {{ formattedTime }}
125
- </p>
124
+ <p class="unnnic-chats-message__time">
125
+ {{ formattedTime }}
126
+ </p>
127
+ <UnnnicIcon
128
+ v-if="type === 'sent'"
129
+ :icon="messageStatusIcon"
130
+ size="sm"
131
+ :scheme="status === 'read' ? 'aux-blue-500' : 'neutral-clean'"
132
+ />
133
+ </section>
126
134
  </main>
127
135
  </section>
128
136
  </template>
@@ -179,7 +187,9 @@ export default {
179
187
  type: String,
180
188
  default: 'sent',
181
189
  validate(status) {
182
- return ['sending', 'sent', 'failed'].includes(status);
190
+ return ['sending', 'sent', 'failed', 'received', 'read'].includes(
191
+ status,
192
+ );
183
193
  },
184
194
  },
185
195
  mediaType: {
@@ -251,6 +261,13 @@ export default {
251
261
  failedToSendMedia() {
252
262
  return (this.isImage || this.isVideo) && this.status === 'failed';
253
263
  },
264
+ messageStatusIcon() {
265
+ if (this.status === 'sending') return 'history';
266
+
267
+ return this.status === 'received' || this.status === 'read'
268
+ ? 'done_all'
269
+ : 'done';
270
+ },
254
271
  },
255
272
 
256
273
  methods: {
@@ -284,7 +301,7 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
284
301
 
285
302
  border-radius: $unnnic-border-radius-md;
286
303
 
287
- padding: $unnnic-spacing-xs;
304
+ padding: $unnnic-spacing-xs $unnnic-spacing-ant;
288
305
 
289
306
  background-color: $unnnic-color-neutral-white;
290
307
 
@@ -295,7 +312,7 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
295
312
  &__tooltip {
296
313
  display: flex;
297
314
  justify-content: end;
298
- min-width: 30px;
315
+ min-width: 50.88px;
299
316
  }
300
317
 
301
318
  &__reply-message {
@@ -322,7 +339,7 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
322
339
  display: flex;
323
340
  align-items: flex-end;
324
341
  justify-content: space-between;
325
- gap: $unnnic-spacing-xs;
342
+ gap: $unnnic-spacing-sm;
326
343
 
327
344
  & > * {
328
345
  margin: 0;
@@ -400,10 +417,26 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
400
417
  font-weight: $unnnic-font-weight-bold;
401
418
  }
402
419
 
420
+ &__status-time {
421
+ display: flex;
422
+ align-items: center;
423
+ justify-content: end;
424
+ gap: $unnnic-spacing-nano;
425
+ min-width: 51px;
426
+ }
427
+
403
428
  &__time {
404
429
  font-size: $unnnic-font-size-body-md;
405
430
  line-height: $defaultLineHeight;
406
431
  color: $unnnic-color-neutral-clean;
432
+ margin: 0;
433
+ padding: 0;
434
+
435
+ &-container {
436
+ display: flex;
437
+ align-items: center;
438
+ gap: $unnnic-spacing-nano;
439
+ }
407
440
  }
408
441
 
409
442
  &__media__container {
@@ -179,6 +179,28 @@ export const ReceivedAndSent = {
179
179
  }),
180
180
  };
181
181
 
182
+ export const MessageStatus = {
183
+ render: (args) => ({
184
+ setup() {
185
+ return { args };
186
+ },
187
+ components: { UnnnicChatsMessage },
188
+ template: `
189
+ <div style="display: flex; flex-direction: column; gap: 12px">
190
+ <UnnnicChatsMessage v-bind="args" status="sent">
191
+ Sent status
192
+ </UnnnicChatsMessage>
193
+ <UnnnicChatsMessage v-bind="args" status="received">
194
+ Received status
195
+ </UnnnicChatsMessage>
196
+ <UnnnicChatsMessage v-bind="args" status="read">
197
+ Read status
198
+ </UnnnicChatsMessage>
199
+ </div>
200
+ `,
201
+ }),
202
+ };
203
+
182
204
  export const WithSignature = {
183
205
  args: {
184
206
  signature: 'John Doe',
@@ -272,8 +294,10 @@ export const Media = {
272
294
  gap: 16px;
273
295
  ">
274
296
  <div style="
275
- display: flex;
297
+ display: grid;
276
298
  gap: 16px;
299
+ grid-template-columns: 1fr 1fr 1fr;
300
+ align-items: start;
277
301
  ">
278
302
  <UnnnicChatsMessage v-bind="args" mediaType="audio" :replyMessage="replyMessage.audio">
279
303
  <unnnic-audio-recorder class="media" style="padding: 8px; margin: 4px 0;" ref="audio-recorder" :src="audio" :canDiscard="false" />
@@ -287,8 +311,10 @@ export const Media = {
287
311
  </div>
288
312
 
289
313
  <div style="
290
- display: flex;
314
+ display: grid;
291
315
  gap: 16px;
316
+ grid-template-columns: 1fr 1fr 1fr;
317
+ align-items: start;
292
318
  ">
293
319
  <UnnnicChatsMessage v-bind="args" mediaType="video" :replyMessage="replyMessage.audio">
294
320
  <video class="media" controls>