@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -100,4 +100,4 @@
100
100
  "vue-eslint-parser": "^9.4.2",
101
101
  "vue-tsc": "^3.0.5"
102
102
  }
103
- }
103
+ }
@@ -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: Lato 1.5 * 16px /* 24px */ 700 2 * 16px /* 32px */;
10
- $unnnic-font-display-2: Lato 1.25 * 16px /* 20px */ 700 1.6875 * 16px /* 27px */;
11
- $unnnic-font-display-3: Lato 1 * 16px /* 16px */ 700 1.375 * 16px /* 22px */;
12
- $unnnic-font-display-4: Lato 1 * 16px /* 16px */ 400 1.375 * 16px /* 22px */;
13
- $unnnic-font-body: Lato 0.875 * 16px /* 14px */ 400 1.3125 * 16px /* 21px */;
14
- $unnnic-font-emphasis: Lato 0.875 * 16px /* 14px */ 500 1.3125 * 16px /* 21px */;
15
- $unnnic-font-action: Lato 0.875 * 16px /* 14px */ 700 1.3125 * 16px /* 21px */;
16
- $unnnic-font-caption-1: Lato 0.75 * 16px /* 12px */ 500 1.125 * 16px /* 18px */;
17
- $unnnic-font-caption-2: Lato 0.75 * 16px /* 12px */ 400 1.125 * 16px /* 18px */;
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.family} 1.5 * {font.size} /* 24px */ {font.weight.bold} 2 * {font.size} /* 32px */"
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.family} 1.25 * {font.size} /* 20px */ {font.weight.bold} 1.6875 * {font.size} /* 27px */"
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.family} 1 * {font.size} /* 16px */ {font.weight.bold} 1.375 * {font.size} /* 22px */"
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.family} 1 * {font.size} /* 16px */ {font.weight.regular} 1.375 * {font.size} /* 22px */"
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.family} 0.875 * {font.size} /* 14px */ {font.weight.regular} 1.3125 * {font.size} /* 21px */"
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.family} 0.875 * {font.size} /* 14px */ {font.weight.medium} 1.3125 * {font.size} /* 21px */"
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.family} 0.875 * {font.size} /* 14px */ {font.weight.bold} 1.3125 * {font.size} /* 21px */"
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.family} 0.75 * {font.size} /* 12px */ {font.weight.medium} 1.125 * {font.size} /* 18px */"
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.family} 0.75 * {font.size} /* 12px */ {font.weight.regular} 1.125 * {font.size} /* 18px */"
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
- <p
3
- class="unnnic-chats-message__text"
4
- v-html="formattedText"
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>
@@ -103,6 +103,13 @@ export default {
103
103
 
104
104
  export const Default = { args: {} };
105
105
 
106
+
107
+ export const Automatic = {
108
+ args: {
109
+ automatic: true,
110
+ },
111
+ };
112
+
106
113
  export const Sending = {
107
114
  args: {
108
115
  status: 'sending',