@weni/unnnic-system 2.0.16 → 2.0.17

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.
Files changed (69) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/unnnic.mjs +1044 -1033
  3. package/dist/unnnic.umd.js +18 -18
  4. package/package.json +3 -2
  5. package/src/components/AudioRecorder/AudioHandler.vue +2 -0
  6. package/src/components/AudioRecorder/AudioPlayer.vue +2 -0
  7. package/src/components/AudioRecorder/AudioRecorder.vue +6 -4
  8. package/src/components/Card/CardData.vue +2 -2
  9. package/src/components/CardProject/CardProject.vue +6 -6
  10. package/src/components/ChartRainbow/ChartRainbow.vue +4 -4
  11. package/src/components/ChatsMessage/ChatsMessage.vue +11 -2
  12. package/src/components/ChatsMessage/ChatsMessageStatusBackdrop.vue +1 -4
  13. package/src/components/DateFilter/DateFilter.vue +2 -2
  14. package/src/components/DatePicker/DatePicker.vue +2 -2
  15. package/src/components/Dropdown/LanguageSelect.vue +7 -7
  16. package/src/components/ImportCard/ImportCard.vue +2 -2
  17. package/src/components/ProgressBar/ProgressBar.vue +3 -3
  18. package/src/components/Sidebar/SidebarPrimary.vue +15 -5
  19. package/src/components/TabsExpanded/TabsExpanded.vue +1 -0
  20. package/src/stories/Accordion.stories.js +35 -40
  21. package/src/stories/Alert.stories.js +98 -83
  22. package/src/stories/Breadcrumb.stories.js +12 -23
  23. package/src/stories/ButtonIcon.stories.js +2 -2
  24. package/src/stories/CardCompany.stories.js +52 -58
  25. package/src/stories/CardData.stories.js +8 -26
  26. package/src/stories/CardImage.stories.js +49 -48
  27. package/src/stories/CardInformation.stories.js +33 -54
  28. package/src/stories/CardProject.stories.js +50 -52
  29. package/src/stories/Carousel.stories.js +32 -27
  30. package/src/stories/ChartBar.stories.js +82 -102
  31. package/src/stories/ChartLine.stories.js +42 -52
  32. package/src/stories/ChartMultiLine.stories.js +39 -49
  33. package/src/stories/ChartRainbow.stories.js +2 -2
  34. package/src/stories/ChatText.stories.js +38 -44
  35. package/src/stories/ChatsContact.stories.js +57 -54
  36. package/src/stories/ChatsDashboardTagLive.stories.js +1 -8
  37. package/src/stories/ChatsHeader.stories.js +63 -74
  38. package/src/stories/ChatsMessage.stories.js +208 -216
  39. package/src/stories/CircleProgressBar.stories.js +4 -20
  40. package/src/stories/Collapse.stories.js +49 -55
  41. package/src/stories/Comment.stories.js +57 -54
  42. package/src/stories/DataArea.stories.js +60 -65
  43. package/src/stories/DateFilter.stories.js +7 -12
  44. package/src/stories/DatePicker.stories.js +50 -68
  45. package/src/stories/Disclaimer.stories.js +12 -27
  46. package/src/stories/Drawer.stories.js +116 -110
  47. package/src/stories/Dropdown.stories.js +22 -12
  48. package/src/stories/FormElement.stories.js +18 -23
  49. package/src/stories/Grid.stories.js +4 -10
  50. package/src/stories/Icon.stories.js +2 -2
  51. package/src/stories/IconLoading.stories.js +5 -11
  52. package/src/stories/ImportCard.stories.js +12 -19
  53. package/src/stories/Indicator.stories.js +8 -13
  54. package/src/stories/InputDatePicker.stories.js +27 -32
  55. package/src/stories/LanguageSelect.stories.js +12 -16
  56. package/src/stories/Modal.stories.js +66 -40
  57. package/src/stories/MoodRating.stories.js +27 -32
  58. package/src/stories/MultiSelect.stories.js +56 -50
  59. package/src/stories/Pagination.stories.js +21 -29
  60. package/src/stories/ProgressBar.stories.js +19 -54
  61. package/src/stories/Radio.stories.js +36 -35
  62. package/src/stories/Sidebar.stories.js +29 -27
  63. package/src/stories/SidebarPrimary.stories.js +87 -80
  64. package/src/stories/SkeletonLoading.stories.js +12 -29
  65. package/src/stories/StarRating.stories.js +29 -33
  66. package/src/stories/Switch.stories.js +26 -19
  67. package/src/stories/TabsExpanded.stories.js +56 -58
  68. package/src/stories/TextArea.stories.js +29 -34
  69. package/src/stories/TransitionRipple.stories.js +19 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -50,6 +50,7 @@
50
50
  "vue-the-mask": "^0.11.1"
51
51
  },
52
52
  "devDependencies": {
53
+ "@storybook/addon-actions": "^8.0.10",
53
54
  "@storybook/addon-essentials": "^8.0.10",
54
55
  "@storybook/addon-interactions": "^8.0.10",
55
56
  "@storybook/addon-links": "^8.0.10",
@@ -70,7 +71,7 @@
70
71
  "react-dom": "^18.2.0",
71
72
  "sass": "^1.62.1",
72
73
  "storybook": "^8.0.10",
73
- "vite": "^4.3.5",
74
+ "vite": "4.3.5",
74
75
  "vue-eslint-parser": "^9.4.2"
75
76
  }
76
77
  }
@@ -37,6 +37,8 @@ import UnnnicIcon from '../Icon.vue';
37
37
  import UnnnicToolTip from '../ToolTip/ToolTip.vue';
38
38
 
39
39
  export default {
40
+ emits: ['save'],
41
+
40
42
  components: {
41
43
  UnnnicIcon,
42
44
  UnnnicToolTip,
@@ -47,6 +47,8 @@
47
47
  import UnnnicIcon from '../Icon.vue';
48
48
 
49
49
  export default {
50
+ emits: ['play', 'pause', 'progress-bar-update', 'failed-click'],
51
+
50
52
  components: {
51
53
  UnnnicIcon,
52
54
  },
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <section
3
- v-if="value || isRecording || src"
3
+ v-if="modelValue || isRecording || src"
4
4
  class="unnnic-audio-recorder"
5
5
  >
6
6
  <UnnnicToolTip
@@ -74,6 +74,8 @@ const normalizeData = (filteredData) => {
74
74
  export default {
75
75
  name: 'AudioRecorder',
76
76
 
77
+ emits: ['update:model-value', 'status', 'failed-click'],
78
+
77
79
  components: {
78
80
  AudioHandler,
79
81
  AudioPlayer,
@@ -82,7 +84,7 @@ export default {
82
84
  },
83
85
 
84
86
  props: {
85
- value: {
87
+ modelValue: {
86
88
  type: HTMLAudioElement,
87
89
  },
88
90
 
@@ -278,7 +280,7 @@ export default {
278
280
 
279
281
  this.audio = null;
280
282
 
281
- this.$emit('input', null);
283
+ this.$emit('update:model-value', null);
282
284
 
283
285
  this.status = 'idle';
284
286
  },
@@ -299,7 +301,7 @@ export default {
299
301
  this.recorder.stop();
300
302
  }
301
303
 
302
- this.$emit('input', this.audio);
304
+ this.$emit('update:model-value', this.audio);
303
305
 
304
306
  this.stopMockMilliseconds();
305
307
  },
@@ -38,10 +38,10 @@
38
38
  </template>
39
39
 
40
40
  <script>
41
- import unnnicIcon from '../Icon.vue';
41
+ import UnnnicIcon from '../Icon.vue';
42
42
 
43
43
  export default {
44
- components: { unnnicIcon },
44
+ components: { UnnnicIcon },
45
45
 
46
46
  props: {
47
47
  title: {
@@ -36,16 +36,16 @@
36
36
 
37
37
  <script>
38
38
  import CardStatusesContainer from '../Card/CardStatusesContainer.vue';
39
- import unnnicIcon from '../Icon.vue';
40
- import unnnicDropdown from '../Dropdown/Dropdown.vue';
41
- import unnnicTag from '../Tag/Tag.vue';
39
+ import UnnnicIcon from '../Icon.vue';
40
+ import UnnnicDropdown from '../Dropdown/Dropdown.vue';
41
+ import UnnnicTag from '../Tag/Tag.vue';
42
42
 
43
43
  export default {
44
44
  components: {
45
45
  CardStatusesContainer,
46
- unnnicIcon,
47
- unnnicDropdown,
48
- unnnicTag,
46
+ UnnnicIcon,
47
+ UnnnicDropdown,
48
+ UnnnicTag,
49
49
  },
50
50
 
51
51
  props: {
@@ -44,7 +44,7 @@
44
44
 
45
45
  <div class="content">
46
46
  <div class="percentage">
47
- <span class="number">{{ value }} </span>
47
+ <span class="number">{{ modelValue }} </span>
48
48
  <span class="symbol">%</span>
49
49
  </div>
50
50
 
@@ -63,7 +63,7 @@ export default {
63
63
  components: {},
64
64
 
65
65
  props: {
66
- value: {
66
+ modelValue: {
67
67
  type: Number,
68
68
  default: 0,
69
69
  },
@@ -74,7 +74,7 @@ export default {
74
74
  },
75
75
 
76
76
  watch: {
77
- value() {
77
+ modelValue() {
78
78
  this.updateChartSvg();
79
79
  },
80
80
  },
@@ -138,7 +138,7 @@ export default {
138
138
  139.44,
139
139
  152.72,
140
140
  -85,
141
- -85 + (this.value / 100) * 170,
141
+ -85 + (this.modelValue / 100) * 170,
142
142
  ),
143
143
  );
144
144
  },
@@ -61,13 +61,13 @@
61
61
  v-else-if="isMedia"
62
62
  class="unnnic-chats-message__media__container"
63
63
  :class="{ failed: failedToSendMedia }"
64
- @click="$emit('click-image')"
64
+ @click="onClickMedia"
65
65
  >
66
66
  <slot />
67
67
  <UnnnicChatsMessageStatusBackdrop
68
68
  v-if="(sendingMedia || failedToSendMedia) && (isImage || isVideo)"
69
69
  :status="status"
70
- @click="status === 'failed' ? $emit('click') : () => {}"
70
+ @click.stop="status === 'failed' ? $emit('click') : () => {}"
71
71
  />
72
72
  </div>
73
73
  <UnnnicIconLoading
@@ -93,6 +93,7 @@ import UnnnicIcon from '../Icon.vue';
93
93
 
94
94
  export default {
95
95
  name: 'UnnnicChatsMessage',
96
+ emits: ['click', 'click-image'],
96
97
  components: {
97
98
  UnnnicChatsMessageText,
98
99
  UnnnicChatsMessageStatusBackdrop,
@@ -179,6 +180,14 @@ export default {
179
180
  return (this.isImage || this.isVideo) && this.status === 'failed';
180
181
  },
181
182
  },
183
+
184
+ methods: {
185
+ onClickMedia() {
186
+ if (this.isImage || this.isVideo) {
187
+ this.$emit('click-image');
188
+ }
189
+ },
190
+ },
182
191
  };
183
192
  </script>
184
193
 
@@ -1,8 +1,5 @@
1
1
  <template>
2
- <div
3
- class="unnnic-chats-message-status-backdrop__container"
4
- @click="$emit('click')"
5
- >
2
+ <div class="unnnic-chats-message-status-backdrop__container">
6
3
  <div class="unnnic-chats-message-status-backdrop">
7
4
  <UnnnicIconLoading
8
5
  v-if="status === 'sending'"
@@ -15,11 +15,11 @@
15
15
 
16
16
  <script>
17
17
  import moment from 'moment';
18
- import unnnicInput from '../Input/Input.vue';
18
+ import UnnnicInput from '../Input/Input.vue';
19
19
 
20
20
  export default {
21
21
  name: 'unnnic-date-filter',
22
- components: { unnnicInput },
22
+ components: { UnnnicInput },
23
23
  props: {
24
24
  size: {
25
25
  type: String,
@@ -204,11 +204,11 @@
204
204
  </template>
205
205
 
206
206
  <script>
207
- import unnnicButton from '../Button/Button.vue';
207
+ import UnnnicButton from '../Button/Button.vue';
208
208
 
209
209
  export default {
210
210
  components: {
211
- unnnicButton,
211
+ UnnnicButton,
212
212
  },
213
213
 
214
214
  props: {
@@ -106,18 +106,18 @@
106
106
  </template>
107
107
  <script>
108
108
  import { vOnClickOutside } from '@vueuse/components';
109
- import unnnicFlag from '../Flag.vue';
109
+ import UnnnicFlag from '../Flag.vue';
110
110
  import UnnnicIcon from '../Icon.vue';
111
111
  import { unnnicFontSize } from '../config';
112
112
 
113
113
  export default {
114
114
  name: 'LanguageSelect',
115
115
  components: {
116
- unnnicFlag,
116
+ UnnnicFlag,
117
117
  UnnnicIcon,
118
118
  },
119
119
  props: {
120
- value: {
120
+ modelValue: {
121
121
  type: String,
122
122
  default: '',
123
123
  },
@@ -149,16 +149,16 @@ export default {
149
149
  data() {
150
150
  return {
151
151
  open: false,
152
- val: this.value,
152
+ val: this.modelValue,
153
153
  unnnicFontSize,
154
154
  };
155
155
  },
156
156
  watch: {
157
157
  val() {
158
- this.$emit('input', this.val);
158
+ this.$emit('update:model-value', this.val);
159
159
  },
160
- value() {
161
- this.val = this.value;
160
+ modelValue() {
161
+ this.val = this.modelValue;
162
162
  },
163
163
  },
164
164
  computed: {
@@ -64,12 +64,12 @@
64
64
  </template>
65
65
 
66
66
  <script>
67
- import unnnicButton from '../Button/Button.vue';
67
+ import UnnnicButton from '../Button/Button.vue';
68
68
 
69
69
  export default {
70
70
  name: 'ImportCard',
71
71
  components: {
72
- unnnicButton,
72
+ UnnnicButton,
73
73
  },
74
74
  props: {
75
75
  title: {
@@ -22,7 +22,7 @@
22
22
  <div class="progress-container">
23
23
  <div
24
24
  class="bar"
25
- :style="{ width: `${value}%` }"
25
+ :style="{ width: `${modelValue}%` }"
26
26
  >
27
27
  <div
28
28
  v-if="type === 'secondary' && !subtitle"
@@ -75,7 +75,7 @@ export default {
75
75
  },
76
76
 
77
77
  props: {
78
- value: {
78
+ modelValue: {
79
79
  type: Number,
80
80
  },
81
81
 
@@ -103,7 +103,7 @@ export default {
103
103
 
104
104
  computed: {
105
105
  percentage() {
106
- return Math.floor(this.value);
106
+ return Math.floor(this.modelValue);
107
107
  },
108
108
  },
109
109
  };
@@ -37,7 +37,7 @@
37
37
  >
38
38
  <ToolTip
39
39
  :enabled="!expanded"
40
- :text="option.label"
40
+ :text="`${option.label} ${option.tag || ''}`.trim()"
41
41
  side="right"
42
42
  @mouseenter="hover($event, option.id)"
43
43
  @mouseleave="mouseout"
@@ -69,6 +69,7 @@
69
69
  />
70
70
 
71
71
  <span class="label">{{ option.label }}</span>
72
+ <span v-if="option.tag" class="tag">{{ option.tag }}</span>
72
73
  <span
73
74
  :class="option.notify && !expanded ? 'notify' : ''"
74
75
  v-if="option.notify"
@@ -132,14 +133,14 @@
132
133
 
133
134
  <script>
134
135
  import ToolTip from '../ToolTip/ToolTip.vue';
135
- import languageSelect from '../Dropdown/LanguageSelect.vue';
136
+ import LanguageSelect from '../Dropdown/LanguageSelect.vue';
136
137
  import UnnnicIcon from '../Icon.vue';
137
138
 
138
139
  export default {
139
140
  components: {
140
141
  ToolTip,
141
142
  UnnnicIcon,
142
- languageSelect,
143
+ LanguageSelect,
143
144
  },
144
145
 
145
146
  props: {
@@ -351,15 +352,24 @@ $transition-time: 0.4s;
351
352
  font-size: $unnnic-font-size-body-gt;
352
353
  line-height: ($unnnic-font-size-body-gt + $unnnic-line-height-md);
353
354
  float: left;
354
- flex: 1;
355
355
  white-space: nowrap;
356
- width: 50px;
356
+ width: min-content;
357
357
  overflow: hidden;
358
358
  text-overflow: ellipsis;
359
359
  user-select: none;
360
360
  margin-left: $unnnic-spacing-xs;
361
361
  }
362
362
 
363
+ .tag {
364
+ font-family: $unnnic-font-family-secondary;
365
+ font-size: $unnnic-font-size-body-md;
366
+ font-weight: $unnnic-font-weight-regular;
367
+ font-style: italic;
368
+ margin-left: $unnnic-spacing-nano;
369
+ color: $unnnic-color-weni-600;
370
+
371
+ }
372
+
363
373
  &:hover:not(.disabled) {
364
374
  background-color: rgba(
365
375
  $unnnic-color-brand-weni,
@@ -41,6 +41,7 @@
41
41
  @click.stop="$emit('close-tab', item)"
42
42
  icon="close-1"
43
43
  size="xs"
44
+ clickable
44
45
  scheme="neutral-cloudy"
45
46
  />
46
47
  </div>
@@ -1,51 +1,46 @@
1
- import unnnicAccordion from '../components/Accordion/Accordion.vue';
2
- import unnnicButton from '../components/Button/Button.vue';
1
+ import UnnnicAccordion from '../components/Accordion/Accordion.vue';
2
+ import UnnnicButton from '../components/Button/Button.vue';
3
3
 
4
4
  export default {
5
5
  title: 'accordion/Accordion',
6
- component: unnnicAccordion,
6
+ component: UnnnicAccordion,
7
7
  argTypes: {
8
8
  open: { control: { type: 'boolean' } },
9
9
  title: { control: { type: 'text' } },
10
10
  },
11
+ render: (args) => ({
12
+ setup() {
13
+ return { args };
14
+ },
15
+ components: {
16
+ UnnnicAccordion,
17
+ UnnnicButton,
18
+ },
19
+ data() {
20
+ return {
21
+ open: false,
22
+ };
23
+ },
24
+ template: `
25
+ <div>
26
+ <pre>v-model:open {{ open }}</pre>
27
+ <unnnic-accordion v-bind="args" v-model:open="open">
28
+ <template #actions>
29
+ <unnnic-button type="secondary" size="small" icon-left="button-play-1">
30
+ Assista ao vídeo
31
+ </unnnic-button>
32
+ </template>
33
+
34
+ Quae assumenda aut non nulla quod ratione odio. Suscipit voluptatem natus a. Cumque et delectus ut. Nostrum ratione eos voluptatem voluptatu quia quod qui. Velit in consequatur corrupti similique. Quae assumenda aut non nulla quod ratione odio. Suscipit voluptatem natus a.
35
+ </unnnic-accordion>
36
+ </div>
37
+ `,
38
+ }),
11
39
  };
12
40
 
13
- const Template = (args, { argTypes }) => ({
14
- props: Object.keys(argTypes),
15
-
16
- components: {
17
- unnnicAccordion,
18
- unnnicButton,
41
+ export const Default = {
42
+ args: {
43
+ title:
44
+ 'Os valores permanecem os mesmos? O que muda no meu plano contratado?',
19
45
  },
20
-
21
- data() {
22
- return {
23
- o: false,
24
- };
25
- },
26
-
27
- template: `
28
- <div>
29
- <pre>v-model:open {{ o }}</pre>
30
- <unnnic-accordion v-bind="$props" v-model:open="o">
31
- <template v-slot:actions>
32
- <unnnic-button @click.stop="click" type="secondary" size="small" icon-left="button-play-1">Assista ao vídeo</unnnic-button>
33
- </template>
34
-
35
- Quae assumenda aut non nulla quod ratione odio. Suscipit voluptatem natus a. Cumque et delectus ut. Nostrum ratione eos voluptatem voluptatu quia quod qui. Velit in consequatur corrupti similique. Quae assumenda aut non nulla quod ratione odio. Suscipit voluptatem natus a.
36
- </unnnic-accordion>
37
- </div>
38
- `,
39
-
40
- methods: {
41
- click() {
42
- console.log('clicked test 2');
43
- },
44
- },
45
- });
46
-
47
- export const Default = Template.bind({});
48
-
49
- Default.args = {
50
- title: 'Os valores permanecem os mesmos? O que muda no meu plano contratado?',
51
46
  };