@webitel/ui-sdk 26.8.129 → 26.8.130

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.
@@ -1,4 +1,4 @@
1
- import { C as e, i as t } from "./components-DTlPLRKR.js";
1
+ import { C as e, i as t } from "./components-BF21ppoM.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./utils-g-eGs-rV.js";
4
4
  import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,6 +1,6 @@
1
- import { n as e } from "./components-DTlPLRKR.js";
1
+ import { n as e } from "./components-BF21ppoM.js";
2
2
  import "./convertDuration-B7EyPh1B.js";
3
- import { i as t, r as n } from "./clients-CiEI5u9_.js";
3
+ import { i as t, r as n } from "./clients-CK-bThbs.js";
4
4
  import { n as r } from "./vue-i18n-VBiROMZ4.js";
5
5
  import { n as i } from "./useEventBus-B-ZeklLu.js";
6
6
  import { createBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeProps as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -55,6 +55,6 @@ function g(e, f, g, _, v, y) {
55
55
  class: "wt-tab__underline--highlight"
56
56
  }, null, 4)])], 2);
57
57
  }
58
- var _ = /*#__PURE__*/ e(f, [["render", g], ["__scopeId", "data-v-a6f6f0f3"]]);
58
+ var _ = /*#__PURE__*/ e(f, [["render", g], ["__scopeId", "data-v-29699967"]]);
59
59
  //#endregion
60
60
  export { _ as default };
@@ -1,8 +1,8 @@
1
1
  import { a as e, c as t, i as n, n as r, r as i, s as a, t as o } from "./dist-EXdgfpvN.js";
2
2
  import { n as s } from "./genClient-CvWlQ0TZ.js";
3
3
  import { a as c } from "./caseConverters-DGri4uJo.js";
4
- import { a as l, o as u, r as d, s as f } from "./components-DTlPLRKR.js";
5
- import { a as p, n as m, t as h } from "./clients-CiEI5u9_.js";
4
+ import { a as l, o as u, r as d, s as f } from "./components-BF21ppoM.js";
5
+ import { a as p, n as m, t as h } from "./clients-CK-bThbs.js";
6
6
  import { a as g, b as _, d as v, f as y, g as b, i as x, n as S, o as C, r as w, s as T, t as E, x as D } from "./enums-Qt_FgVQw.js";
7
7
  import { n as ee, t as te } from "./vue-i18n-VBiROMZ4.js";
8
8
  import "./wt-toast-DGtljpcq.js";
@@ -1,4 +1,4 @@
1
- import { w as e } from "./components-DTlPLRKR.js";
1
+ import { w as e } from "./components-BF21ppoM.js";
2
2
  import "./convertDuration-B7EyPh1B.js";
3
3
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { m as n } from "./enums-Qt_FgVQw.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.129",
3
+ "version": "26.8.130",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -0,0 +1,48 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+
3
+ import WtChatEmoji from '../wt-chat-emoji.vue';
4
+
5
+ const mountEmoji = (props = {}) =>
6
+ shallowMount(WtChatEmoji, {
7
+ props,
8
+ });
9
+
10
+ describe('WtChatEmoji', () => {
11
+ it('draws an outlined button by default', () => {
12
+ const wrapper = mountEmoji();
13
+ expect(
14
+ wrapper
15
+ .findComponent({
16
+ name: 'WtButton',
17
+ })
18
+ .props('variant'),
19
+ ).toBe('outlined');
20
+ });
21
+
22
+ it('draws the requested variant', () => {
23
+ const wrapper = mountEmoji({
24
+ variant: 'text',
25
+ });
26
+ expect(
27
+ wrapper
28
+ .findComponent({
29
+ name: 'WtButton',
30
+ })
31
+ .props('variant'),
32
+ ).toBe('text');
33
+ });
34
+
35
+ it('draws a filled button as active whatever the variant', () => {
36
+ const wrapper = mountEmoji({
37
+ variant: 'text',
38
+ filled: true,
39
+ });
40
+ expect(
41
+ wrapper
42
+ .findComponent({
43
+ name: 'WtButton',
44
+ })
45
+ .props('variant'),
46
+ ).toBe('active');
47
+ });
48
+ });
@@ -28,7 +28,7 @@
28
28
 
29
29
  <script setup>
30
30
  import { WtButton } from '@webitel/ui-sdk/components';
31
- import { ComponentSize } from '@webitel/ui-sdk/enums';
31
+ import { ButtonVariant, ComponentSize } from '@webitel/ui-sdk/enums';
32
32
  import * as EmojiPicker from 'emoji-picker-element/picker'; ///!not delete
33
33
  import { computed, nextTick, onBeforeUnmount, ref } from 'vue';
34
34
  import { eventBus } from '../../../scripts';
@@ -51,6 +51,15 @@ const props = defineProps({
51
51
  type: Boolean,
52
52
  default: false,
53
53
  },
54
+ /**
55
+ * Button variant while the picker is closed and the button is not `filled`.
56
+ * @type {ButtonVariant}
57
+ * @options ['outlined', 'text']
58
+ */
59
+ variant: {
60
+ type: String,
61
+ default: ButtonVariant.OUTLINED,
62
+ },
54
63
  rounded: {
55
64
  type: Boolean,
56
65
  default: true,
@@ -68,7 +77,7 @@ const picker = ref(null);
68
77
  // Teleport's to prop is required even if it's disabled
69
78
  const teleportValue = computed(() => props.popupTeleportTo || 'body');
70
79
  const buttonVariant = computed(() =>
71
- props.filled || isOpened.value ? 'active' : 'outlined',
80
+ props.filled || isOpened.value ? ButtonVariant.ACTIVE : props.variant,
72
81
  );
73
82
 
74
83
  const initPicker = async () => {
@@ -7,7 +7,8 @@
7
7
  --wt-tabs-text-color: var(--text-main-color);
8
8
  --wt-tabs-text-hover-color: var(--wt-tabs-text-color);
9
9
  --wt-tabs-text-active-color: var(--wt-tabs-text-color);
10
- --tab-border: 4px solid;
10
+ --tab-underline-height: 4px;
11
+ --tab-underline-border-radius: 0;
11
12
  --wt-tabs-underline-active-color: var(--primary-color);
12
13
  --tab-z-index: 1;
13
14
  }
@@ -104,24 +104,40 @@ export default {
104
104
  cursor: pointer;
105
105
  outline: none;
106
106
  border: none;
107
- border-bottom: var(--tab-border);
108
- border-bottom-color: transparent;
109
107
  background: transparent;
110
- padding-bottom: var(--tab-padding);
108
+ padding-bottom: calc(var(--tab-padding) + var(--tab-underline-height));
111
109
  color: var(--wt-tabs-text-color);
112
110
  }
113
111
 
112
+ .wt-tab::before {
113
+ position: absolute;
114
+ right: 0;
115
+ bottom: 0;
116
+ left: 0;
117
+ border-radius: var(--tab-underline-border-radius);
118
+ background: transparent;
119
+ height: var(--tab-underline-height);
120
+ content: '';
121
+ }
122
+
114
123
  .wt-tab:focus,
115
124
  .wt-tab:hover {
116
- border-bottom-color: var(--wt-tabs-underline-active-color);
117
125
  color: var(--wt-tabs-text-hover-color);
118
126
  }
119
127
 
128
+ .wt-tab:focus::before,
129
+ .wt-tab:hover::before {
130
+ background: var(--wt-tabs-underline-active-color);
131
+ }
132
+
120
133
  .wt-tab--highlight {
121
- border-bottom-color: var(--wt-tabs-underline-active-color);
122
134
  color: var(--wt-tabs-text-active-color);
123
135
  }
124
136
 
137
+ .wt-tab--highlight::before {
138
+ background: var(--wt-tabs-underline-active-color);
139
+ }
140
+
125
141
  .wt-tab::after {
126
142
  display: block;
127
143
  visibility: hidden;