@weni/unnnic-system 3.2.5-alpha.0 → 3.2.5
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 +31 -0
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Chip/Chip.vue.d.ts +8 -0
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -0
- package/dist/components/Chip/types.d.ts +9 -0
- package/dist/components/Chip/types.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/Disclaimer/types.d.ts +1 -1
- package/dist/components/Disclaimer/types.d.ts.map +1 -1
- package/dist/components/DropArea/DropArea.vue.d.ts +0 -2
- package/dist/components/DropArea/DropArea.vue.d.ts.map +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts +1 -1
- package/dist/components/Icon/types.d.ts +2 -1
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +2 -1
- package/dist/components/Icon.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +3 -3
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +0 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +0 -6
- package/dist/components/index.d.ts +24 -54
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-e4a6e990.mjs → es-a07e7553.mjs} +1 -1
- package/dist/{index-de083a7a.mjs → index-93aafec9.mjs} +7413 -7525
- package/dist/{pt-br-229e5ab3.mjs → pt-br-a81c613f.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +116 -118
- package/dist/unnnic.umd.js +41 -42
- package/package.json +2 -2
- package/src/assets/scss/scheme-colors.scss +132 -0
- package/src/assets/scss/unnnic.scss +2 -0
- package/src/components/Button/Button.vue +109 -58
- package/src/components/Button/types.ts +1 -0
- package/src/components/Card/Card.vue +12 -21
- package/src/components/Chip/Chip.vue +124 -0
- package/src/components/Chip/__tests__/Chip.spec.js +164 -0
- package/src/components/Chip/types.ts +8 -0
- package/src/components/Disclaimer/types.ts +1 -1
- package/src/components/DropArea/DropArea.vue +2 -26
- package/src/components/Icon/types.ts +4 -88
- package/src/components/Icon.vue +3 -91
- package/src/components/ModalDialog/ModalDialog.vue +29 -27
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
- package/src/components/index.ts +7 -12
- package/src/stories/Button.stories.js +10 -1
- package/src/stories/Chip.stories.js +173 -0
- package/src/types/scheme-colors.d.ts +102 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +0 -9
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +0 -1
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +0 -15
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +0 -1
- package/src/assets/img/previews/doc-preview.png +0 -0
- package/src/assets/img/previews/image-preview.png +0 -0
- package/src/assets/img/previews/video-preview.png +0 -0
- package/src/components/TemplatePreview/TemplatePreview.vue +0 -249
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +0 -51
- package/src/components/TemplatePreview/types.d.ts +0 -16
- package/src/stories/TemplatePreview.stories.js +0 -94
- package/src/stories/TemplatePreviewModal.stories.js +0 -110
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
|
|
4
|
+
import Chip from '../Chip.vue';
|
|
5
|
+
|
|
6
|
+
const createWrapper = (props) => {
|
|
7
|
+
return mount(Chip, {
|
|
8
|
+
props,
|
|
9
|
+
global: {
|
|
10
|
+
stubs: {
|
|
11
|
+
UnnnicIcon: true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('Chip', () => {
|
|
18
|
+
let wrapper;
|
|
19
|
+
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
wrapper = createWrapper({ text: 'Test Chip', type: 'single' });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe('Basic rendering', () => {
|
|
25
|
+
it('should render the chip with text', () => {
|
|
26
|
+
expect(wrapper.exists()).toBe(true);
|
|
27
|
+
expect(wrapper.text()).toContain('Test Chip');
|
|
28
|
+
expect(wrapper.classes()).toContain('chip');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should render with default unselected state', () => {
|
|
32
|
+
expect(wrapper.classes()).toContain('chip--border');
|
|
33
|
+
expect(wrapper.classes()).not.toContain('chip--is-selected');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('Selection state', () => {
|
|
38
|
+
it('should apply selected styling when isSelected is true', async () => {
|
|
39
|
+
await wrapper.setProps({ isSelected: true });
|
|
40
|
+
|
|
41
|
+
expect(wrapper.classes()).toContain('chip--is-selected');
|
|
42
|
+
expect(wrapper.classes()).not.toContain('chip--border');
|
|
43
|
+
|
|
44
|
+
const textElement = wrapper.find('.chip__text');
|
|
45
|
+
expect(textElement.classes()).toContain('chip__text--is-selected');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('Count functionality', () => {
|
|
50
|
+
it('should render count when provided', async () => {
|
|
51
|
+
await wrapper.setProps({ count: 5 });
|
|
52
|
+
|
|
53
|
+
const countElement = wrapper.find('.chip__count');
|
|
54
|
+
expect(countElement.exists()).toBe(true);
|
|
55
|
+
expect(countElement.text()).toBe('5');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should not render count when not provided or zero', async () => {
|
|
59
|
+
expect(wrapper.find('.chip__count').exists()).toBe(false);
|
|
60
|
+
|
|
61
|
+
await wrapper.setProps({ count: 0 });
|
|
62
|
+
expect(wrapper.find('.chip__count').exists()).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should apply selected styling to count when chip is selected', async () => {
|
|
66
|
+
await wrapper.setProps({ count: 3, isSelected: true });
|
|
67
|
+
|
|
68
|
+
const countElement = wrapper.find('.chip__count');
|
|
69
|
+
expect(countElement.classes()).toContain('chip__count--is-selected');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('Type functionality', () => {
|
|
74
|
+
it('should not render icon for single type', () => {
|
|
75
|
+
const icon = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
76
|
+
expect(icon.exists()).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should render correct icons for multiple type', async () => {
|
|
80
|
+
await wrapper.setProps({ type: 'multiple', isSelected: false });
|
|
81
|
+
|
|
82
|
+
let icon = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
83
|
+
expect(icon.exists()).toBe(true);
|
|
84
|
+
expect(icon.props('icon')).toBe('add');
|
|
85
|
+
expect(icon.props('scheme')).toBe('feedback-grey');
|
|
86
|
+
expect(icon.props('size')).toBe('sm');
|
|
87
|
+
|
|
88
|
+
await wrapper.setProps({ isSelected: true });
|
|
89
|
+
|
|
90
|
+
icon = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
91
|
+
expect(icon.props('icon')).toBe('close');
|
|
92
|
+
expect(icon.props('scheme')).toBe('teal-600');
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe('Combined functionality', () => {
|
|
97
|
+
it('should render all elements correctly when combined', async () => {
|
|
98
|
+
await wrapper.setProps({
|
|
99
|
+
text: 'Complete Chip',
|
|
100
|
+
count: 42,
|
|
101
|
+
type: 'multiple',
|
|
102
|
+
isSelected: true
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
expect(wrapper.text()).toContain('Complete Chip');
|
|
106
|
+
expect(wrapper.classes()).toContain('chip--is-selected');
|
|
107
|
+
|
|
108
|
+
const countElement = wrapper.find('.chip__count');
|
|
109
|
+
expect(countElement.exists()).toBe(true);
|
|
110
|
+
expect(countElement.text()).toBe('42');
|
|
111
|
+
expect(countElement.classes()).toContain('chip__count--is-selected');
|
|
112
|
+
|
|
113
|
+
const icon = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
114
|
+
expect(icon.exists()).toBe(true);
|
|
115
|
+
expect(icon.props('icon')).toBe('close');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('Click functionality', () => {
|
|
120
|
+
it('should emit click event when clicked', async () => {
|
|
121
|
+
await wrapper.setProps({ isClickable: true });
|
|
122
|
+
|
|
123
|
+
await wrapper.trigger('click');
|
|
124
|
+
|
|
125
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
126
|
+
expect(wrapper.emitted().click).toHaveLength(1);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('should apply clickable styling when isClickable is true', async () => {
|
|
130
|
+
await wrapper.setProps({ isClickable: true });
|
|
131
|
+
|
|
132
|
+
expect(wrapper.classes()).toContain('chip--is-clickable');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should not apply clickable styling when isClickable is false', () => {
|
|
136
|
+
expect(wrapper.classes()).not.toContain('chip--is-clickable');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should emit click event even when not marked as clickable', async () => {
|
|
140
|
+
await wrapper.trigger('click');
|
|
141
|
+
|
|
142
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
143
|
+
expect(wrapper.emitted().click).toHaveLength(1);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe('Edge cases', () => {
|
|
148
|
+
it('should handle negative count', async () => {
|
|
149
|
+
await wrapper.setProps({ count: -5 });
|
|
150
|
+
|
|
151
|
+
const countElement = wrapper.find('.chip__count');
|
|
152
|
+
expect(countElement.exists()).toBe(true);
|
|
153
|
+
expect(countElement.text()).toBe('-5');
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('should handle empty text', async () => {
|
|
157
|
+
await wrapper.setProps({ text: '' });
|
|
158
|
+
|
|
159
|
+
const textElement = wrapper.find('.chip__text');
|
|
160
|
+
expect(textElement.exists()).toBe(true);
|
|
161
|
+
expect(textElement.text()).toBe('');
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@dragleave.stop.prevent="dragleave"
|
|
12
12
|
@dragend.stop.prevent="dragend"
|
|
13
13
|
@drop.stop.prevent="drop"
|
|
14
|
-
@click="
|
|
14
|
+
@click="() => $refs.file.click()"
|
|
15
15
|
>
|
|
16
16
|
<UnnnicIcon
|
|
17
17
|
class="unnnic-upload-area__dropzone__icon"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<script setup>
|
|
67
|
-
import { ref, computed, getCurrentInstance
|
|
67
|
+
import { ref, computed, getCurrentInstance } from 'vue';
|
|
68
68
|
import mime from 'mime';
|
|
69
69
|
|
|
70
70
|
import UnnnicIcon from '../Icon.vue';
|
|
@@ -73,7 +73,6 @@ const isDragging = ref(false);
|
|
|
73
73
|
const hasError = ref(false);
|
|
74
74
|
const dragEnterCounter = ref(0);
|
|
75
75
|
const file = ref();
|
|
76
|
-
const fileRef = useTemplateRef('file');
|
|
77
76
|
|
|
78
77
|
const props = defineProps({
|
|
79
78
|
acceptMultiple: {
|
|
@@ -112,11 +111,6 @@ const props = defineProps({
|
|
|
112
111
|
type: String,
|
|
113
112
|
default: '',
|
|
114
113
|
},
|
|
115
|
-
|
|
116
|
-
disabled: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: false,
|
|
119
|
-
}
|
|
120
114
|
});
|
|
121
115
|
|
|
122
116
|
const emit = defineEmits([
|
|
@@ -141,21 +135,15 @@ const formattedSupportedFormats = computed(() => {
|
|
|
141
135
|
});
|
|
142
136
|
|
|
143
137
|
function dragenter() {
|
|
144
|
-
if (props.disabled) return;
|
|
145
|
-
|
|
146
138
|
dragEnterCounter.value += 1;
|
|
147
139
|
isDragging.value = true;
|
|
148
140
|
}
|
|
149
141
|
|
|
150
142
|
function dragover() {
|
|
151
|
-
if (props.disabled) return;
|
|
152
|
-
|
|
153
143
|
isDragging.value = true;
|
|
154
144
|
}
|
|
155
145
|
|
|
156
146
|
function dragleave() {
|
|
157
|
-
if (props.disabled) return;
|
|
158
|
-
|
|
159
147
|
dragEnterCounter.value -= 1;
|
|
160
148
|
if (dragEnterCounter.value === 0) {
|
|
161
149
|
isDragging.value = false;
|
|
@@ -163,14 +151,10 @@ function dragleave() {
|
|
|
163
151
|
}
|
|
164
152
|
|
|
165
153
|
function dragend() {
|
|
166
|
-
if (props.disabled) return;
|
|
167
|
-
|
|
168
154
|
isDragging.value = false;
|
|
169
155
|
}
|
|
170
156
|
|
|
171
157
|
function drop(event) {
|
|
172
|
-
if (props.disabled) return;
|
|
173
|
-
|
|
174
158
|
isDragging.value = false;
|
|
175
159
|
|
|
176
160
|
const { files } = event.dataTransfer;
|
|
@@ -180,15 +164,7 @@ function drop(event) {
|
|
|
180
164
|
}
|
|
181
165
|
}
|
|
182
166
|
|
|
183
|
-
function handleDropzoneClick() {
|
|
184
|
-
if (props.disabled) return;
|
|
185
|
-
|
|
186
|
-
fileRef.value.click();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
167
|
function handleFileChange(event) {
|
|
190
|
-
if (props.disabled) return;
|
|
191
|
-
|
|
192
168
|
const { files } = event.target;
|
|
193
169
|
|
|
194
170
|
if (validateFiles(files)) {
|
|
@@ -1,91 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
| 'background-carpet'
|
|
6
|
-
| 'background-snow'
|
|
7
|
-
| 'background-lightest'
|
|
8
|
-
| 'background-white'
|
|
9
|
-
| 'neutral-black'
|
|
10
|
-
| 'neutral-darkest'
|
|
11
|
-
| 'neutral-dark'
|
|
12
|
-
| 'neutral-cloudy'
|
|
13
|
-
| 'neutral-cleanest'
|
|
14
|
-
| 'neutral-clean'
|
|
15
|
-
| 'neutral-soft'
|
|
16
|
-
| 'neutral-lightest'
|
|
17
|
-
| 'neutral-light'
|
|
18
|
-
| 'neutral-white'
|
|
19
|
-
| 'neutral-snow'
|
|
20
|
-
| 'feedback-red'
|
|
21
|
-
| 'feedback-green'
|
|
22
|
-
| 'feedback-yellow'
|
|
23
|
-
| 'feedback-blue'
|
|
24
|
-
| 'feedback-grey'
|
|
25
|
-
| 'aux-blue'
|
|
26
|
-
| 'aux-purple'
|
|
27
|
-
| 'aux-orange'
|
|
28
|
-
| 'aux-lemon'
|
|
29
|
-
| 'aux-pink'
|
|
30
|
-
| 'aux-baby-blue'
|
|
31
|
-
| 'aux-baby-yellow'
|
|
32
|
-
| 'aux-baby-red'
|
|
33
|
-
| 'aux-baby-green'
|
|
34
|
-
| 'aux-baby-pink'
|
|
35
|
-
| 'aux-green-100'
|
|
36
|
-
| 'aux-green-300'
|
|
37
|
-
| 'aux-green-500'
|
|
38
|
-
| 'aux-green-700'
|
|
39
|
-
| 'aux-green-900'
|
|
40
|
-
| 'aux-blue-100'
|
|
41
|
-
| 'aux-blue-300'
|
|
42
|
-
| 'aux-blue-500'
|
|
43
|
-
| 'aux-blue-700'
|
|
44
|
-
| 'aux-blue-900'
|
|
45
|
-
| 'aux-purple-100'
|
|
46
|
-
| 'aux-purple-300'
|
|
47
|
-
| 'aux-purple-500'
|
|
48
|
-
| 'aux-purple-700'
|
|
49
|
-
| 'aux-purple-900'
|
|
50
|
-
| 'aux-red-100'
|
|
51
|
-
| 'aux-red-300'
|
|
52
|
-
| 'aux-red-500'
|
|
53
|
-
| 'aux-red-700'
|
|
54
|
-
| 'aux-red-900'
|
|
55
|
-
| 'aux-orange-100'
|
|
56
|
-
| 'aux-orange-300'
|
|
57
|
-
| 'aux-orange-500'
|
|
58
|
-
| 'aux-orange-700'
|
|
59
|
-
| 'aux-orange-900'
|
|
60
|
-
| 'aux-yellow-100'
|
|
61
|
-
| 'aux-yellow-300'
|
|
62
|
-
| 'aux-yellow-500'
|
|
63
|
-
| 'aux-yellow-700'
|
|
64
|
-
| 'aux-yellow-900'
|
|
65
|
-
| 'floweditor-blue'
|
|
66
|
-
| 'floweditor-purple'
|
|
67
|
-
| 'floweditor-wine'
|
|
68
|
-
| 'floweditor-orange'
|
|
69
|
-
| 'floweditor-pink'
|
|
70
|
-
| 'floweditor-turquoise'
|
|
71
|
-
| 'floweditor-green'
|
|
72
|
-
| 'weni-50'
|
|
73
|
-
| 'weni-100'
|
|
74
|
-
| 'weni-200'
|
|
75
|
-
| 'weni-300'
|
|
76
|
-
| 'weni-400'
|
|
77
|
-
| 'weni-500'
|
|
78
|
-
| 'weni-600'
|
|
79
|
-
| 'weni-700'
|
|
80
|
-
| 'weni-800'
|
|
81
|
-
| 'weni-900'
|
|
82
|
-
| 'weni-950'
|
|
83
|
-
| 'brand-weni'
|
|
84
|
-
| 'brand-weni-dark'
|
|
85
|
-
| 'brand-weni-soft'
|
|
86
|
-
| 'brand-sec-dark'
|
|
87
|
-
| 'brand-sec-soft'
|
|
88
|
-
| 'brand-sec';
|
|
1
|
+
import type { SchemeColor } from "@/types/scheme-colors";
|
|
2
|
+
|
|
3
|
+
// Re-export SchemeColor for backward compatibility
|
|
4
|
+
export type { SchemeColor };
|
|
89
5
|
|
|
90
6
|
export type IconSize =
|
|
91
7
|
| 'nano'
|
package/src/components/Icon.vue
CHANGED
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
import { computed } from 'vue';
|
|
41
41
|
import icons from '../utils/icons';
|
|
42
42
|
import OldIconsMap from './Icon/OldIconsMap.json';
|
|
43
|
-
import type { IconProps, IconSize, LineHeight
|
|
43
|
+
import type { IconProps, IconSize, LineHeight } from './Icon/types';
|
|
44
|
+
import type { SchemeColor } from '@/types/scheme-colors';
|
|
44
45
|
|
|
45
46
|
defineOptions({
|
|
46
47
|
name: 'UnnnicIcon',
|
|
@@ -95,95 +96,6 @@ const onClick = (event: Event) => {
|
|
|
95
96
|
<style lang="scss">
|
|
96
97
|
@use '@/assets/scss/unnnic' as *;
|
|
97
98
|
|
|
98
|
-
$scheme-colors:
|
|
99
|
-
'background-solo' $unnnic-color-background-solo,
|
|
100
|
-
'background-sky' $unnnic-color-background-sky,
|
|
101
|
-
'background-grass' $unnnic-color-background-grass,
|
|
102
|
-
'background-carpet' $unnnic-color-background-carpet,
|
|
103
|
-
'background-snow' $unnnic-color-background-snow,
|
|
104
|
-
'background-lightest' $unnnic-color-background-lightest,
|
|
105
|
-
'background-white' $unnnic-color-background-white,
|
|
106
|
-
'neutral-black' $unnnic-color-neutral-black,
|
|
107
|
-
'neutral-darkest' $unnnic-color-neutral-darkest,
|
|
108
|
-
'neutral-dark' $unnnic-color-neutral-dark,
|
|
109
|
-
'neutral-cloudy' $unnnic-color-neutral-cloudy,
|
|
110
|
-
'neutral-cleanest' $unnnic-color-neutral-cleanest,
|
|
111
|
-
'neutral-clean' $unnnic-color-neutral-clean,
|
|
112
|
-
'neutral-soft' $unnnic-color-neutral-soft,
|
|
113
|
-
'neutral-lightest' $unnnic-color-neutral-lightest,
|
|
114
|
-
'neutral-light' $unnnic-color-neutral-light,
|
|
115
|
-
'neutral-white' $unnnic-color-neutral-white,
|
|
116
|
-
'neutral-snow' $unnnic-color-neutral-snow,
|
|
117
|
-
'feedback-red' $unnnic-color-feedback-red,
|
|
118
|
-
'feedback-green' $unnnic-color-feedback-green,
|
|
119
|
-
'feedback-yellow' $unnnic-color-feedback-yellow,
|
|
120
|
-
'feedback-blue' $unnnic-color-feedback-blue,
|
|
121
|
-
'feedback-grey' $unnnic-color-feedback-grey,
|
|
122
|
-
'aux-blue' $unnnic-color-aux-blue,
|
|
123
|
-
'aux-purple' $unnnic-color-aux-purple,
|
|
124
|
-
'aux-orange' $unnnic-color-aux-orange,
|
|
125
|
-
'aux-lemon' $unnnic-color-aux-lemon,
|
|
126
|
-
'aux-pink' $unnnic-color-aux-pink,
|
|
127
|
-
'aux-baby-blue' $unnnic-color-aux-baby-blue,
|
|
128
|
-
'aux-baby-yellow' $unnnic-color-aux-baby-yellow,
|
|
129
|
-
'aux-baby-red' $unnnic-color-aux-baby-red,
|
|
130
|
-
'aux-baby-green' $unnnic-color-aux-baby-green,
|
|
131
|
-
'aux-baby-pink' $unnnic-color-aux-baby-pink,
|
|
132
|
-
'aux-green-100' $unnnic-color-aux-green-100,
|
|
133
|
-
'aux-green-300' $unnnic-color-aux-green-300,
|
|
134
|
-
'aux-green-500' $unnnic-color-aux-green-500,
|
|
135
|
-
'aux-green-700' $unnnic-color-aux-green-700,
|
|
136
|
-
'aux-green-900' $unnnic-color-aux-green-900,
|
|
137
|
-
'aux-blue-100' $unnnic-color-aux-blue-100,
|
|
138
|
-
'aux-blue-300' $unnnic-color-aux-blue-300,
|
|
139
|
-
'aux-blue-500' $unnnic-color-aux-blue-500,
|
|
140
|
-
'aux-blue-700' $unnnic-color-aux-blue-700,
|
|
141
|
-
'aux-blue-900' $unnnic-color-aux-blue-900,
|
|
142
|
-
'aux-purple-100' $unnnic-color-aux-purple-100,
|
|
143
|
-
'aux-purple-300' $unnnic-color-aux-purple-300,
|
|
144
|
-
'aux-purple-500' $unnnic-color-aux-purple-500,
|
|
145
|
-
'aux-purple-700' $unnnic-color-aux-purple-700,
|
|
146
|
-
'aux-purple-900' $unnnic-color-aux-purple-900,
|
|
147
|
-
'aux-red-100' $unnnic-color-aux-red-100,
|
|
148
|
-
'aux-red-300' $unnnic-color-aux-red-300,
|
|
149
|
-
'aux-red-500' $unnnic-color-aux-red-500,
|
|
150
|
-
'aux-red-700' $unnnic-color-aux-red-700,
|
|
151
|
-
'aux-red-900' $unnnic-color-aux-red-900,
|
|
152
|
-
'aux-orange-100' $unnnic-color-aux-orange-100,
|
|
153
|
-
'aux-orange-300' $unnnic-color-aux-orange-300,
|
|
154
|
-
'aux-orange-500' $unnnic-color-aux-orange-500,
|
|
155
|
-
'aux-orange-700' $unnnic-color-aux-orange-700,
|
|
156
|
-
'aux-orange-900' $unnnic-color-aux-orange-900,
|
|
157
|
-
'aux-yellow-100' $unnnic-color-aux-yellow-100,
|
|
158
|
-
'aux-yellow-300' $unnnic-color-aux-yellow-300,
|
|
159
|
-
'aux-yellow-500' $unnnic-color-aux-yellow-500,
|
|
160
|
-
'aux-yellow-700' $unnnic-color-aux-yellow-700,
|
|
161
|
-
'aux-yellow-900' $unnnic-color-aux-yellow-900,
|
|
162
|
-
'floweditor-blue' $unnnic-color-floweditor-blue,
|
|
163
|
-
'floweditor-purple' $unnnic-color-floweditor-purple,
|
|
164
|
-
'floweditor-wine' $unnnic-color-floweditor-wine,
|
|
165
|
-
'floweditor-orange' $unnnic-color-floweditor-orange,
|
|
166
|
-
'floweditor-pink' $unnnic-color-floweditor-pink,
|
|
167
|
-
'floweditor-turquoise' $unnnic-color-floweditor-turquoise,
|
|
168
|
-
'floweditor-green' $unnnic-color-floweditor-green,
|
|
169
|
-
'weni-50' $unnnic-color-weni-50,
|
|
170
|
-
'weni-100' $unnnic-color-weni-100,
|
|
171
|
-
'weni-200' $unnnic-color-weni-200,
|
|
172
|
-
'weni-300' $unnnic-color-weni-300,
|
|
173
|
-
'weni-400' $unnnic-color-weni-400,
|
|
174
|
-
'weni-500' $unnnic-color-weni-500,
|
|
175
|
-
'weni-600' $unnnic-color-weni-600,
|
|
176
|
-
'weni-700' $unnnic-color-weni-700,
|
|
177
|
-
'weni-800' $unnnic-color-weni-800,
|
|
178
|
-
'weni-900' $unnnic-color-weni-900,
|
|
179
|
-
'weni-950' $unnnic-color-weni-950,
|
|
180
|
-
'brand-weni' $unnnic-color-brand-weni,
|
|
181
|
-
'brand-weni-dark' $unnnic-color-brand-weni-dark,
|
|
182
|
-
'brand-weni-soft' $unnnic-color-brand-weni-soft,
|
|
183
|
-
'brand-sec-dark' $unnnic-color-brand-sec-dark,
|
|
184
|
-
'brand-sec-soft' $unnnic-color-brand-sec-soft,
|
|
185
|
-
'brand-sec' $unnnic-color-brand-sec;
|
|
186
|
-
|
|
187
99
|
$icon-sizes:
|
|
188
100
|
'xl' $unnnic-icon-size-xl,
|
|
189
101
|
'lg' $unnnic-icon-size-lg,
|
|
@@ -233,7 +145,7 @@ $icon-sizes:
|
|
|
233
145
|
font-family: 'Material Symbols Rounded Filled';
|
|
234
146
|
}
|
|
235
147
|
|
|
236
|
-
@each $name, $color in $scheme-colors {
|
|
148
|
+
@each $name, $color in $unnnic-scheme-colors {
|
|
237
149
|
&.unnnic-icon-scheme--#{$name} {
|
|
238
150
|
color: $color;
|
|
239
151
|
}
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
</section>
|
|
25
25
|
|
|
26
26
|
<section class="unnnic-modal-dialog__container__body">
|
|
27
|
-
<header
|
|
27
|
+
<header
|
|
28
|
+
v-if="title"
|
|
29
|
+
class="unnnic-modal-dialog__container__header"
|
|
30
|
+
>
|
|
28
31
|
<section class="unnnic-modal-dialog__container__title-container">
|
|
29
32
|
<UnnnicIcon
|
|
30
33
|
v-if="icon || type"
|
|
@@ -46,7 +49,6 @@
|
|
|
46
49
|
data-testid="close-icon"
|
|
47
50
|
icon="close"
|
|
48
51
|
clickable
|
|
49
|
-
scheme="neutral-cloudy"
|
|
50
52
|
@click="close()"
|
|
51
53
|
/>
|
|
52
54
|
</header>
|
|
@@ -96,12 +98,12 @@
|
|
|
96
98
|
</template>
|
|
97
99
|
|
|
98
100
|
<script>
|
|
99
|
-
import UnnnicIcon from
|
|
100
|
-
import UnnnicButton from
|
|
101
|
-
import UnnnicI18n from
|
|
101
|
+
import UnnnicIcon from '../Icon.vue';
|
|
102
|
+
import UnnnicButton from '../Button/Button.vue';
|
|
103
|
+
import UnnnicI18n from '../../mixins/i18n';
|
|
102
104
|
|
|
103
105
|
export default {
|
|
104
|
-
name:
|
|
106
|
+
name: 'UnnnicModalDialog',
|
|
105
107
|
components: {
|
|
106
108
|
UnnnicIcon,
|
|
107
109
|
UnnnicButton,
|
|
@@ -118,29 +120,29 @@ export default {
|
|
|
118
120
|
},
|
|
119
121
|
type: {
|
|
120
122
|
type: String,
|
|
121
|
-
default:
|
|
123
|
+
default: '',
|
|
122
124
|
validate(type) {
|
|
123
|
-
return [
|
|
125
|
+
return ['success', 'warning', 'attention'].includes(type);
|
|
124
126
|
},
|
|
125
127
|
},
|
|
126
128
|
size: {
|
|
127
129
|
type: String,
|
|
128
|
-
default:
|
|
130
|
+
default: 'md',
|
|
129
131
|
validate(size) {
|
|
130
|
-
return [
|
|
132
|
+
return ['sm', 'md', 'lg'].includes(size);
|
|
131
133
|
},
|
|
132
134
|
},
|
|
133
135
|
title: {
|
|
134
136
|
type: String,
|
|
135
|
-
default:
|
|
137
|
+
default: '',
|
|
136
138
|
},
|
|
137
139
|
icon: {
|
|
138
140
|
type: String,
|
|
139
|
-
default:
|
|
141
|
+
default: '',
|
|
140
142
|
},
|
|
141
143
|
iconScheme: {
|
|
142
144
|
type: String,
|
|
143
|
-
default:
|
|
145
|
+
default: '',
|
|
144
146
|
},
|
|
145
147
|
showCloseIcon: {
|
|
146
148
|
type: Boolean,
|
|
@@ -163,26 +165,26 @@ export default {
|
|
|
163
165
|
default: () => ({}),
|
|
164
166
|
},
|
|
165
167
|
},
|
|
166
|
-
emits: [
|
|
168
|
+
emits: ['primaryButtonClick', 'secondaryButtonClick', 'update:modelValue'],
|
|
167
169
|
|
|
168
170
|
data() {
|
|
169
171
|
return {
|
|
170
172
|
defaultTranslations: {
|
|
171
173
|
cancel: {
|
|
172
|
-
|
|
173
|
-
en:
|
|
174
|
-
es:
|
|
174
|
+
'pt-br': 'Cancelar',
|
|
175
|
+
en: 'Cancel',
|
|
176
|
+
es: 'Cancelar',
|
|
175
177
|
},
|
|
176
178
|
},
|
|
177
179
|
iconsMapper: {
|
|
178
|
-
success: { icon:
|
|
179
|
-
warning: { icon:
|
|
180
|
-
attention: { icon:
|
|
180
|
+
success: { icon: 'check_circle', scheme: 'aux-green-500' },
|
|
181
|
+
warning: { icon: 'warning', scheme: 'aux-red-500' },
|
|
182
|
+
attention: { icon: 'error', scheme: 'aux-yellow-500' },
|
|
181
183
|
},
|
|
182
184
|
primaryButtonTypeMapper: {
|
|
183
|
-
success:
|
|
184
|
-
warning:
|
|
185
|
-
attention:
|
|
185
|
+
success: 'primary',
|
|
186
|
+
warning: 'warning',
|
|
187
|
+
attention: 'attention',
|
|
186
188
|
},
|
|
187
189
|
};
|
|
188
190
|
},
|
|
@@ -193,17 +195,17 @@ export default {
|
|
|
193
195
|
},
|
|
194
196
|
methods: {
|
|
195
197
|
close() {
|
|
196
|
-
this.$emit(
|
|
198
|
+
this.$emit('update:modelValue', false);
|
|
197
199
|
},
|
|
198
200
|
updateBodyOverflow(isHidden) {
|
|
199
|
-
document.body.style.overflow = isHidden ?
|
|
201
|
+
document.body.style.overflow = isHidden ? 'hidden' : '';
|
|
200
202
|
},
|
|
201
203
|
},
|
|
202
204
|
};
|
|
203
205
|
</script>
|
|
204
206
|
|
|
205
207
|
<style lang="scss" scoped>
|
|
206
|
-
@use
|
|
208
|
+
@use '@/assets/scss/unnnic' as *;
|
|
207
209
|
* {
|
|
208
210
|
margin: 0;
|
|
209
211
|
padding: 0;
|
|
@@ -310,7 +312,7 @@ export default {
|
|
|
310
312
|
&__actions {
|
|
311
313
|
display: grid;
|
|
312
314
|
grid-template-columns: 1fr 1fr;
|
|
313
|
-
grid-template-areas:
|
|
315
|
+
grid-template-areas: 'secondary-button primary-button';
|
|
314
316
|
gap: $unnnic-spacing-sm;
|
|
315
317
|
padding: $unnnic-spacing-md;
|
|
316
318
|
flex-shrink: 0;
|
|
@@ -11,7 +11,7 @@ exports[`ModalDialog.vue > Elements rendering > matches the snapshot 1`] = `
|
|
|
11
11
|
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="test-icon" clickable="false" size="md" scheme="neutral-darkest" data-testid="title-icon" class="unnnic-modal-dialog__container__title-icon"></unnnic-icon-stub>
|
|
12
12
|
<h1 data-v-68ebadeb="" class="unnnic-modal-dialog__container__title-text" data-testid="title-text">Test Title</h1>
|
|
13
13
|
</section>
|
|
14
|
-
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-
|
|
14
|
+
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-darkest" data-testid="close-icon"></unnnic-icon-stub>
|
|
15
15
|
</header>
|
|
16
16
|
<section data-v-68ebadeb="" class="unnnic-modal-dialog__container__content"></section>
|
|
17
17
|
<section data-v-68ebadeb="" data-testid="actions-section" class="unnnic-modal-dialog__container__actions">
|
|
@@ -42,7 +42,7 @@ exports[`TableNext.vue > matches the snapshot 1`] = `
|
|
|
42
42
|
<p data-v-e29458bb="" class="table-pagination__count" data-testid="count">1 - 1 of 1</p>
|
|
43
43
|
<div data-v-0eeff8cb="" data-v-e29458bb="" class="pagination"><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="previous-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
44
44
|
<!--v-if-->
|
|
45
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
45
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--sm unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
46
46
|
<path d="M26.8368 35.0005C26.5868 35.0005 26.3506 34.903 26.1743 34.7255L12.7743 21.3255C12.4206 20.9717 12.2256 20.5017 12.2256 20.0017C12.2256 19.5017 12.4193 19.0305 12.7731 18.6767L26.1743 5.27549C26.3506 5.09799 26.5868 5.00049 26.8368 5.00049C27.0868 5.00049 27.3231 5.09799 27.4993 5.27549C27.6768 5.45174 27.7743 5.68799 27.7743 5.93799C27.7743 6.18799 27.6768 6.42424 27.4993 6.60049L14.0993 20.0005L27.4993 33.4005C27.6768 33.578 27.7743 33.813 27.7743 34.063C27.7743 34.313 27.6768 34.5492 27.4993 34.7255C27.3218 34.9017 27.0868 35.0005 26.8368 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
47
47
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
48
48
|
<!--v-if-->
|
|
@@ -53,7 +53,7 @@ exports[`TableNext.vue > matches the snapshot 1`] = `
|
|
|
53
53
|
<!--v-if-->
|
|
54
54
|
</button><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="next-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
55
55
|
<!--v-if-->
|
|
56
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
56
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--sm unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
57
57
|
<path d="M13.1635 35.0005C12.9135 35.0005 12.6772 34.903 12.501 34.7255C12.136 34.3605 12.136 33.7655 12.501 33.3992L25.901 20.0005L12.501 6.60049C12.3235 6.42424 12.226 6.18799 12.226 5.93799C12.226 5.68799 12.3235 5.45174 12.501 5.27549C12.6772 5.09799 12.9135 5.00049 13.1635 5.00049C13.4135 5.00049 13.6497 5.09799 13.826 5.27549L27.226 18.6755C27.956 19.4055 27.9572 20.5942 27.2272 21.3242L13.826 34.7255C13.6497 34.903 13.4135 35.0005 13.1635 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
58
58
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
59
59
|
<!--v-if-->
|
|
@@ -5,7 +5,7 @@ exports[`TablePagination.vue > matches the snapshot 1`] = `
|
|
|
5
5
|
<p data-v-e29458bb="" class="table-pagination__count" data-testid="count">1 - 10 of 100</p>
|
|
6
6
|
<div data-v-0eeff8cb="" data-v-e29458bb="" class="pagination"><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="previous-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
7
7
|
<!--v-if-->
|
|
8
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
8
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--sm unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
9
9
|
<path d="M26.8368 35.0005C26.5868 35.0005 26.3506 34.903 26.1743 34.7255L12.7743 21.3255C12.4206 20.9717 12.2256 20.5017 12.2256 20.0017C12.2256 19.5017 12.4193 19.0305 12.7731 18.6767L26.1743 5.27549C26.3506 5.09799 26.5868 5.00049 26.8368 5.00049C27.0868 5.00049 27.3231 5.09799 27.4993 5.27549C27.6768 5.45174 27.7743 5.68799 27.7743 5.93799C27.7743 6.18799 27.6768 6.42424 27.4993 6.60049L14.0993 20.0005L27.4993 33.4005C27.6768 33.578 27.7743 33.813 27.7743 34.063C27.7743 34.313 27.6768 34.5492 27.4993 34.7255C27.3218 34.9017 27.0868 35.0005 26.8368 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
10
10
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
11
11
|
<!--v-if-->
|
|
@@ -36,7 +36,7 @@ exports[`TablePagination.vue > matches the snapshot 1`] = `
|
|
|
36
36
|
<!--v-if-->
|
|
37
37
|
</button><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="next-button" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
38
38
|
<!--v-if-->
|
|
39
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
39
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--sm unnnic-icon-scheme--neutral-dark" data-testid="icon-center" style="visibility: visible;">
|
|
40
40
|
<path d="M13.1635 35.0005C12.9135 35.0005 12.6772 34.903 12.501 34.7255C12.136 34.3605 12.136 33.7655 12.501 33.3992L25.901 20.0005L12.501 6.60049C12.3235 6.42424 12.226 6.18799 12.226 5.93799C12.226 5.68799 12.3235 5.45174 12.501 5.27549C12.6772 5.09799 12.9135 5.00049 13.1635 5.00049C13.4135 5.00049 13.6497 5.09799 13.826 5.27549L27.226 18.6755C27.956 19.4055 27.9572 20.5942 27.2272 21.3242L13.826 34.7255C13.6497 34.903 13.4135 35.0005 13.1635 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
41
41
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
42
42
|
<!--v-if-->
|