@webitel/ui-sdk 1.0.12 → 1.0.16

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": "1.0.12",
3
+ "version": "1.0.16",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -8,7 +8,8 @@
8
8
  "build:app": "vue-cli-service build",
9
9
  "test:unit": "vue-cli-service test:unit",
10
10
  "lint": "vue-cli-service lint --fix",
11
- "publish-lib": "npm run test:unit && npm run build && npm publish --access public"
11
+ "publish-lib": "npm run test:unit && npm run build && npm publish --access public",
12
+ "prepare": "husky install"
12
13
  },
13
14
  "main": "./dist/@webitel/ui-sdk.common.js",
14
15
  "files": [
@@ -59,6 +60,7 @@
59
60
  "sass-loader": "^10.2.0",
60
61
  "svg-url-loader": "^6.0.0",
61
62
  "vue-template-compiler": "^2.6.11",
62
- "vuex": "^3.6.2"
63
+ "vuex": "^3.6.2",
64
+ "husky": "^7.0.0"
63
65
  }
64
66
  }
@@ -5,6 +5,7 @@
5
5
  colorClass,
6
6
  `wt-button--size-${size}`,
7
7
  {
8
+ 'wt-button--contains-icon': containsIcon,
8
9
  'wt-button--outline': outline,
9
10
  'wt-button--wide': wide,
10
11
  'wt-button--rounded': rounded,
@@ -58,6 +59,11 @@ export default {
58
59
  type: Boolean,
59
60
  default: false,
60
61
  },
62
+ containsIcon: {
63
+ type: Boolean,
64
+ default: false,
65
+ description: 'https://stackoverflow.com/a/11126701',
66
+ },
61
67
  },
62
68
  computed: {
63
69
  colorClass() {
@@ -95,6 +101,11 @@ export default {
95
101
  border-radius: var(--border-radius--pill);
96
102
  }
97
103
 
104
+ // https://stackoverflow.com/a/11126701
105
+ &--contains-icon {
106
+ line-height: 0;
107
+ }
108
+
98
109
  &--size {
99
110
  &-sm {
100
111
  padding: var(--btn-padding--size-sm);
@@ -29,7 +29,7 @@ export default {
29
29
  color: {
30
30
  type: String,
31
31
  default: 'default',
32
- options: ['default', 'contrast', 'active', 'disabled', 'success', 'danger', 'transfer', 'hold'],
32
+ options: ['default', 'contrast', 'active', 'accent', 'disabled', 'success', 'danger', 'transfer', 'hold', 'secondary-50'],
33
33
  },
34
34
  iconPrefix: {
35
35
  type: String,
@@ -1,16 +1,18 @@
1
1
  <template>
2
2
  <wt-button
3
- class="wt-rounded-action"
3
+ v-bind="{ ...$attrs, ...$props }"
4
4
  :class="[
5
+ `wt-rounded-action--color-${color}`,
6
+ { 'wt-rounded-action--active': active },
5
7
  { 'wt-rounded-action--disabled': disabled },
6
8
  ]"
7
- v-bind="{ ...$attrs, ...$props }"
9
+ class="wt-rounded-action"
8
10
  color="secondary"
9
11
  @click="$emit('click', $event)"
10
12
  >
11
13
  <wt-icon
12
- :icon="icon"
13
14
  :color="iColor"
15
+ :icon="icon"
14
16
  :size="size"
15
17
  ></wt-icon>
16
18
  </wt-button>
@@ -25,7 +27,8 @@ export default {
25
27
  },
26
28
  color: {
27
29
  type: String,
28
- default: '',
30
+ default: 'secondary',
31
+ options: ['secondary', 'accent', 'success', 'danger', 'hold', 'transfer'],
29
32
  },
30
33
  iconColor: {
31
34
  type: String,
@@ -36,6 +39,10 @@ export default {
36
39
  default: 'md',
37
40
  options: ['sm', 'md'],
38
41
  },
42
+ active: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
39
46
  disabled: {
40
47
  type: Boolean,
41
48
  default: false,
@@ -45,16 +52,7 @@ export default {
45
52
  iColor() {
46
53
  if (this.iconColor) return this.iconColor;
47
54
  if (this.disabled) return 'secondary-50';
48
- switch (this.color) {
49
- case 'success':
50
- return 'success';
51
- case 'accent':
52
- return 'accent';
53
- case 'danger':
54
- return 'danger';
55
- default:
56
- return 'default';
57
- }
55
+ return this.color;
58
56
  },
59
57
  },
60
58
  };
@@ -64,12 +62,50 @@ export default {
64
62
  <style lang="scss" scoped>
65
63
  .wt-button.wt-rounded-action {
66
64
  min-width: auto;
67
- line-height: 0;
65
+ min-height: 0;
68
66
  padding: var(--rounded-action-padding);
67
+ line-height: 0;
68
+ border: var(--btn-border);
69
+ border-color: transparent;
70
+ background: var(--rounded-action-bg-color);
71
+ box-shadow: var(--elevation-1);
72
+
73
+ &:hover {
74
+ background: inherit;
75
+ box-shadow: var(--elevation-2);
76
+ }
77
+
78
+ &--active {
79
+ border-color: var(--icon-color);
80
+
81
+ &.wt-rounded-action--color-secondary {
82
+ border-color: var(--icon-color);
83
+ }
84
+
85
+ &.wt-rounded-action--color-accent {
86
+ border-color: var(--btn-accent--hover-color);
87
+ }
88
+
89
+ &.wt-rounded-action--color-success {
90
+ border-color: var(--btn-true--hover-color);
91
+ }
92
+
93
+ &.wt-rounded-action--color-danger {
94
+ border-color: var(--btn-false--hover-color);
95
+ }
96
+
97
+ &.wt-rounded-action--color-hold {
98
+ border-color: var(--btn-hold--hover-color);
99
+ }
100
+
101
+ &.wt-rounded-action--color-transfer {
102
+ border-color: var(--btn-transfer--hover-color);
103
+ }
104
+ }
69
105
 
70
- &:not(.wt-rounded-action--disabled) {
71
- background: var(--rounded-action-bg-color);
72
- box-shadow: var(--elevation-1);
106
+ &.wt-rounded-action--disabled {
107
+ border-color: transparent;
108
+ box-shadow: none;
73
109
  }
74
110
  }
75
111
  </style>
@@ -16,27 +16,27 @@ and swapping height/width of this component in order to have the correct output.
16
16
 
17
17
  <template>
18
18
  <div
19
- class="wt-slider"
20
19
  :class="{
21
20
  'wt-slider--disabled': disabled,
22
21
  'wt-slider--vertical': vertical,
23
22
  }"
24
23
  :style="{ height: verticalHeight }"
24
+ class="wt-slider"
25
25
  >
26
26
  <div
27
- class="wt-slider__wrapper"
28
27
  :style="{ width: verticalHeight }"
28
+ class="wt-slider__wrapper"
29
29
  >
30
30
  <!-- The row above is needed in order to set correct component width when slider is vertical -->
31
31
  <input
32
- type="range"
33
- class="wt-slider__slider"
34
- :style="{ background: progressStyle }"
35
- :min="min"
32
+ :disabled="disabled"
36
33
  :max="max"
34
+ :min="min"
37
35
  :step="step"
36
+ :style="{ background: progressStyle }"
38
37
  :value="value"
39
- :disabled="disabled"
38
+ class="wt-slider__slider"
39
+ type="range"
40
40
  @input="inputHandler"
41
41
  />
42
42
  </div>
@@ -95,18 +95,21 @@ export default {
95
95
  </script>
96
96
 
97
97
  <style lang="scss" scoped>
98
-
99
98
  .wt-slider__wrapper {
100
- width: var(--wt-slider-width)
99
+ display: flex;
100
+ align-items: center;
101
+ width: var(--wt-slider-width);
102
+ height: var(--wt-slider-height);
101
103
  }
102
104
 
103
105
  .wt-slider__slider {
104
- box-sizing: var(--wt-slider-box-sizing);
106
+ box-sizing: border-box;
105
107
  width: var(--wt-slider-width);
106
- height: var(--wt-slider-height);
108
+ height: var(--wt-slider-input-height);
109
+ margin: 0;
110
+ cursor: pointer;
107
111
  border: var(--wt-slider-border);
108
112
  border-radius: var(--border-radius);
109
- cursor: pointer;
110
113
  -webkit-appearance: none;
111
114
  -moz-appearance: none;
112
115
 
@@ -160,16 +163,12 @@ export default {
160
163
  }
161
164
 
162
165
  .wt-slider--vertical {
163
- width: var(--wt-slider-vertical-container-width);
166
+ width: var(--wt-slider-height);
164
167
  transform: var(--wt-slider-vertical-container-translation);
165
168
 
166
169
  .wt-slider__wrapper {
167
170
  transform: var(--wt-slider-vertical-transform);
168
171
  transform-origin: var(--wt-slider-vertical-transform-origin);
169
-
170
- .wt-slider__slider {
171
- margin: 0;
172
- }
173
172
  }
174
173
  }
175
174
  </style>
@@ -1,6 +1,6 @@
1
1
 
2
2
  :root {
3
- --chip-padding: var(--spacing-2xs) var(--spacing-xs);
3
+ --chip-padding: var(--spacing-3xs) var(--spacing-xs);
4
4
  --chip-border-radius: var(--spacing-lg);
5
5
  --chip-bg-color: var(--accent-secondary-color);
6
6
  --chip-bg-color--outline: var(--secondary-color);
@@ -1,5 +1,5 @@
1
1
  .wt-chip {
2
- @extend %typo-caption;
2
+ @extend %typo-body-2;
3
3
 
4
4
  display: inline-block;
5
5
  padding: var(--chip-padding);
@@ -1,5 +1,5 @@
1
1
  :root {
2
- --rounded-action-padding: var(--spacing-xs);
2
+ --rounded-action-padding: calc(var(--spacing-xs) - var(--btn-border-size));
3
3
 
4
4
  --rounded-action-padding--outline: calc(var(--spacing-xs) - var(--btn-border-size));
5
5
 
@@ -1,14 +1,14 @@
1
1
 
2
2
  :root {
3
- --wt-slider-box-sizing: border-box;
3
+ --wt-slider-pointer-size: 16px;
4
+ --wt-slider-height: var(--wt-slider-pointer-size);
5
+
4
6
  --wt-slider-width: 100%;
5
- --wt-slider-height: 8px;
7
+ --wt-slider-input-height: 8px;
6
8
  --wt-slider-border: 1px solid var(--secondary-color);
7
9
 
8
- --wt-slider-pointer-size: 16px;
9
10
  --wt-slider-pointer-radius: 50%;
10
11
 
11
- --wt-slider-vertical-container-width: 20px;
12
12
  --wt-slider-vertical-container-translation: translate(2px);
13
13
  --wt-slider-vertical-transform: translate(-100%, 0) rotate(-90deg);
14
14
  --wt-slider-vertical-transform-origin: 100% 0;
@@ -6,7 +6,7 @@
6
6
  weight: 600;
7
7
  }
8
8
  line-height: 48px;
9
- letter-spacing: 0.28px; // 0.02em
9
+ //letter-spacing: 0.28px; // 0.02em
10
10
  }
11
11
 
12
12
  %typo-heading-2 {
@@ -16,7 +16,7 @@
16
16
  weight: 600;
17
17
  }
18
18
  line-height: 40px;
19
- letter-spacing: 0.28px; // 0.02em
19
+ //letter-spacing: 0.28px; // 0.02em
20
20
  }
21
21
 
22
22
  %typo-heading-3 {
@@ -26,7 +26,7 @@
26
26
  weight: 600;
27
27
  }
28
28
  line-height: 32px;
29
- letter-spacing: 0.28px; // 0.02em
29
+ //letter-spacing: 0.28px; // 0.02em
30
30
  }
31
31
 
32
32
  %typo-subtitle-1 {
@@ -36,7 +36,7 @@
36
36
  weight: 500;
37
37
  }
38
38
  line-height: 24px;
39
- letter-spacing: 0.28px; // 0.02em
39
+ //letter-spacing: 0.28px; // 0.02em
40
40
  }
41
41
 
42
42
  %typo-subtitle-2 {
@@ -46,7 +46,7 @@
46
46
  weight: 500;
47
47
  }
48
48
  line-height: 20px;
49
- letter-spacing: 0.28px; // 0.02em
49
+ //letter-spacing: 0.28px; // 0.02em
50
50
  }
51
51
 
52
52
  %typo-body-1 {
@@ -56,7 +56,7 @@
56
56
  weight: 400;
57
57
  }
58
58
  line-height: 24px;
59
- letter-spacing: 0.56px; // 0.04em
59
+ //letter-spacing: 0.56px; // 0.04em
60
60
  }
61
61
 
62
62
  %typo-body-2 {
@@ -66,18 +66,18 @@
66
66
  weight: 400;
67
67
  }
68
68
  line-height: 20px;
69
- letter-spacing: 0.16px; // 0.01em
69
+ //letter-spacing: 0.16px; // 0.01em
70
70
  }
71
71
 
72
72
  %typo-button {
73
73
  font: {
74
74
  family: 'Montserrat', monospace;
75
75
  size: 12px;
76
- weight: 500;
76
+ weight: 600;
77
77
  }
78
78
  text-transform: uppercase;
79
79
  line-height: 24px;
80
- letter-spacing: 0.96px; // 0.06em
80
+ //letter-spacing: 0.96px; // 0.06em
81
81
  }
82
82
 
83
83
  %typo-caption {
@@ -87,7 +87,7 @@
87
87
  weight: 400;
88
88
  }
89
89
  line-height: 16px;
90
- letter-spacing: 0.48px; // 0.03em
90
+ //letter-spacing: 0.48px; // 0.03em
91
91
  }
92
92
 
93
93
  %typo-overline {
@@ -98,5 +98,5 @@
98
98
  }
99
99
  line-height: 20px;
100
100
  text-transform: uppercase;
101
- letter-spacing: 2.56px; // 0.16em
101
+ //letter-spacing: 2.56px; // 0.16em
102
102
  }