@weni/unnnic-system 3.2.0 → 3.2.2
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/CHANGELOG.md +10 -0
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +60 -3
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessageText.vue.d.ts +42 -3
- package/dist/components/ChatsMessage/ChatsMessageText.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +60 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-a01fbef6.mjs → es-b22a2af8.mjs} +1 -1
- package/dist/{index-653c8f92.mjs → index-3e3537cb.mjs} +593 -555
- package/dist/{pt-br-8c017501.mjs → pt-br-7a4de77d.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +20 -20
- package/package.json +2 -2
- package/src/assets/scss/fonts.scss +9 -9
- package/src/assets/tokens/fonts.json +9 -9
- package/src/components/ChatsMessage/ChatsMessage.vue +15 -0
- package/src/components/ChatsMessage/ChatsMessageText.vue +58 -4
- package/src/stories/ChatsMessage.stories.js +7 -0
package/package.json
CHANGED
|
@@ -6,12 +6,12 @@ $unnnic-font-family: Lato;
|
|
|
6
6
|
$unnnic-font-weight-bold: 700;
|
|
7
7
|
$unnnic-font-weight-medium: 500;
|
|
8
8
|
$unnnic-font-weight-regular: 400;
|
|
9
|
-
$unnnic-font-display-1:
|
|
10
|
-
$unnnic-font-display-2:
|
|
11
|
-
$unnnic-font-display-3:
|
|
12
|
-
$unnnic-font-display-4:
|
|
13
|
-
$unnnic-font-body:
|
|
14
|
-
$unnnic-font-emphasis:
|
|
15
|
-
$unnnic-font-action:
|
|
16
|
-
$unnnic-font-caption-1:
|
|
17
|
-
$unnnic-font-caption-2:
|
|
9
|
+
$unnnic-font-display-1: 700 calc(1.5 * 16px) /* 24px */ / calc(2 * 16px) /* 32px */ Lato;
|
|
10
|
+
$unnnic-font-display-2: 700 calc(1.25 * 16px) /* 20px */ / calc(1.6875 * 16px) /* 27px */ Lato;
|
|
11
|
+
$unnnic-font-display-3: 700 calc(1 * 16px) /* 16px */ / calc(1.375 * 16px) /* 22px */ Lato;
|
|
12
|
+
$unnnic-font-display-4: 400 calc(1 * 16px) /* 16px */ / calc(1.375 * 16px) /* 22px */ Lato;
|
|
13
|
+
$unnnic-font-body: 400 calc(0.875 * 16px) /* 14px */ / calc(1.3125 * 16px) /* 21px */ Lato;
|
|
14
|
+
$unnnic-font-emphasis: 500 calc(0.875 * 16px) /* 14px */ / calc(1.3125 * 16px) /* 21px */ Lato;
|
|
15
|
+
$unnnic-font-action: 700 calc(0.875 * 16px) /* 14px */ / calc(1.3125 * 16px) /* 21px */ Lato;
|
|
16
|
+
$unnnic-font-caption-1: 500 calc(0.75 * 16px) /* 12px */ / calc(1.125 * 16px) /* 18px */ Lato;
|
|
17
|
+
$unnnic-font-caption-2: 400 calc(0.75 * 16px) /* 12px */ / calc(1.125 * 16px) /* 18px */ Lato;
|
|
@@ -19,33 +19,33 @@
|
|
|
19
19
|
},
|
|
20
20
|
"display": {
|
|
21
21
|
"1": {
|
|
22
|
-
"value": "{font.
|
|
22
|
+
"value": "{font.weight.bold} calc(1.5 * {font.size}) /* 24px */ / calc(2 * {font.size}) /* 32px */ {font.family}"
|
|
23
23
|
},
|
|
24
24
|
"2": {
|
|
25
|
-
"value": "{font.
|
|
25
|
+
"value": "{font.weight.bold} calc(1.25 * {font.size}) /* 20px */ / calc(1.6875 * {font.size}) /* 27px */ {font.family}"
|
|
26
26
|
},
|
|
27
27
|
"3": {
|
|
28
|
-
"value": "{font.
|
|
28
|
+
"value": "{font.weight.bold} calc(1 * {font.size}) /* 16px */ / calc(1.375 * {font.size}) /* 22px */ {font.family}"
|
|
29
29
|
},
|
|
30
30
|
"4": {
|
|
31
|
-
"value": "{font.
|
|
31
|
+
"value": "{font.weight.regular} calc(1 * {font.size}) /* 16px */ / calc(1.375 * {font.size}) /* 22px */ {font.family}"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"body": {
|
|
35
|
-
"value": "{font.
|
|
35
|
+
"value": "{font.weight.regular} calc(0.875 * {font.size}) /* 14px */ / calc(1.3125 * {font.size}) /* 21px */ {font.family}"
|
|
36
36
|
},
|
|
37
37
|
"emphasis": {
|
|
38
|
-
"value": "{font.
|
|
38
|
+
"value": "{font.weight.medium} calc(0.875 * {font.size}) /* 14px */ / calc(1.3125 * {font.size}) /* 21px */ {font.family}"
|
|
39
39
|
},
|
|
40
40
|
"action": {
|
|
41
|
-
"value": "{font.
|
|
41
|
+
"value": "{font.weight.bold} calc(0.875 * {font.size}) /* 14px */ / calc(1.3125 * {font.size}) /* 21px */ {font.family}"
|
|
42
42
|
},
|
|
43
43
|
"caption": {
|
|
44
44
|
"1": {
|
|
45
|
-
"value": "{font.
|
|
45
|
+
"value": "{font.weight.medium} calc(0.75 * {font.size}) /* 12px */ / calc(1.125 * {font.size}) /* 18px */ {font.family}"
|
|
46
46
|
},
|
|
47
47
|
"2": {
|
|
48
|
-
"value": "{font.
|
|
48
|
+
"value": "{font.weight.regular} calc(0.75 * {font.size}) /* 12px */ / calc(1.125 * {font.size}) /* 18px */ {font.family}"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
class="unnnic-chats-message"
|
|
4
4
|
:class="{
|
|
5
5
|
sent: type === 'sent',
|
|
6
|
+
automatic: automatic,
|
|
6
7
|
sending: status === 'sending',
|
|
7
8
|
'is-document': isDocument,
|
|
8
9
|
'is-media': isMedia,
|
|
@@ -45,7 +46,9 @@
|
|
|
45
46
|
/>
|
|
46
47
|
<UnnnicChatsMessageText
|
|
47
48
|
v-if="isText"
|
|
49
|
+
:locale="locale"
|
|
48
50
|
:text="slotText"
|
|
51
|
+
:isAutomatic="automatic"
|
|
49
52
|
/>
|
|
50
53
|
<div
|
|
51
54
|
v-if="isDocument"
|
|
@@ -156,6 +159,10 @@ export default {
|
|
|
156
159
|
},
|
|
157
160
|
mixins: [UnnnicI18n],
|
|
158
161
|
props: {
|
|
162
|
+
locale: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: 'en',
|
|
165
|
+
},
|
|
159
166
|
enableReply: {
|
|
160
167
|
type: Boolean,
|
|
161
168
|
default: false,
|
|
@@ -171,6 +178,10 @@ export default {
|
|
|
171
178
|
return ['received', 'sent'].includes(type);
|
|
172
179
|
},
|
|
173
180
|
},
|
|
181
|
+
automatic: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
default: false,
|
|
184
|
+
},
|
|
174
185
|
time: {
|
|
175
186
|
type: Date,
|
|
176
187
|
required: true,
|
|
@@ -323,6 +334,10 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
|
323
334
|
|
|
324
335
|
&.sent {
|
|
325
336
|
background-color: #cff8f4;
|
|
337
|
+
|
|
338
|
+
&.automatic {
|
|
339
|
+
background-color: $unnnic-color-aux-blue-50;
|
|
340
|
+
}
|
|
326
341
|
}
|
|
327
342
|
|
|
328
343
|
&.sending {
|
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<section class="unnnic-chats-message__text__container">
|
|
3
|
+
<p
|
|
4
|
+
class="unnnic-chats-message__text"
|
|
5
|
+
v-html="formattedText"
|
|
6
|
+
/>
|
|
7
|
+
<p v-if="isAutomatic" class="unnnic-chats-message__text--automatic">
|
|
8
|
+
{{ i18n('automatic_message') }}
|
|
9
|
+
</p>
|
|
10
|
+
</section>
|
|
6
11
|
</template>
|
|
7
12
|
|
|
8
13
|
<script>
|
|
14
|
+
import UnnnicI18n from '../../mixins/i18n';
|
|
15
|
+
|
|
9
16
|
export default {
|
|
10
17
|
name: 'ChatsMessageText',
|
|
18
|
+
mixins: [UnnnicI18n],
|
|
11
19
|
props: {
|
|
20
|
+
locale: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'en',
|
|
23
|
+
},
|
|
12
24
|
text: {
|
|
13
25
|
type: String,
|
|
14
26
|
required: true,
|
|
15
27
|
},
|
|
28
|
+
isAutomatic: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
defaultTranslations: {
|
|
36
|
+
automatic_message: {
|
|
37
|
+
'pt-br': 'Mensagem de abertura automática',
|
|
38
|
+
en: 'Automatic Opening Message',
|
|
39
|
+
es: 'Mensaje de apertura automático',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
16
43
|
},
|
|
17
44
|
computed: {
|
|
18
45
|
formattedText() {
|
|
@@ -78,3 +105,30 @@ export default {
|
|
|
78
105
|
},
|
|
79
106
|
};
|
|
80
107
|
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss" scoped>
|
|
110
|
+
@use '@/assets/scss/unnnic' as *;
|
|
111
|
+
|
|
112
|
+
* {
|
|
113
|
+
padding: 0;
|
|
114
|
+
margin: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.unnnic-chats-message__text {
|
|
118
|
+
&__container {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: $unnnic-spacing-sm;
|
|
122
|
+
padding: $unnnic-spacing-nano 0;
|
|
123
|
+
font-size: $unnnic-font-size-body-gt;
|
|
124
|
+
color: $unnnic-color-neutral-dark;
|
|
125
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
126
|
+
word-break: break-word;
|
|
127
|
+
}
|
|
128
|
+
&--automatic {
|
|
129
|
+
font-size: $unnnic-font-size-body-md;
|
|
130
|
+
line-height: $unnnic-line-height-caption-1;
|
|
131
|
+
color: $unnnic-color-aux-blue-500;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|