@webitel/ui-sdk 25.10.45 → 25.10.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "25.10.45",
3
+ "version": "25.10.47",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run lint:fix || true) && npm run publish-lib",
@@ -56,7 +56,7 @@
56
56
  "@vuepic/vue-datepicker": "^4.5.1",
57
57
  "@vueuse/components": "^13.0.0",
58
58
  "@webitel/api-services": "^0.0.56",
59
- "@webitel/styleguide": "^24.12.74",
59
+ "@webitel/styleguide": "^24.12.78",
60
60
  "autosize": "^6.0.1",
61
61
  "axios": "^1.8.3",
62
62
  "clipboard-copy": "^4.0.1",
@@ -1,15 +1,17 @@
1
1
  <template>
2
2
  <p-button
3
3
  :class="{
4
- 'p-button--width-by-content': widthByContent,
5
- 'p-button--contains-icon': containsIcon,
4
+ 'p-button--width-by-content': widthByContent || icon,
6
5
  'p-button--wide': wide,
7
6
  'p-button--loading': showLoader,
7
+ 'p-button--icon': icon,
8
+ [ `p-button--icon-${variant} p-button--icon-${size}` ]: icon,
8
9
  }"
9
10
  :disabled="disabled"
10
11
  :loading="showLoader"
11
12
  :severity="color"
12
13
  :size="primevueSizeMap[size]"
14
+ :variant="variant"
13
15
  class="wt-button"
14
16
  v-bind="attrs"
15
17
  @click.prevent="emit('click', $event)"
@@ -20,7 +22,13 @@
20
22
  size="sm"
21
23
  />
22
24
  <div class="wt-button__contents">
23
- <slot> no content provided</slot>
25
+ <slot v-if="!icon"> no content provided</slot>
26
+ <wt-icon
27
+ v-else
28
+ :icon="icon"
29
+ :icon-prefix="iconPrefix"
30
+ :size="iconButtonSizeMap[size]"
31
+ />
24
32
  </div>
25
33
  </p-button>
26
34
  </template>
@@ -29,12 +37,19 @@
29
37
  import type { ButtonProps } from 'primevue';
30
38
  import {computed, defineEmits, defineProps, ref, useAttrs, watch} from 'vue';
31
39
 
32
- import { ButtonColor,ComponentSize } from '../../enums';
40
+ import { ButtonColor, ButtonVariant, ComponentSize, } from '../../enums';
33
41
 
34
42
  const primevueSizeMap = {
43
+ [ComponentSize.XS]: 'extra-small',
35
44
  [ComponentSize.SM]: 'small',
36
45
  [ComponentSize.MD]: 'medium',
37
- };
46
+ }
47
+
48
+ const iconButtonSizeMap = {
49
+ [ComponentSize.XS]: 'sm',
50
+ [ComponentSize.SM]: 'sm',
51
+ [ComponentSize.MD]: 'md',
52
+ }
38
53
 
39
54
  interface WtButtonProps extends /* @vue-ignore */ ButtonProps {
40
55
  color?: ButtonColor;
@@ -43,7 +58,9 @@ interface WtButtonProps extends /* @vue-ignore */ ButtonProps {
43
58
  size?: ComponentSize;
44
59
  wide?: boolean;
45
60
  widthByContent?: boolean;
46
- containsIcon?: boolean;
61
+ icon?: string;
62
+ iconPrefix?: string;
63
+ variant?: ButtonVariant;
47
64
  }
48
65
 
49
66
  const props = withDefaults(defineProps<WtButtonProps>(), {
@@ -53,7 +70,9 @@ const props = withDefaults(defineProps<WtButtonProps>(), {
53
70
  size: ComponentSize.MD,
54
71
  wide: false,
55
72
  widthByContent: false,
56
- containsIcon: false,
73
+ icon: '',
74
+ iconPrefix: '',
75
+ variant: ButtonVariant.ACTIVE,
57
76
  });
58
77
 
59
78
  const emit = defineEmits(['click']);
@@ -12,8 +12,8 @@
12
12
  --popup-max-height: 90%;
13
13
 
14
14
  --wt-popup-background-color: var(--dp-24-surface-color);
15
- --popup-sections-gap: var(--spacing-sm);
16
- --popup-padding: var(--popup-sections-gap);
15
+ --popup-sections-gap: var(--spacing-xs);
16
+ --popup-padding: var(--spacing-sm);
17
17
 
18
18
  --popup-header-padding: var(--spacing-xs);
19
19
  --wt-popup-header-background-color: var(--dp-18-surface-color);
@@ -0,0 +1,7 @@
1
+ export const ButtonVariant = {
2
+ ACTIVE: 'active',
3
+ OUTLINED: 'outlined',
4
+ TEXT: 'text',
5
+ } as const;
6
+
7
+ export type ButtonVariant = (typeof ButtonVariant)[keyof typeof ButtonVariant];
@@ -1,6 +1,8 @@
1
1
  import AbstractUserStatus from './AbstractUserStatus/AbstractUserStatus.enum.js';
2
2
  import AgentStatus from './AgentStatus/AgentStatus.enum.js';
3
3
  import { ButtonColor } from './ButtonColor/ButtonColor';
4
+ import { ButtonSize } from './ButtonSize/ButtonSize.js';
5
+ import { ButtonVariant } from './ButtonVariant/ButtonVariant';
4
6
  import ChatGatewayProvider from './ChatGatewayProvider/ChatGatewayProvider.enum.js';
5
7
  import { ChipColor } from './ChipColor/ChipColor';
6
8
  import { ComponentSize } from './ComponentSize/ComponentSize';
@@ -27,6 +29,7 @@ export {
27
29
  AgentStatus,
28
30
  AuditorSections,
29
31
  ButtonColor,
32
+ ButtonVariant,
30
33
  ChatGatewayProvider,
31
34
  ChipColor,
32
35
  ComponentSize,
@@ -1,5 +1,18 @@
1
1
  import { ButtonScheme } from '@webitel/styleguide/component-schemes';
2
2
 
3
+ import { ComponentSize } from '../../../../../enums';
4
+
5
+ const colors = [
6
+ 'primary',
7
+ 'secondary',
8
+ 'success',
9
+ 'warn',
10
+ 'error',
11
+ 'transfer',
12
+ 'job',
13
+ 'info'
14
+ ];
15
+
3
16
  const generateCustomColorCss = ({ colorName, dt }) => `
4
17
  .p-button-${colorName} {
5
18
  background: ${dt(`button.${colorName}.background`)};
@@ -13,8 +26,73 @@ const generateCustomColorCss = ({ colorName, dt }) => `
13
26
  background: ${dt(`button.${colorName}.activeBackground`)};
14
27
  color: ${dt(`button.${colorName}.activeColor`)};
15
28
  }
29
+
30
+ .p-button-outlined.p-button-${colorName} {
31
+ outline-color: ${dt(`button.outlined.${colorName}.borderColor`)};
32
+ background: ${dt(`button.outlined.${colorName}.background`)};
33
+ color: ${dt(`button.outlined.${colorName}.color`)};
34
+ }
35
+ .p-button-outlined.p-button-${colorName}:not(:disabled):hover {
36
+ outline-color: ${dt(`button.outlined.${colorName}.borderColor`)};
37
+ background: ${dt(`button.outlined.${colorName}.hoverBackground`)};
38
+ }
39
+ .p-button-outlined.p-button-${colorName}:not(:disabled):active {
40
+ background: ${dt(`button.outlined.${colorName}.activeBackground`)};
41
+ color: ${dt(`button.outlined.${colorName}.activeColor`)};
42
+ }
43
+
44
+ .p-button-text.p-button-${colorName} {
45
+ background: ${dt(`button.text.${colorName}.background`)};
46
+ color: ${dt(`button.text.${colorName}.color`)};
47
+ }
48
+ .p-button-text.p-button-${colorName}:not(:disabled):hover {
49
+ background: ${dt(`button.text.${colorName}.hoverBackground`)};
50
+ }
51
+ .p-button-text.p-button-${colorName}:not(:disabled):active {
52
+ background: ${dt(`button.text.${colorName}.activeBackground`)};
53
+ }
16
54
  `;
17
55
 
56
+ const generateCustomActiveIconColorCss = ({ colorName, dt }) => `
57
+ .p-button--icon-active.p-button-${colorName} {
58
+ background: ${dt(`button.${colorName}.background`)};
59
+ }
60
+ .p-button--icon-active.p-button-${colorName}:not(:disabled):hover {
61
+ background: ${dt(`button.${colorName}.hoverBackground`)};
62
+ }
63
+ .p-button--icon-active.p-button-${colorName}:not(:disabled):active {
64
+ background: ${dt(`button.${colorName}.activeBackground`)};
65
+ }
66
+
67
+ .p-button--icon-active.p-button-${colorName} svg {
68
+ fill: ${dt(`button.${colorName}.color`)};
69
+ }
70
+ .p-button--icon-active.p-button-${colorName}:not(:disabled):hover svg {
71
+ fill: ${dt(`button.${colorName}.hoverColor`)};
72
+ }
73
+ .p-button--icon-active.p-button-${colorName}:not(:disabled):active svg {
74
+ fill: ${dt(`button.${colorName}.activeColor`)};
75
+ }
76
+ `
77
+
78
+ const generateCustomOutlinedColorCss = ({ colorName, dt }) => `
79
+ .p-button-outlined.p-button-${colorName} {
80
+ outline: 1px solid ${dt(`button.outlined.${colorName}.borderColor`)};
81
+ }
82
+ .p-button-outlined.p-button-${colorName}:not(:disabled):hover {
83
+ outline-color: ${dt(`button.outlined.${colorName}.borderColor`)};
84
+ background: ${dt(`button.outlined.${colorName}.hoverBackground`)};
85
+ }
86
+ .p-button-outlined.p-button-${colorName}:not(:disabled):active {
87
+ outline-color: ${dt(`button.outlined.${colorName}.borderColor`)};
88
+ background: ${dt(`button.outlined.${colorName}.activeBackground`)};
89
+ }
90
+
91
+ .p-button-outlined.p-button-${colorName} svg {
92
+ fill: ${dt(`button.outlined.${colorName}.color`)};
93
+ }
94
+ `
95
+
18
96
  const button = {
19
97
  ...ButtonScheme.sizes,
20
98
  colorScheme: ButtonScheme.colorScheme,
@@ -34,6 +112,11 @@ const button = {
34
112
  ${generateCustomColorCss({ colorName: 'transfer', dt })}
35
113
  ${generateCustomColorCss({ colorName: 'error', dt })}
36
114
  ${generateCustomColorCss({ colorName: 'job', dt })}
115
+
116
+ ${colors.map((color) => generateCustomActiveIconColorCss({ colorName: color, dt })).join('')}
117
+
118
+ ${colors.map((color) => generateCustomOutlinedColorCss({ colorName: color, dt })).join('')}
119
+
37
120
  .p-button:disabled {
38
121
  background: ${dt(`button.disabled.background`)};
39
122
  color: ${dt(`button.disabled.color`)};
@@ -53,9 +136,12 @@ const button = {
53
136
  font-weight: 600;
54
137
  font-size: 12px;
55
138
  line-height: 24px;
56
- border: none;
57
139
  font-family: "Montserrat", monospace;
58
140
  text-transform: uppercase;
141
+ border: none !important;
142
+ }
143
+ .p-button:hover {
144
+ border: none !important;
59
145
  }
60
146
  .p-button.p-button--width-by-content {
61
147
  min-width: 0;
@@ -63,17 +149,20 @@ const button = {
63
149
  .p-button.p-button--wide {
64
150
  width: 100%;
65
151
  }
66
- .p-button.p-button--contains-icon {
67
- line-height: 0;
68
- }
69
152
  .p-button.p-button--loading {
70
153
  pointer-events: none;
71
154
  }
72
- .p-button:hover {
73
- border: none;
155
+ .p-button.p-button-outlined {
156
+ background: transparent;
157
+ }
158
+ .p-button--icon-${ComponentSize.XS} {
159
+ padding: ${dt(`button.icon.xs.padding`)};
160
+ }
161
+ .p-button--icon-${ComponentSize.SM} {
162
+ padding: ${dt(`button.icon.sm.padding`)};
74
163
  }
75
- .p-button:not(:disabled):hover {
76
- border: none;
164
+ .p-button--icon-${ComponentSize.MD} {
165
+ padding: ${dt(`button.icon.md.padding`)};
77
166
  }
78
167
  `,
79
168
  };
@@ -1,6 +1,12 @@
1
1
  import type { ButtonProps } from 'primevue';
2
- import { ButtonColor, ComponentSize } from '../../enums';
2
+ import { ButtonColor, ButtonVariant, ComponentSize } from '../../enums';
3
3
  declare const primevueSizeMap: {
4
+ xs: string;
5
+ sm: string;
6
+ md: string;
7
+ };
8
+ declare const iconButtonSizeMap: {
9
+ xs: string;
4
10
  sm: string;
5
11
  md: string;
6
12
  };
@@ -11,7 +17,9 @@ interface WtButtonProps extends /* @vue-ignore */ ButtonProps {
11
17
  size?: ComponentSize;
12
18
  wide?: boolean;
13
19
  widthByContent?: boolean;
14
- containsIcon?: boolean;
20
+ icon?: string;
21
+ iconPrefix?: string;
22
+ variant?: ButtonVariant;
15
23
  }
16
24
  declare const emit: (event: "click", ...args: any[]) => void;
17
25
  declare const attrs: {
@@ -26,6 +34,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
26
34
  }>;
27
35
  declare const __VLS_self: import("vue").DefineComponent<WtButtonProps, {
28
36
  primevueSizeMap: typeof primevueSizeMap;
37
+ iconButtonSizeMap: typeof iconButtonSizeMap;
29
38
  emit: typeof emit;
30
39
  attrs: typeof attrs;
31
40
  showLoader: typeof showLoader;
@@ -36,12 +45,14 @@ declare const __VLS_self: import("vue").DefineComponent<WtButtonProps, {
36
45
  onClick?: (...args: any[]) => any;
37
46
  }>, {
38
47
  color: ButtonColor;
48
+ icon: string;
39
49
  disabled: boolean;
40
50
  size: ComponentSize;
41
51
  wide: boolean;
42
52
  loading: boolean;
43
53
  widthByContent: boolean;
44
- containsIcon: boolean;
54
+ iconPrefix: string;
55
+ variant: ButtonVariant;
45
56
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
46
57
  declare const __VLS_component: import("vue").DefineComponent<WtButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
58
  click: (...args: any[]) => void;
@@ -49,12 +60,14 @@ declare const __VLS_component: import("vue").DefineComponent<WtButtonProps, {},
49
60
  onClick?: (...args: any[]) => any;
50
61
  }>, {
51
62
  color: ButtonColor;
63
+ icon: string;
52
64
  disabled: boolean;
53
65
  size: ComponentSize;
54
66
  wide: boolean;
55
67
  loading: boolean;
56
68
  widthByContent: boolean;
57
- containsIcon: boolean;
69
+ iconPrefix: string;
70
+ variant: ButtonVariant;
58
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
59
72
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
60
73
  export default _default;
@@ -7,8 +7,8 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  active: boolean;
8
8
  wide: boolean;
9
9
  loading: boolean;
10
- rounded: boolean;
11
10
  iconPrefix: string;
11
+ rounded: boolean;
12
12
  $props: {
13
13
  readonly color?: string;
14
14
  readonly icon?: string;
@@ -17,8 +17,8 @@ declare const _default: import("vue").DefineComponent<{}, {
17
17
  readonly active?: boolean;
18
18
  readonly wide?: boolean;
19
19
  readonly loading?: boolean;
20
- readonly rounded?: boolean;
21
20
  readonly iconPrefix?: string;
21
+ readonly rounded?: boolean;
22
22
  };
23
23
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
24
  export default _default;
@@ -0,0 +1,6 @@
1
+ export declare const ButtonVariant: {
2
+ readonly ACTIVE: "active";
3
+ readonly OUTLINED: "outlined";
4
+ readonly TEXT: "text";
5
+ };
6
+ export type ButtonVariant = (typeof ButtonVariant)[keyof typeof ButtonVariant];
@@ -1,6 +1,7 @@
1
1
  import AbstractUserStatus from './AbstractUserStatus/AbstractUserStatus.enum.js';
2
2
  import AgentStatus from './AgentStatus/AgentStatus.enum.js';
3
3
  import { ButtonColor } from './ButtonColor/ButtonColor';
4
+ import { ButtonVariant } from './ButtonVariant/ButtonVariant';
4
5
  import ChatGatewayProvider from './ChatGatewayProvider/ChatGatewayProvider.enum.js';
5
6
  import { ChipColor } from './ChipColor/ChipColor';
6
7
  import { ComponentSize } from './ComponentSize/ComponentSize';
@@ -20,4 +21,4 @@ import WebitelApplications from './WebitelApplications/WebitelApplications.enum.
20
21
  import { WtApplication } from './WebitelApplications/WtApplication';
21
22
  import { WtObject } from './WtObject/WtObject';
22
23
  import { WtTypeExtensionFieldKind } from './WtTypeExtensionFieldKind/WtTypeExtensionFieldKind';
23
- export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, IconAction, IconColor, ProcessingTableColumnType, QueueType, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WtApplication, WtObject, WtTypeExtensionFieldKind, };
24
+ export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ButtonVariant, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, IconAction, IconColor, ProcessingTableColumnType, QueueType, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WtApplication, WtObject, WtTypeExtensionFieldKind, };
@@ -159,25 +159,19 @@ declare const button: {
159
159
  borderColor: string;
160
160
  color: string;
161
161
  };
162
- help: {
163
- hoverBackground: string;
164
- activeBackground: string;
165
- borderColor: string;
166
- color: string;
167
- };
168
- danger: {
162
+ job: {
169
163
  hoverBackground: string;
170
164
  activeBackground: string;
171
165
  borderColor: string;
172
166
  color: string;
173
167
  };
174
- contrast: {
168
+ error: {
175
169
  hoverBackground: string;
176
170
  activeBackground: string;
177
171
  borderColor: string;
178
172
  color: string;
179
173
  };
180
- plain: {
174
+ transfer: {
181
175
  hoverBackground: string;
182
176
  activeBackground: string;
183
177
  borderColor: string;
@@ -210,22 +204,17 @@ declare const button: {
210
204
  activeBackground: string;
211
205
  color: string;
212
206
  };
213
- help: {
214
- hoverBackground: string;
215
- activeBackground: string;
216
- color: string;
217
- };
218
- danger: {
207
+ job: {
219
208
  hoverBackground: string;
220
209
  activeBackground: string;
221
210
  color: string;
222
211
  };
223
- contrast: {
212
+ error: {
224
213
  hoverBackground: string;
225
214
  activeBackground: string;
226
215
  color: string;
227
216
  };
228
- plain: {
217
+ transfer: {
229
218
  hoverBackground: string;
230
219
  activeBackground: string;
231
220
  color: string;
@@ -395,25 +384,19 @@ declare const button: {
395
384
  borderColor: string;
396
385
  color: string;
397
386
  };
398
- help: {
399
- hoverBackground: string;
400
- activeBackground: string;
401
- borderColor: string;
402
- color: string;
403
- };
404
- danger: {
387
+ error: {
405
388
  hoverBackground: string;
406
389
  activeBackground: string;
407
390
  borderColor: string;
408
391
  color: string;
409
392
  };
410
- contrast: {
393
+ transfer: {
411
394
  hoverBackground: string;
412
395
  activeBackground: string;
413
396
  borderColor: string;
414
397
  color: string;
415
398
  };
416
- plain: {
399
+ job: {
417
400
  hoverBackground: string;
418
401
  activeBackground: string;
419
402
  borderColor: string;
@@ -446,22 +429,17 @@ declare const button: {
446
429
  activeBackground: string;
447
430
  color: string;
448
431
  };
449
- help: {
450
- hoverBackground: string;
451
- activeBackground: string;
452
- color: string;
453
- };
454
- danger: {
432
+ job: {
455
433
  hoverBackground: string;
456
434
  activeBackground: string;
457
435
  color: string;
458
436
  };
459
- contrast: {
437
+ error: {
460
438
  hoverBackground: string;
461
439
  activeBackground: string;
462
440
  color: string;
463
441
  };
464
- plain: {
442
+ transfer: {
465
443
  hoverBackground: string;
466
444
  activeBackground: string;
467
445
  color: string;
@@ -503,6 +481,17 @@ declare const button: {
503
481
  paddingY: string;
504
482
  iconOnlyWidth: string;
505
483
  };
484
+ icon: {
485
+ xs: {
486
+ padding: string;
487
+ };
488
+ sm: {
489
+ padding: string;
490
+ };
491
+ md: {
492
+ padding: string;
493
+ };
494
+ };
506
495
  label: {
507
496
  fontWeight: string;
508
497
  };