@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
@@ -10,88 +10,95 @@ export default {
10
10
  hideText: { control: { type: 'text' } },
11
11
  language: { control: { type: 'select', options: ['pt-br', 'en'] } },
12
12
  },
13
- };
14
-
15
- const Template = (args, { argTypes }) => ({
16
- props: Object.keys(argTypes),
17
- components: {
18
- SidebarPrimary,
19
- },
20
- template: `
21
- <sidebar-primary v-bind="$props" style="min-height: 300px;">
22
- <template v-slot:header>
23
- Header
24
- </template>
25
-
26
- <template #block-chats>
27
- Hello World!
28
- </template>
13
+ render: (args) => ({
14
+ setup() {
15
+ return { args };
16
+ },
17
+ components: { SidebarPrimary },
18
+ template: `
19
+ <sidebar-primary v-bind="args" style="min-height: 300px;">
20
+ <template #header>
21
+ Header
22
+ </template>
29
23
 
30
- <template #block-flows>
31
- Hello World!
32
- </template>
33
- </sidebar-primary>
34
- `,
35
- });
24
+ <template #block-chats>
25
+ Hello World!
26
+ </template>
36
27
 
37
- export const Normal = Template.bind({});
28
+ <template #block-flows>
29
+ Hello World!
30
+ </template>
31
+ </sidebar-primary>
32
+ `,
33
+ }),
34
+ };
38
35
 
39
- Normal.args = {
40
- expanded: true,
41
- language: 'pt-br',
42
- hideText: 'Encolher',
43
- items: [
44
- {
45
- label: 'Menu principal',
46
- items: [
47
- {
48
- label: 'Início',
49
- active: true,
50
- icon: 'house-1-1',
51
- // eslint-disable-next-line no-param-reassign
52
- click(option) {
53
- option.active = !option.active;
36
+ export const Normal = {
37
+ args: {
38
+ expanded: true,
39
+ language: 'pt-br',
40
+ hideText: 'Encolher',
41
+ items: [
42
+ {
43
+ label: 'Menu principal',
44
+ items: [
45
+ {
46
+ label: 'Início',
47
+ active: true,
48
+ icon: 'house-1-1',
49
+ // eslint-disable-next-line no-param-reassign
50
+ click(option) {
51
+ option.active = !option.active;
52
+ },
54
53
  },
55
- },
56
- ],
57
- },
58
- {
59
- label: 'Sistemas',
60
- items: [
61
- {
62
- id: 'flows',
63
- label: 'Fluxos',
64
- active: false,
65
- icon: 'hierarchy-3-2',
66
- click() {},
67
- },
68
- {
69
- id: 'ia',
70
- label: 'Inteligência Artificial',
71
- active: false,
72
- icon: 'science-fiction-robot-2',
73
- click() {},
74
- },
75
- {
76
- id: 'chats',
77
- label: 'Agentes',
78
- active: false,
79
- icon: 'messaging-we-chat-3',
80
- click() {},
81
- notify: true,
82
- },
83
- ],
84
- },
85
- {
86
- label: 'Perfil',
87
- items: [
88
- {
89
- label: 'Conta',
90
- active: false,
91
- icon: 'single-neutral-actions-1',
92
- click() {},
93
- },
94
- ],
95
- },
96
- ],
54
+ ],
55
+ },
56
+ {
57
+ label: 'Sistemas',
58
+ items: [
59
+ {
60
+ id: 'insights',
61
+ label: 'Insights',
62
+ active: false,
63
+ tag: 'Alfa',
64
+ icon: 'bar_chart_4_bars',
65
+ click() {},
66
+ },
67
+ {
68
+ id: 'flows',
69
+ label: 'Fluxos',
70
+ active: false,
71
+ icon: 'hierarchy-3-2',
72
+ click() {},
73
+ },
74
+ {
75
+ id: 'ia',
76
+ label: 'Inteligência Artificial',
77
+ active: false,
78
+ icon: 'science-fiction-robot-2',
79
+ click() {},
80
+ },
81
+ {
82
+ id: 'chats',
83
+ label: 'Agentes',
84
+ active: false,
85
+ icon: 'messaging-we-chat-3',
86
+ click() {},
87
+ notify: true,
88
+ },
89
+ ],
90
+ },
91
+ {
92
+ label: 'Perfil',
93
+ items: [
94
+ {
95
+ label: 'Conta',
96
+ active: false,
97
+ icon: 'single-neutral-actions-1',
98
+ click() {},
99
+ },
100
+ ],
101
+ },
102
+ ],
103
+ },
97
104
  };
@@ -1,8 +1,8 @@
1
- import unnnicSkeletonLoading from '../components/SkeletonLoading/SkeletonLoading.vue';
1
+ import UnnnicSkeletonLoading from '../components/SkeletonLoading/SkeletonLoading.vue';
2
2
 
3
3
  export default {
4
4
  title: 'example/Skeleton',
5
- component: unnnicSkeletonLoading,
5
+ component: UnnnicSkeletonLoading,
6
6
  argTypes: {
7
7
  width: { control: { type: 'text' } },
8
8
  height: { control: { type: 'text' } },
@@ -14,32 +14,15 @@ export default {
14
14
  },
15
15
  };
16
16
 
17
- const Template = (args, { argTypes }) => ({
18
- props: Object.keys(argTypes).concat(['input']),
19
- components: {
20
- unnnicSkeletonLoading,
17
+ export const Default = {
18
+ args: {
19
+ width: '500px',
20
+ height: '200px',
21
+ prefix: 'unnnic',
22
+ tag: 'span',
23
+ duration: 1.5,
24
+ count: 1,
25
+ circle: false,
26
+ loading: true,
21
27
  },
22
- data() {
23
- return {
24
- insideValue: 'option 1',
25
- };
26
- },
27
- template: `
28
- <div>
29
- <h3>Default</h3>
30
- <unnnic-skeleton-loading v-bind="$props" />
31
- </div>
32
- `,
33
- });
34
-
35
- export const Default = Template.bind({});
36
- Default.args = {
37
- width: '500px',
38
- height: '200px',
39
- prefix: 'unnnic',
40
- tag: 'span',
41
- duration: 1.5,
42
- count: 1,
43
- circle: false,
44
- loading: true,
45
28
  };
@@ -1,42 +1,38 @@
1
- import unnnicStarRating from '../components/StarRating/StarRating.vue';
1
+ import UnnnicStarRating from '../components/StarRating/StarRating.vue';
2
2
 
3
3
  export default {
4
4
  title: 'Rating/StarRating',
5
- component: unnnicStarRating,
5
+ component: UnnnicStarRating,
6
6
  argTypes: {
7
7
  showValue: { control: { type: 'boolean' } },
8
8
  readonly: { control: { type: 'boolean' } },
9
9
  },
10
- };
11
-
12
- const Template = (args, { argTypes }) => ({
13
- props: Object.keys(argTypes),
14
-
15
- components: {
16
- unnnicStarRating,
17
- },
18
-
19
- data() {
20
- return {
21
- value: 4,
22
- };
10
+ render: (args) => ({
11
+ setup() {
12
+ return { args };
13
+ },
14
+ components: {
15
+ UnnnicStarRating,
16
+ },
17
+
18
+ data() {
19
+ return {
20
+ value: 4,
21
+ };
22
+ },
23
+
24
+ template: `
25
+ <div>
26
+ <pre>v-model: {{ value }}</pre>
27
+ <unnnic-star-rating v-model="value" showValue readonly />
28
+ </div>
29
+ `,
30
+ }),
31
+ args: {
32
+ value: 3.6,
33
+ showValue: true,
34
+ readonly: true,
23
35
  },
24
-
25
- template: `
26
- <div>
27
- <pre>v-model: {{ value }}</pre>
28
- <unnnic-star-rating v-model="value" showValue readonly>
29
- </unnnic-star-rating>
30
- </div>
31
- `,
32
-
33
- methods: {},
34
- });
35
-
36
- export const Default = Template.bind({});
37
-
38
- Default.args = {
39
- value: 3.6,
40
- showValue: true,
41
- readonly: true,
42
36
  };
37
+
38
+ export const Default = {};
@@ -1,32 +1,39 @@
1
- import unnnicSwitch from '../components/Switch/Switch.vue';
1
+ import UnnnicSwitch from '../components/Switch/Switch.vue';
2
2
 
3
3
  export default {
4
4
  title: 'Form/Switch',
5
- component: unnnicSwitch,
5
+ component: UnnnicSwitch,
6
6
  argTypes: {
7
7
  size: { control: { type: 'select', options: ['small', 'medium'] } },
8
8
  textLeft: { control: { type: 'text' } },
9
9
  textRight: { control: { type: 'text' } },
10
10
  disabled: { control: { type: 'boolean' } },
11
11
  },
12
+ render: (args) => ({
13
+ components: {
14
+ UnnnicSwitch,
15
+ },
16
+ setup() {
17
+ return { args };
18
+ },
19
+ data() {
20
+ return {
21
+ value: true,
22
+ };
23
+ },
24
+ template: `
25
+ <div>
26
+ <UnnnicSwitch v-bind="args" v-model="value"/>
27
+ <div>{{value}}</div>
28
+ </div>
29
+ `,
30
+ }),
12
31
  };
13
32
 
14
- const Template = (args, { argTypes }) => ({
15
- props: Object.keys(argTypes),
16
- components: { unnnicSwitch },
17
- data() {
18
- return {
19
- val: true,
20
- };
33
+ export const Default = {
34
+ args: {
35
+ size: 'medium',
36
+ textRight: 'Default',
37
+ disabled: false,
21
38
  },
22
- template:
23
- '<div><unnnicSwitch v-bind="$props" v-model="val"/> <div>{{val}}</div></div>',
24
- });
25
-
26
- export const Default = Template.bind({});
27
- Default.args = {
28
- size: 'medium',
29
- textRight: 'Default',
30
- disabled: false,
31
- // initialState: true,
32
39
  };
@@ -1,71 +1,69 @@
1
+ import { action } from '@storybook/addon-actions';
1
2
  import UnnnicTabsExpanded from '../components/TabsExpanded/TabsExpanded.vue';
2
3
 
3
4
  export default {
4
5
  title: 'tabs/TabsExpanded',
5
6
  component: UnnnicTabsExpanded,
6
- argTypes: {
7
- 'on-update:model-value': { action: '@update:model-value' },
8
- 'on-back': { action: '@back' },
9
- 'on-add': { action: '@add' },
10
- 'on-close-tab': { action: '@close-tab' },
11
- },
12
- };
13
-
14
- const Template = (args, { argTypes }) => ({
15
- components: {
16
- UnnnicTabsExpanded,
17
- },
18
-
19
- props: Object.keys(argTypes),
20
-
21
- data() {
22
- return {
23
- v: 'uuid2',
24
- lItems: [],
25
- };
26
- },
27
-
28
- created() {
29
- this.lItems = this.items;
30
- },
31
-
32
- methods: {
33
- lCloseTab(tab) {
34
- const index = this.lItems.findIndex(({ value }) => value === tab.value);
7
+ argTypes: {},
8
+ render: (args) => ({
9
+ setup() {
10
+ return { args };
11
+ },
12
+ components: {
13
+ UnnnicTabsExpanded,
14
+ },
35
15
 
36
- this.lItems.splice(index, 1);
16
+ data() {
17
+ return {
18
+ v: 'uuid2',
19
+ lItems: [],
20
+ };
21
+ },
37
22
 
38
- this.v = this.lItems[index]?.value || this.lItems[index - 1]?.value;
23
+ created() {
24
+ this.lItems = args.items;
39
25
  },
40
- },
41
26
 
42
- template:
43
- '<div><pre>v-model: {{ v }}</pre><unnnic-tabs-expanded v-bind="$props" v-model="v" @close-tab="lCloseTab"></unnnic-tabs-expanded></div>',
44
- });
27
+ methods: {
28
+ lCloseTab(tab) {
29
+ const index = this.lItems.findIndex(({ value }) => value === tab.value);
45
30
 
46
- export const Default = Template.bind({});
31
+ this.lItems.splice(index, 1);
47
32
 
48
- Default.args = {
49
- items: [
50
- {
51
- title: 'Suporte',
52
- description: 'Última edição há 5 minutos',
53
- value: 'uuid1',
54
- },
55
- {
56
- title: 'Boas vindas',
57
- description: 'Última edição agora há pouco',
58
- value: 'uuid2',
33
+ this.v = this.lItems[index]?.value || this.lItems[index - 1]?.value;
34
+ },
59
35
  },
60
- {
61
- title: 'Atendimento',
62
- description: 'Última edição em 4 de janeiro',
63
- value: 'uuid3',
64
- },
65
- {
66
- title: 'Texto grande texto grande texto grande',
67
- description: 'Texto grande texto grande texto grande',
68
- value: 'uuid4',
69
- },
70
- ],
36
+
37
+ template:
38
+ '<div><pre>v-model: {{ v }}</pre><unnnic-tabs-expanded v-bind="args" v-model="v" @close-tab="lCloseTab"></unnnic-tabs-expanded></div>',
39
+ }),
40
+ args: {
41
+ onBack: action('@back'),
42
+ onAdd: action('@add'),
43
+ onCloseTab: action('@close-tab'),
44
+ items: [
45
+ {
46
+ title: 'Suporte',
47
+ description: 'Última edição há 5 minutos',
48
+ value: 'uuid1',
49
+ },
50
+ {
51
+ title: 'Boas vindas',
52
+ description: 'Última edição agora há pouco',
53
+ value: 'uuid2',
54
+ },
55
+ {
56
+ title: 'Atendimento',
57
+ description: 'Última edição em 4 de janeiro',
58
+ value: 'uuid3',
59
+ },
60
+ {
61
+ title: 'Texto grande texto grande texto grande',
62
+ description: 'Texto grande texto grande texto grande',
63
+ value: 'uuid4',
64
+ },
65
+ ],
66
+ },
71
67
  };
68
+
69
+ export const Default = {};
@@ -1,45 +1,40 @@
1
- import unnnicTextArea from '../components/TextArea/TextArea.vue';
1
+ import UnnnicTextArea from '../components/TextArea/TextArea.vue';
2
2
 
3
3
  export default {
4
4
  title: 'Form/TextArea',
5
- component: unnnicTextArea,
5
+ component: UnnnicTextArea,
6
6
  argTypes: {
7
- 'on-update:model-value': { action: '@update:model-value' },
8
7
  size: { control: { type: 'select', options: ['md', 'sm'] } },
9
8
  type: { control: { type: 'select', options: ['normal', 'error'] } },
10
9
  },
10
+ render: (args) => ({
11
+ setup() {
12
+ return { args };
13
+ },
14
+ components: {
15
+ UnnnicTextArea,
16
+ },
17
+ data() {
18
+ return {
19
+ content: '',
20
+ };
21
+ },
22
+ template: `
23
+ <div>
24
+ <pre>v-model: {{ content }}</pre>
25
+ <unnnic-text-area v-bind="args" v-model="content"/>
26
+ </div>
27
+ `,
28
+ }),
11
29
  };
12
30
 
13
- const Template = (args, { argTypes }) => ({
14
- props: Object.keys(argTypes),
15
-
16
- components: {
17
- unnnicTextArea,
18
- },
19
-
20
- data() {
21
- return {
22
- content: '',
23
- };
31
+ export const Default = {
32
+ args: {
33
+ label: 'Label',
34
+ placeholder: 'Placeholder',
35
+ maxLength: 150,
36
+ disabled: false,
37
+ type: 'normal',
38
+ errors: [],
24
39
  },
25
-
26
- template: `
27
- <div>
28
- <pre>v-model: {{ content }}</pre>
29
- <unnnic-text-area v-bind="$props" v-model="content"/>
30
- </div>
31
- `,
32
-
33
- methods: {},
34
- });
35
-
36
- export const Default = Template.bind({});
37
-
38
- Default.args = {
39
- label: 'Label',
40
- placeholder: 'Placeholder',
41
- maxLength: 150,
42
- disabled: false,
43
- type: 'normal',
44
- errors: [],
45
40
  };
@@ -12,23 +12,24 @@ export default {
12
12
  },
13
13
  },
14
14
  },
15
- };
16
-
17
- const Template = (args, { argTypes }) => ({
18
- props: Object.keys(argTypes),
19
- components: {
20
- unnnicTransitionRipple,
15
+ render: (args) => ({
16
+ setup() {
17
+ return { args };
18
+ },
19
+ components: {
20
+ unnnicTransitionRipple,
21
+ },
22
+ template: `
23
+ <div ref="transitionContainer" @mousedown="(event) => this.$refs.transitionRipple.addRipple(event)" style="width: 100%; height: 100px;">
24
+ Click to activate transition
25
+
26
+ <unnnic-transition-ripple ref="transitionRipple" v-bind="args" />
27
+ </div>
28
+ `,
29
+ }),
30
+ args: {
31
+ color: 'weni-600',
21
32
  },
22
- template: `
23
- <div ref="transitionContainer" @mousedown="(event) => this.$refs.transitionRipple.addRipple(event)" style="width: 100%; height: 100px;">
24
- Click to activate transition
25
-
26
- <unnnic-transition-ripple ref="transitionRipple" v-bind="$props" />
27
- </div>
28
- `,
29
- });
30
-
31
- export const Default = Template.bind({});
32
- Default.args = {
33
- color: 'weni-600',
34
33
  };
34
+
35
+ export const Default = {};