plugin-ui-for-kzt 0.0.37 → 0.0.38

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": "plugin-ui-for-kzt",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "plugin-ui for kazaktelekom",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -126,6 +126,7 @@ const classList = computed(() => [
126
126
  @import '../../styles/root';
127
127
 
128
128
  .dropdown {
129
+ height: 100%;
129
130
  &__wrapper {
130
131
  position: relative;
131
132
  width: 100%;
@@ -135,6 +136,7 @@ const classList = computed(() => [
135
136
  &__top {
136
137
  cursor: pointer;
137
138
  outline: none;
139
+ height: 100%;
138
140
  }
139
141
 
140
142
  &__dropdown {
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <div class="base-field" :class="classList">
3
- <label class="base-field__label" :for="id">
4
- <span v-if="label" class="base-field__label-text">{{ label }}</span>
5
- <div class="base-field__wrapper" :class="{ 'base-field__wrapper--focusable': focusable}" :tabindex="tabIndex">
6
- <slot :data="componentAttrs" />
7
- </div>
8
- <transition name="error">
9
- <div
10
- v-if="(error && typeof error === 'string') || hint"
11
- class="base-field__hint"
12
- aria-live="polite"
13
- >
14
- {{ error || hint }}
15
- </div>
16
- </transition>
17
- </label>
18
- </div>
2
+ <div class="base-field" :class="classList">
3
+ <label class="base-field__label" :for="id">
4
+ <span v-if="label" class="base-field__label-text">{{ label }}</span>
5
+ <div class="base-field__wrapper" :class="{ 'base-field__wrapper--focusable': focusable}" :tabindex="tabIndex">
6
+ <slot :data="componentAttrs"/>
7
+ </div>
8
+ <transition name="error">
9
+ <div
10
+ v-if="(error && typeof error === 'string') || hint"
11
+ class="base-field__hint"
12
+ aria-live="polite"
13
+ >
14
+ {{ error || hint }}
15
+ </div>
16
+ </transition>
17
+ </label>
18
+ </div>
19
19
  </template>
20
20
 
21
21
  <script setup lang="ts">
@@ -26,43 +26,43 @@ import { useKitState } from '../../composables/kit/state';
26
26
  import type { TFieldProps } from '../../types/field';
27
27
 
28
28
  interface IDefaultSlotProps {
29
- id: string;
30
- error?: string;
31
- size?: string;
32
- focusable?: boolean;
29
+ id: string;
30
+ error?: string;
31
+ size?: string;
32
+ focusable?: boolean;
33
33
  }
34
34
 
35
- const props = withDefaults(defineProps<TFieldProps>(), {
36
- size: 'medium',
37
- id: '',
38
- label: '',
39
- hint: '',
40
- error: '',
41
- focusable: true,
42
- tabIndex: 0,
43
- });
35
+ const props = withDefaults( defineProps<TFieldProps>(), {
36
+ size: 'medium',
37
+ id: '',
38
+ label: '',
39
+ hint: '',
40
+ error: '',
41
+ focusable: true,
42
+ tabIndex: 0,
43
+ } );
44
44
 
45
45
  defineEmits<{
46
- (event: 'update:modelValue', value: string): void;
47
- (event: 'error', value: string): void;
46
+ ( event: 'update:modelValue', value: string ): void;
47
+ ( event: 'error', value: string ): void;
48
48
  }>();
49
49
 
50
50
  const attrs = useAttrs();
51
- const { stateAttrs } = useKitState(props);
52
- const { sizeClassList } = useKitSize(props);
53
-
54
- const componentAttrs = computed<IDefaultSlotProps>(() => ({
55
- ...(attrs || {}),
56
- ...(stateAttrs.value || {}),
57
- id: props.id,
58
- error: props.error,
59
- size: props.size,
60
- }));
61
-
62
- const classList = computed(() => [
63
- ...sizeClassList.value,
64
- { '--is-error': props.error && typeof props.error === 'string' },
65
- ]);
51
+ const { stateAttrs } = useKitState( props );
52
+ const { sizeClassList } = useKitSize( props );
53
+
54
+ const componentAttrs = computed<IDefaultSlotProps>( () => ({
55
+ ...(attrs || {}),
56
+ ...(stateAttrs.value || {}),
57
+ id: props.id,
58
+ error: props.error,
59
+ size: props.size,
60
+ }) );
61
+
62
+ const classList = computed( () => [
63
+ ...sizeClassList.value,
64
+ { '--is-error': props.error && typeof props.error === 'string' },
65
+ ] );
66
66
  </script>
67
67
 
68
68
  <style scoped lang="scss">
@@ -70,115 +70,117 @@ const classList = computed(() => [
70
70
  @import '../../styles/root';
71
71
 
72
72
  .base-field {
73
+ width: 100%;
74
+
75
+ &__wrapper {
76
+ display: flex;
77
+ flex-direction: column;
78
+ width: 100%;
79
+ position: relative;
80
+ transition: all var(--transition);
81
+
82
+ &--focusable {
83
+ @include focused {
84
+ border: 1px solid var(--primary-blue-500);
85
+ outline: 4px solid var(--effects-primary-focus);
86
+ }
87
+ }
88
+ }
89
+
90
+ &__label {
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 6px;
73
94
  width: 100%;
95
+ height: 100%;
96
+ }
74
97
 
75
- &__wrapper {
76
- display: flex;
77
- flex-direction: column;
78
- width: 100%;
79
- position: relative;
80
- transition: all var(--transition);
81
-
82
- &--focusable {
83
- @include focused {
84
- border: 1px solid var(--primary-blue-500);
85
- outline: 4px solid var(--effects-primary-focus);
86
- }
98
+ &__label-text {
99
+ color: var(--primary-text-primary);
100
+ }
101
+
102
+ &__hint {
103
+ color: var(--primary-text-secondary);
104
+ overflow: hidden;
105
+ max-height: 100px;
106
+ transition: all 0.3s ease;
107
+ }
108
+
109
+ &.--is-error {
110
+ .base-field__wrapper {
111
+ &--focusable {
112
+ @include focused {
113
+ border: none;
114
+ outline: 4px solid var(--effects-error-focus);
87
115
  }
116
+ }
88
117
  }
89
118
 
90
- &__label {
91
- display: flex;
92
- flex-direction: column;
93
- gap: 6px;
94
- width: 100%;
119
+ .base-field__hint {
120
+ color: var(--error-red);
95
121
  }
122
+ }
96
123
 
97
- &__label-text {
98
- color: var(--primary-text-primary);
124
+ &.--small-size {
125
+ .base-field__wrapper {
126
+ border-radius: 10px;
99
127
  }
100
128
 
101
- &__hint {
102
- color: var(--primary-text-secondary);
103
- overflow: hidden;
104
- max-height: 100px;
105
- transition: all 0.3s ease;
129
+ .base-field__label-text {
130
+ font: var(--typography-text-s-medium);
106
131
  }
107
132
 
108
- &.--is-error {
109
- .base-field__wrapper {
110
- &--focusable {
111
- @include focused {
112
- border: none;
113
- outline: 4px solid var(--effects-error-focus);
114
- }
115
- }
116
- }
117
-
118
- .base-field__hint {
119
- color: var(--error-red);
120
- }
133
+ .base-field__hint {
134
+ font: var(--typography-text-s-regular);
121
135
  }
136
+ }
122
137
 
123
- &.--small-size {
124
- .base-field__wrapper {
125
- border-radius: 10px;
126
- }
127
-
128
- .base-field__label-text {
129
- font: var(--typography-text-s-medium);
130
- }
131
-
132
- .base-field__hint {
133
- font: var(--typography-text-s-regular);
134
- }
138
+ &.--medium-size {
139
+ .base-field__wrapper {
140
+ border-radius: 12px;
141
+ height: 100%;
135
142
  }
136
143
 
137
- &.--medium-size {
138
- .base-field__wrapper {
139
- border-radius: 12px;
140
- }
141
-
142
- .base-field__label-text {
143
- font: var(--typography-text-s-medium);
144
- }
144
+ .base-field__label-text {
145
+ font: var(--typography-text-s-medium);
146
+ }
145
147
 
146
- .base-field__hint {
147
- font: var(--typography-text-s-regular);
148
- }
148
+ .base-field__hint {
149
+ font: var(--typography-text-s-regular);
149
150
  }
151
+ }
150
152
 
151
- &.--large-size {
152
- .base-field__wrapper {
153
- border-radius: 12px;
154
- }
153
+ &.--large-size {
154
+ .base-field__wrapper {
155
+ border-radius: 12px;
156
+ }
155
157
 
156
- .base-field__label-text {
157
- font: var(--typography-text-m-medium);
158
- }
158
+ .base-field__label-text {
159
+ font: var(--typography-text-m-medium);
160
+ }
159
161
 
160
- .base-field__hint {
161
- font: var(--typography-text-m-regular);
162
- }
162
+ .base-field__hint {
163
+ font: var(--typography-text-m-regular);
163
164
  }
165
+ }
164
166
  }
165
167
 
166
168
  .error-enter-active,
167
169
  .error-leave-active {
168
- transition: opacity 0.3s ease, max-height 0.3s ease, transform 0.3s ease;
170
+ transition: opacity 0.3s ease, max-height 0.3s ease, transform 0.3s ease;
169
171
  }
170
172
 
171
173
  .error-enter-from,
172
174
  .error-leave-to {
173
- opacity: 0;
174
- transform: translateY(10px);
175
- max-height: 0;
175
+ opacity: 0;
176
+ transform: translateY(10px);
177
+ max-height: 0;
176
178
  }
177
179
 
178
180
  .error-enter-to,
179
181
  .error-leave-from {
180
- opacity: 1;
181
- transform: translateY(0);
182
- max-height: 100px;
182
+ opacity: 1;
183
+ transform: translateY(0);
184
+ max-height: 100px;
183
185
  }
184
186
  </style>
@@ -303,7 +303,7 @@ defineSlots<{
303
303
  $select: &;
304
304
 
305
305
  min-width: 320px;
306
-
306
+ height: 100%;
307
307
  .dropdown {
308
308
  &.--is-opened {
309
309
  #{$select} {
@@ -450,6 +450,7 @@ defineSlots<{
450
450
 
451
451
  &__input {
452
452
  border-radius: var(--corner-radius-m);
453
+ height: 100%;
453
454
  }
454
455
 
455
456
  &__header {