@weni/unnnic-system 3.12.8-alpha.0 → 3.12.8
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 +15 -0
- package/dist/{es-52edeb71.mjs → es-62c1e8d3.mjs} +1 -1
- package/dist/{index-756fe685.mjs → index-ef197fd5.mjs} +52261 -55425
- package/dist/index.d.ts +1449 -5339
- package/dist/{pt-br-24583c8c.mjs → pt-br-198b147b.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +203 -233
- package/dist/unnnic.umd.js +44 -48
- package/package.json +2 -3
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Drawer/Drawer.vue +269 -190
- package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/FormElement/FormElement.vue +1 -1
- package/src/components/Input/BaseInput.vue +5 -25
- package/src/components/Input/Input.scss +3 -2
- package/src/components/Input/Input.vue +1 -24
- package/src/components/Input/TextInput.vue +25 -64
- package/src/components/Input/__test__/TextInput.spec.js +1 -1
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +1 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -7
- package/src/components/ModalDialog/ModalDialog.vue +148 -64
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/MultiSelect/MultiSelect.vue +297 -0
- package/src/components/Radio/Radio.vue +1 -1
- package/src/components/Switch/Switch.vue +1 -1
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/TemplatePreview/TemplatePreview.vue +2 -2
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +1 -1
- package/src/components/Toast/Toast.vue +9 -16
- package/src/components/ToolTip/ToolTip.vue +177 -25
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
- package/src/components/index.ts +6 -62
- package/src/components/ui/popover/PopoverContent.vue +4 -5
- package/src/components/ui/popover/PopoverOption.vue +0 -4
- package/src/components/ui/popover/PopoverTrigger.vue +1 -5
- package/src/locales/en.json +1 -3
- package/src/locales/es.json +1 -3
- package/src/locales/pt_br.json +1 -3
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/Input.mdx +0 -3
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/MultiSelect.stories.js +45 -143
- package/src/components/MultiSelect/MultSelectOption.vue +0 -49
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +0 -557
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +0 -229
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +0 -87
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +0 -51
- package/src/components/MultiSelect/index.vue +0 -265
- package/src/components/Select/__tests__/Select.spec.js +0 -422
- package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
- package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -71
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +0 -15
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +0 -25
- package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +0 -8
- package/src/components/Select/index.vue +0 -308
- package/src/components/ui/dialog/Dialog.vue +0 -19
- package/src/components/ui/dialog/DialogClose.vue +0 -29
- package/src/components/ui/dialog/DialogContent.vue +0 -140
- package/src/components/ui/dialog/DialogFooter.vue +0 -50
- package/src/components/ui/dialog/DialogHeader.vue +0 -83
- package/src/components/ui/dialog/DialogTitle.vue +0 -38
- package/src/components/ui/dialog/DialogTrigger.vue +0 -16
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/components/ui/drawer/Drawer.vue +0 -27
- package/src/components/ui/drawer/DrawerClose.vue +0 -31
- package/src/components/ui/drawer/DrawerContent.vue +0 -111
- package/src/components/ui/drawer/DrawerDescription.vue +0 -40
- package/src/components/ui/drawer/DrawerFooter.vue +0 -38
- package/src/components/ui/drawer/DrawerHeader.vue +0 -57
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
- package/src/components/ui/drawer/DrawerTitle.vue +0 -37
- package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
- package/src/components/ui/drawer/index.ts +0 -10
- package/src/components/ui/tooltip/Tooltip.vue +0 -21
- package/src/components/ui/tooltip/TooltipContent.vue +0 -74
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
- package/src/components/ui/tooltip/index.ts +0 -3
- package/src/lib/layer-manager.ts +0 -92
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -611
- package/src/stories/LayerManager.docs.mdx +0 -40
- package/src/stories/LayerManager.stories.js +0 -364
- package/src/stories/Select.stories.js +0 -161
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Drawer.vue > Component Rendering > Component Rendering > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
4
|
+
"<aside data-v-196de012="" class="unnnic-drawer" data-testid="drawer">
|
|
5
|
+
<section data-v-196de012="" class="unnnic-drawer__overlay" data-testid="overlay"></section>
|
|
6
|
+
<transition-stub data-v-196de012="" name="drawer" appear="true" persisted="false" css="true">
|
|
7
|
+
<section data-v-196de012="" data-testid="drawer-container" class="unnnic-drawer__container unnnic-drawer__container--md">
|
|
8
|
+
<header data-v-196de012="" class="unnnic-drawer__header">
|
|
9
|
+
<section data-v-196de012="" class="unnnic-drawer__title-container">
|
|
10
|
+
<h1 data-v-196de012="" class="unnnic-drawer__title" data-testid="drawer-title">Test Title</h1>
|
|
11
|
+
<p data-v-196de012="" class="unnnic-drawer__description" data-testid="drawer-description">Test Description</p>
|
|
12
|
+
</section>
|
|
13
|
+
<unnnic-icon-stub data-v-196de012="" filled="false" icon="arrow_back" clickable="true" size="avatar-nano" scheme="neutral-darkest" class="unnnic-drawer__close" data-testid="close-icon"></unnnic-icon-stub>
|
|
14
|
+
</header>
|
|
15
|
+
<section data-v-196de012="" class="unnnic-drawer__content"></section>
|
|
16
|
+
<footer data-v-196de012="" class="unnnic-drawer__footer" data-testid="footer">
|
|
17
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Secondary Action" type="tertiary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="secondary-button"></unnnic-button-stub>
|
|
18
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Primary Action" type="primary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="primary-button"></unnnic-button-stub>
|
|
19
|
+
</footer>
|
|
20
|
+
</section>
|
|
21
|
+
</transition-stub>
|
|
22
|
+
</aside>"
|
|
22
23
|
`;
|
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
v-mask="mask"
|
|
5
5
|
v-bind="attributes"
|
|
6
6
|
:value="fullySanitize(modelValue)"
|
|
7
|
-
:class="
|
|
7
|
+
:class="classes"
|
|
8
8
|
:type="nativeType"
|
|
9
|
-
:readonly="readonly"
|
|
10
9
|
/>
|
|
11
10
|
<input
|
|
12
11
|
v-else
|
|
13
12
|
v-bind="attributes"
|
|
14
13
|
:value="fullySanitize(modelValue)"
|
|
15
|
-
:class="
|
|
14
|
+
:class="classes"
|
|
16
15
|
:type="nativeType"
|
|
17
16
|
:maxlength="maxlength"
|
|
18
|
-
:readonly="readonly"
|
|
19
17
|
/>
|
|
20
18
|
</template>
|
|
21
19
|
|
|
@@ -51,25 +49,15 @@ export default {
|
|
|
51
49
|
},
|
|
52
50
|
hasIconLeft: Boolean,
|
|
53
51
|
hasIconRight: Boolean,
|
|
54
|
-
hasClearIcon: Boolean,
|
|
55
52
|
maxlength: {
|
|
56
53
|
type: Number,
|
|
57
54
|
default: null,
|
|
58
55
|
},
|
|
59
|
-
readonly: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false,
|
|
62
|
-
},
|
|
63
|
-
useFocusProp: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false,
|
|
66
|
-
},
|
|
67
|
-
focus: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false,
|
|
70
|
-
},
|
|
71
56
|
},
|
|
72
57
|
emits: ['update:modelValue'],
|
|
58
|
+
data() {
|
|
59
|
+
return {};
|
|
60
|
+
},
|
|
73
61
|
computed: {
|
|
74
62
|
attributes() {
|
|
75
63
|
return {
|
|
@@ -89,7 +77,6 @@ export default {
|
|
|
89
77
|
{
|
|
90
78
|
'input--has-icon-left': this.hasIconLeft,
|
|
91
79
|
'input--has-icon-right': this.hasIconRight,
|
|
92
|
-
'input--has-clear-icon': this.hasClearIcon,
|
|
93
80
|
},
|
|
94
81
|
];
|
|
95
82
|
},
|
|
@@ -130,13 +117,6 @@ export default {
|
|
|
130
117
|
|
|
131
118
|
&.input--has-icon-right {
|
|
132
119
|
padding-right: $unnnic-space-10;
|
|
133
|
-
&.input--has-clear-icon {
|
|
134
|
-
padding-right: $unnnic-space-10 + $unnnic-space-6;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
&.input--has-clear-icon {
|
|
139
|
-
padding-right: $unnnic-space-10;
|
|
140
120
|
}
|
|
141
121
|
|
|
142
122
|
&.error {
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
v-model="val"
|
|
15
15
|
class="unnnic-form-input"
|
|
16
|
-
:useFocusProp="useFocusProp"
|
|
17
|
-
:focus="focus"
|
|
18
16
|
:placeholder="placeholder"
|
|
19
17
|
:iconLeft="iconLeft"
|
|
20
18
|
:iconRight="iconRight"
|
|
@@ -27,9 +25,6 @@
|
|
|
27
25
|
:nativeType="nativeType"
|
|
28
26
|
:maxlength="maxlength"
|
|
29
27
|
:disabled="disabled"
|
|
30
|
-
:readonly="readonly"
|
|
31
|
-
:showClear="showClear"
|
|
32
|
-
@clear="$emit('clear')"
|
|
33
28
|
/>
|
|
34
29
|
|
|
35
30
|
<template
|
|
@@ -132,26 +127,8 @@ export default {
|
|
|
132
127
|
type: Boolean,
|
|
133
128
|
default: false,
|
|
134
129
|
},
|
|
135
|
-
readonly: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
default: false,
|
|
138
|
-
},
|
|
139
|
-
useFocusProp: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: false,
|
|
142
|
-
},
|
|
143
|
-
focus: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false,
|
|
146
|
-
},
|
|
147
|
-
showClear: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
default: false,
|
|
150
|
-
},
|
|
151
130
|
},
|
|
152
|
-
|
|
153
|
-
emits: ['update:modelValue', 'clear'],
|
|
154
|
-
|
|
131
|
+
emits: ['update:modelValue'],
|
|
155
132
|
data() {
|
|
156
133
|
return {
|
|
157
134
|
val: this.modelValue,
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
class="input-itself"
|
|
13
13
|
:hasIconLeft="!!iconLeft"
|
|
14
14
|
:hasIconRight="!!iconRight || allowTogglePassword"
|
|
15
|
-
:hasClearIcon="showClear"
|
|
16
15
|
:maxlength="maxlength"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:focus="focus"
|
|
16
|
+
@focus="onFocus"
|
|
17
|
+
@blur="onBlur"
|
|
20
18
|
/>
|
|
21
19
|
|
|
22
20
|
<UnnnicIcon
|
|
@@ -29,28 +27,18 @@
|
|
|
29
27
|
@click="onIconLeftClick"
|
|
30
28
|
/>
|
|
31
29
|
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
v-if="iconRightSvg"
|
|
45
|
-
:scheme="iconScheme"
|
|
46
|
-
:icon="iconRightSvg"
|
|
47
|
-
size="ant"
|
|
48
|
-
:clickable="iconRightClickable || allowTogglePassword"
|
|
49
|
-
class="icon-right"
|
|
50
|
-
:class="{ clickable: iconRightClickable || allowTogglePassword }"
|
|
51
|
-
@click="onIconRightClick"
|
|
52
|
-
/>
|
|
53
|
-
</section>
|
|
30
|
+
<UnnnicIcon
|
|
31
|
+
v-if="iconRightSvg"
|
|
32
|
+
:scheme="iconScheme"
|
|
33
|
+
:icon="iconRightSvg"
|
|
34
|
+
size="ant"
|
|
35
|
+
:clickable="iconRightClickable || allowTogglePassword"
|
|
36
|
+
:class="[
|
|
37
|
+
'icon-right',
|
|
38
|
+
{ clickable: iconRightClickable || allowTogglePassword },
|
|
39
|
+
]"
|
|
40
|
+
@click="onIconRightClick"
|
|
41
|
+
/>
|
|
54
42
|
</div>
|
|
55
43
|
</template>
|
|
56
44
|
|
|
@@ -115,24 +103,8 @@ export default {
|
|
|
115
103
|
type: Boolean,
|
|
116
104
|
default: false,
|
|
117
105
|
},
|
|
118
|
-
readonly: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false,
|
|
121
|
-
},
|
|
122
|
-
useFocusProp: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false,
|
|
125
|
-
},
|
|
126
|
-
focus: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default: false,
|
|
129
|
-
},
|
|
130
|
-
showClear: {
|
|
131
|
-
type: Boolean,
|
|
132
|
-
default: false,
|
|
133
|
-
},
|
|
134
106
|
},
|
|
135
|
-
emits: ['icon-left-click', 'icon-right-click'
|
|
107
|
+
emits: ['icon-left-click', 'icon-right-click'],
|
|
136
108
|
data() {
|
|
137
109
|
return {
|
|
138
110
|
isFocused: false,
|
|
@@ -156,6 +128,7 @@ export default {
|
|
|
156
128
|
if (this.isDisabled) {
|
|
157
129
|
return 'fg-muted';
|
|
158
130
|
}
|
|
131
|
+
|
|
159
132
|
return 'fg-base';
|
|
160
133
|
},
|
|
161
134
|
|
|
@@ -165,7 +138,7 @@ export default {
|
|
|
165
138
|
},
|
|
166
139
|
|
|
167
140
|
methods: {
|
|
168
|
-
|
|
141
|
+
focus() {
|
|
169
142
|
this.$refs['base-input'].$el.focus();
|
|
170
143
|
},
|
|
171
144
|
|
|
@@ -181,10 +154,6 @@ export default {
|
|
|
181
154
|
if (this.iconLeftClickable) this.$emit('icon-left-click');
|
|
182
155
|
},
|
|
183
156
|
|
|
184
|
-
onClearClick() {
|
|
185
|
-
this.$emit('clear');
|
|
186
|
-
},
|
|
187
|
-
|
|
188
157
|
onIconRightClick() {
|
|
189
158
|
if (this.attributes.disabled) return;
|
|
190
159
|
if (this.allowTogglePassword) this.showPassword = !this.showPassword;
|
|
@@ -202,33 +171,25 @@ export default {
|
|
|
202
171
|
}
|
|
203
172
|
|
|
204
173
|
.icon {
|
|
174
|
+
&-left,
|
|
175
|
+
&-right {
|
|
176
|
+
&:not(.clickable) {
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
205
181
|
&-left {
|
|
206
182
|
position: absolute;
|
|
207
183
|
top: 50%;
|
|
208
184
|
transform: translateY(-50%);
|
|
209
185
|
left: $unnnic-space-4;
|
|
210
|
-
|
|
211
|
-
&:not(.clickable) {
|
|
212
|
-
pointer-events: none;
|
|
213
|
-
}
|
|
214
186
|
}
|
|
215
187
|
|
|
216
|
-
&-right
|
|
188
|
+
&-right {
|
|
217
189
|
position: absolute;
|
|
218
190
|
top: 50%;
|
|
219
191
|
transform: translateY(-50%);
|
|
220
192
|
right: $unnnic-space-4;
|
|
221
|
-
|
|
222
|
-
display: flex;
|
|
223
|
-
align-items: center;
|
|
224
|
-
gap: $unnnic-space-2;
|
|
225
|
-
|
|
226
|
-
.icon-clear {
|
|
227
|
-
cursor: pointer;
|
|
228
|
-
}
|
|
229
|
-
.icon-right:not(.clickable) {
|
|
230
|
-
pointer-events: none;
|
|
231
|
-
}
|
|
232
193
|
}
|
|
233
194
|
}
|
|
234
195
|
</style>
|
|
@@ -129,7 +129,7 @@ describe('TextInput.vue', () => {
|
|
|
129
129
|
|
|
130
130
|
test('focus method calls focus on base input element', () => {
|
|
131
131
|
const focusSpy = vi.spyOn(wrapper.vm.$refs['base-input'].$el, 'focus');
|
|
132
|
-
wrapper.vm.
|
|
132
|
+
wrapper.vm.focus();
|
|
133
133
|
|
|
134
134
|
expect(focusSpy).toHaveBeenCalled();
|
|
135
135
|
focusSpy.mockRestore();
|
|
@@ -6,11 +6,7 @@ exports[`Input.vue > matches the snapshot 1`] = `
|
|
|
6
6
|
<p data-v-7f222291="" class="unnnic-label__label">Sample Label</p>
|
|
7
7
|
<!--v-if-->
|
|
8
8
|
</section>
|
|
9
|
-
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" hascloudycolor="false" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" hascloudycolor="false" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true"
|
|
10
|
-
<section data-v-a0d36167="" class="icon-right-container">
|
|
11
|
-
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
12
|
-
</section>
|
|
13
|
-
</div>
|
|
9
|
+
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" hascloudycolor="false" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" hascloudycolor="false" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>
|
|
14
10
|
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
15
11
|
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
16
12
|
<p data-v-9f8d6c86="" class="unnnic-form-element__message">Error message</p>
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`TextInput.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<div data-v-a0d36167="" class="text-input size--md"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" allowtogglepassword="false" showclear="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span>
|
|
5
|
-
<section data-v-a0d36167="" class="icon-right-container">
|
|
6
|
-
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
7
|
-
</section>
|
|
8
|
-
</div>"
|
|
9
|
-
`;
|
|
3
|
+
exports[`TextInput.vue > matches the snapshot 1`] = `"<div data-v-a0d36167="" class="text-input size--md"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" allowtogglepassword="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>"`;
|
|
@@ -1,47 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<section
|
|
3
|
+
v-if="modelValue"
|
|
4
|
+
class="unnnic-modal-dialog"
|
|
5
|
+
data-testid="modal-dialog"
|
|
5
6
|
>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
<section
|
|
8
|
+
class="unnnic-modal-dialog__overlay"
|
|
9
|
+
data-testid="modal-overlay"
|
|
10
|
+
@click.stop="!persistent && close()"
|
|
11
|
+
/>
|
|
12
|
+
<section
|
|
13
|
+
:class="[
|
|
14
|
+
'unnnic-modal-dialog__container',
|
|
15
|
+
`unnnic-modal-dialog__container--${size}`,
|
|
16
|
+
]"
|
|
17
|
+
data-testid="modal-container"
|
|
14
18
|
>
|
|
15
19
|
<section
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
'unnnic-modal-dialog__container__body--left-sidebar':
|
|
20
|
-
$slots.leftSidebar,
|
|
21
|
-
},
|
|
22
|
-
]"
|
|
20
|
+
v-if="$slots.leftSidebar"
|
|
21
|
+
class="unnnic-modal-dialog__container__left-sidebar"
|
|
23
22
|
>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</section>
|
|
30
|
-
<UnnnicDialogHeader
|
|
23
|
+
<slot name="leftSidebar" />
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<section class="unnnic-modal-dialog__container__body">
|
|
27
|
+
<header
|
|
31
28
|
v-if="title"
|
|
32
|
-
|
|
33
|
-
:type="type"
|
|
29
|
+
class="unnnic-modal-dialog__container__header"
|
|
34
30
|
>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
<section class="unnnic-modal-dialog__container__title-container">
|
|
32
|
+
<UnnnicIcon
|
|
33
|
+
v-if="icon || type"
|
|
34
|
+
data-testid="title-icon"
|
|
35
|
+
class="unnnic-modal-dialog__container__title-icon"
|
|
36
|
+
:icon="icon || iconsMapper[type]?.icon"
|
|
37
|
+
:scheme="iconScheme || iconsMapper[type]?.scheme"
|
|
38
|
+
size="md"
|
|
39
|
+
/>
|
|
40
|
+
<h1
|
|
41
|
+
class="unnnic-modal-dialog__container__title-text"
|
|
42
|
+
data-testid="title-text"
|
|
43
|
+
>
|
|
44
|
+
{{ title }}
|
|
45
|
+
</h1>
|
|
46
|
+
</section>
|
|
47
|
+
<UnnnicIcon
|
|
48
|
+
v-if="showCloseIcon"
|
|
49
|
+
data-testid="close-icon"
|
|
50
|
+
icon="close"
|
|
51
|
+
clickable
|
|
52
|
+
scheme="neutral-cloudy"
|
|
53
|
+
@click="close()"
|
|
54
|
+
/>
|
|
55
|
+
</header>
|
|
39
56
|
<section class="unnnic-modal-dialog__container__content">
|
|
40
57
|
<slot></slot>
|
|
41
58
|
</section>
|
|
42
|
-
|
|
43
|
-
<UnnnicDialogFooter
|
|
59
|
+
<section
|
|
44
60
|
v-if="primaryButtonProps.text"
|
|
61
|
+
data-testid="actions-section"
|
|
45
62
|
:class="[
|
|
46
63
|
'unnnic-modal-dialog__container__actions',
|
|
47
64
|
{
|
|
@@ -49,8 +66,6 @@
|
|
|
49
66
|
showActionsDivider,
|
|
50
67
|
},
|
|
51
68
|
]"
|
|
52
|
-
:divider="showActionsDivider"
|
|
53
|
-
data-testid="actions-section"
|
|
54
69
|
>
|
|
55
70
|
<UnnnicButton
|
|
56
71
|
v-if="!hideSecondaryButton"
|
|
@@ -77,33 +92,24 @@
|
|
|
77
92
|
class="unnnic-modal-dialog__container__actions__primary-button"
|
|
78
93
|
@click.stop="$emit('primaryButtonClick')"
|
|
79
94
|
/>
|
|
80
|
-
</
|
|
95
|
+
</section>
|
|
81
96
|
</section>
|
|
82
|
-
</
|
|
83
|
-
</
|
|
97
|
+
</section>
|
|
98
|
+
</section>
|
|
84
99
|
</template>
|
|
85
100
|
|
|
86
101
|
<script>
|
|
102
|
+
import UnnnicIcon from '../Icon.vue';
|
|
87
103
|
import UnnnicButton from '../Button/Button.vue';
|
|
88
104
|
import UnnnicI18n from '../../mixins/i18n';
|
|
89
|
-
import UnnnicDialog from '../ui/dialog/Dialog.vue';
|
|
90
|
-
import UnnnicDialogContent from '../ui/dialog/DialogContent.vue';
|
|
91
|
-
import UnnnicDialogHeader from '../ui/dialog/DialogHeader.vue';
|
|
92
|
-
import UnnnicDialogTitle from '../ui/dialog/DialogTitle.vue';
|
|
93
|
-
import UnnnicDialogFooter from '../ui/dialog/DialogFooter.vue';
|
|
94
105
|
|
|
95
106
|
export default {
|
|
96
107
|
name: 'UnnnicModalDialog',
|
|
97
108
|
components: {
|
|
109
|
+
UnnnicIcon,
|
|
98
110
|
UnnnicButton,
|
|
99
|
-
UnnnicDialog,
|
|
100
|
-
UnnnicDialogContent,
|
|
101
|
-
UnnnicDialogHeader,
|
|
102
|
-
UnnnicDialogTitle,
|
|
103
|
-
UnnnicDialogFooter,
|
|
104
111
|
},
|
|
105
112
|
mixins: [UnnnicI18n],
|
|
106
|
-
inheritAttrs: false,
|
|
107
113
|
props: {
|
|
108
114
|
modelValue: {
|
|
109
115
|
type: Boolean,
|
|
@@ -171,6 +177,11 @@ export default {
|
|
|
171
177
|
es: 'Cancelar',
|
|
172
178
|
},
|
|
173
179
|
},
|
|
180
|
+
iconsMapper: {
|
|
181
|
+
success: { icon: 'check_circle', scheme: 'aux-green-500' },
|
|
182
|
+
warning: { icon: 'warning', scheme: 'aux-red-500' },
|
|
183
|
+
attention: { icon: 'error', scheme: 'aux-yellow-500' },
|
|
184
|
+
},
|
|
174
185
|
primaryButtonTypeMapper: {
|
|
175
186
|
success: 'primary',
|
|
176
187
|
warning: 'warning',
|
|
@@ -190,39 +201,91 @@ export default {
|
|
|
190
201
|
updateBodyOverflow(isHidden) {
|
|
191
202
|
document.body.style.overflow = isHidden ? 'hidden' : '';
|
|
192
203
|
},
|
|
193
|
-
persistentHandler(event) {
|
|
194
|
-
if (this.persistent) {
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
204
|
},
|
|
199
205
|
};
|
|
200
206
|
</script>
|
|
201
207
|
|
|
202
208
|
<style lang="scss" scoped>
|
|
203
209
|
@use '@/assets/scss/unnnic' as *;
|
|
210
|
+
* {
|
|
211
|
+
margin: 0;
|
|
212
|
+
padding: 0;
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
}
|
|
215
|
+
.unnnic-modal-dialog {
|
|
216
|
+
width: 100vw;
|
|
217
|
+
height: 100vh;
|
|
218
|
+
position: fixed;
|
|
219
|
+
left: 0;
|
|
220
|
+
top: 0;
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
align-items: center;
|
|
224
|
+
z-index: 9999;
|
|
225
|
+
|
|
226
|
+
&__overlay {
|
|
227
|
+
position: absolute;
|
|
228
|
+
width: 100%;
|
|
229
|
+
height: 100%;
|
|
230
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
204
234
|
.unnnic-modal-dialog__container {
|
|
235
|
+
display: flex;
|
|
236
|
+
background: $unnnic-color-neutral-white;
|
|
237
|
+
border-radius: $unnnic-spacing-xs;
|
|
238
|
+
box-shadow: $unnnic-shadow-level-near;
|
|
239
|
+
position: fixed;
|
|
240
|
+
max-height: calc(100vh - $unnnic-spacing-giant);
|
|
241
|
+
overflow: hidden;
|
|
242
|
+
|
|
243
|
+
&--sm {
|
|
244
|
+
width: 400px;
|
|
245
|
+
}
|
|
246
|
+
&--md {
|
|
247
|
+
width: 600px;
|
|
248
|
+
}
|
|
249
|
+
&--lg {
|
|
250
|
+
width: 800px;
|
|
251
|
+
}
|
|
252
|
+
|
|
205
253
|
&__left-sidebar {
|
|
206
254
|
background-color: $unnnic-color-neutral-black;
|
|
207
255
|
color: $unnnic-color-neutral-white;
|
|
208
|
-
|
|
209
|
-
grid-area: left-sidebar;
|
|
210
|
-
grid-row: span 3;
|
|
211
256
|
}
|
|
212
257
|
|
|
213
258
|
&__body {
|
|
214
259
|
flex: 1;
|
|
215
260
|
display: flex;
|
|
216
261
|
flex-direction: column;
|
|
262
|
+
}
|
|
217
263
|
|
|
218
|
-
|
|
264
|
+
&__header {
|
|
265
|
+
display: flex;
|
|
266
|
+
justify-content: space-between;
|
|
267
|
+
align-items: center;
|
|
268
|
+
border-bottom: 1px solid $unnnic-color-neutral-soft;
|
|
269
|
+
padding: $unnnic-spacing-md;
|
|
270
|
+
flex-shrink: 0;
|
|
271
|
+
}
|
|
219
272
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
273
|
+
&__title-container {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
gap: $unnnic-spacing-ant;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&__title-icon {
|
|
280
|
+
font-size: 28px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&__title-text {
|
|
284
|
+
font-family: $unnnic-font-family-secondary;
|
|
285
|
+
font-size: $unnnic-font-size-title-sm;
|
|
286
|
+
font-weight: $unnnic-font-weight-black;
|
|
287
|
+
line-height: 28px;
|
|
288
|
+
color: $unnnic-color-neutral-darkest;
|
|
226
289
|
}
|
|
227
290
|
|
|
228
291
|
&__content {
|
|
@@ -246,5 +309,26 @@ export default {
|
|
|
246
309
|
border-radius: $unnnic-border-radius-pill;
|
|
247
310
|
}
|
|
248
311
|
}
|
|
312
|
+
|
|
313
|
+
&__actions {
|
|
314
|
+
display: grid;
|
|
315
|
+
grid-template-columns: 1fr 1fr;
|
|
316
|
+
grid-template-areas: 'secondary-button primary-button';
|
|
317
|
+
gap: $unnnic-spacing-sm;
|
|
318
|
+
padding: $unnnic-spacing-md;
|
|
319
|
+
flex-shrink: 0;
|
|
320
|
+
|
|
321
|
+
&--divider {
|
|
322
|
+
border-top: 1px solid $unnnic-color-neutral-soft;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
&__secondary-button {
|
|
326
|
+
grid-area: secondary-button;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&__primary-button {
|
|
330
|
+
grid-area: primary-button;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
249
333
|
}
|
|
250
334
|
</style>
|