plugin-ui-for-kzt 0.0.16 → 0.0.17

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.
Files changed (43) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +3 -3
  2. package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +1 -1
  3. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -4
  4. package/dist/components/BaseChips/BaseChips.vue.d.ts +27 -0
  5. package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +3 -3
  6. package/dist/components/BaseInput/BaseInput.vue.d.ts +5 -5
  7. package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +6 -6
  8. package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +5 -5
  9. package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +5 -5
  10. package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +5 -5
  11. package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +3 -3
  12. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -4
  13. package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +2 -2
  14. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +3 -3
  15. package/dist/components/BaseSiteInput/BaseSiteInput.vue.d.ts +1 -1
  16. package/dist/components/BaseSwiper/BaseSwiper.vue.d.ts +57 -0
  17. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -5
  18. package/dist/components/BaseToggle/BaseToggle.vue.d.ts +4 -4
  19. package/dist/components/BaseTooltip/BaseTooltip.vue.d.ts +1 -1
  20. package/dist/components/Toaster/Toaster.vue.d.ts +4 -4
  21. package/dist/index.d.ts +3 -1
  22. package/dist/index.js +1 -1
  23. package/dist/sprite.svg +1 -1
  24. package/example/App.vue +45 -23
  25. package/package.json +1 -1
  26. package/src/assets/icons/arrow-left-circle.svg +3 -0
  27. package/src/assets/icons/arrow-right-circle.svg +3 -0
  28. package/src/assets/icons/star.svg +3 -0
  29. package/src/components/BaseBreadCrumbs/BaseBreadCrumbs.vue +1 -2
  30. package/src/components/BaseButton/BaseButton.vue +29 -10
  31. package/src/components/BaseChips/BaseChips.vue +182 -0
  32. package/src/components/BaseChips/README.md +64 -0
  33. package/src/components/BaseInput/BaseInput.vue +1 -0
  34. package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +4 -4
  35. package/src/components/BasePagination/BasePagination.vue +146 -123
  36. package/src/components/BaseSiteInput/BaseSiteInput.vue +26 -9
  37. package/src/components/BaseSwiper/BaseSwiper.vue +229 -0
  38. package/src/components/BaseTextarea/BaseTextarea.vue +1 -0
  39. package/src/index.ts +8 -2
  40. package/src/styles/root.scss +2 -0
  41. package/src/types/chips.d.ts +10 -0
  42. package/src/types/pagination.d.ts +2 -2
  43. package/src/types/swiper.d.ts +17 -0
@@ -0,0 +1,229 @@
1
+ <template>
2
+ <div class="base-swiper">
3
+ <!-- Кнопки навигации -->
4
+ <button
5
+ :class="buttonClassList"
6
+ class="base-swiper__nav base-swiper__nav--prev"
7
+ @click="prevSlide"
8
+ :disabled="currentSlide === 0"
9
+ >
10
+ <base-icon
11
+ name="arrow-left-circle"
12
+ size="medium"
13
+ />
14
+ </button>
15
+ <div class="base-swiper__container" ref="swiperContainer">
16
+ <div class="base-swiper__slides">
17
+ <div
18
+ v-for="(image, index) in images"
19
+ :key="index"
20
+ class="base-swiper__slide"
21
+ :style="{ transform: `translateX(-${currentSlide * 100}%)` }"
22
+ >
23
+ <img :src="image" alt="Slide" class="base-swiper__image" />
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <button
28
+ :class="buttonClassList"
29
+ class="base-swiper__nav base-swiper__nav--next"
30
+ @click="nextSlide"
31
+ :disabled="currentSlide === images.length - 1"
32
+ >
33
+ <base-icon
34
+ name="arrow-right-circle"
35
+ size="medium"
36
+ />
37
+ </button>
38
+
39
+ <!-- Пагинация -->
40
+ <div class="base-swiper__pagination">
41
+ <base-pagination
42
+ :type="paginationSettings.type"
43
+ v-model:current-page="currentPage"
44
+ :total-pages="images.length"
45
+ :color="paginationSettings.color"
46
+ />
47
+ </div>
48
+ </div>
49
+ </template>
50
+
51
+ <script setup lang="ts">
52
+ import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
53
+ import BaseIcon from '../BaseIcon/BaseIcon.vue';
54
+ import BasePagination from '../BasePagination/BasePagination.vue';
55
+ import type { ICoreSwiperProps } from '../../types/swiper';
56
+
57
+ const props = withDefaults(defineProps<ICoreSwiperProps>(), {
58
+ images: () => [],
59
+ autoplay: false,
60
+ autoplayInterval: 3000,
61
+ paginationSettings: {
62
+ type: 'dots',
63
+ color: 'primary',
64
+ },
65
+ buttonSize: 'medium',
66
+ });
67
+
68
+ const emit = defineEmits<{
69
+ (e: 'update:currentSlide', value: number): void;
70
+ }>();
71
+
72
+ const swiperContainer = ref<HTMLElement | null>(null);
73
+ const currentSlide = ref(0);
74
+ const currentPage = ref(1);
75
+
76
+ const buttonClassList = computed(() => [
77
+ `--${props.buttonSize}-size`,
78
+ `--color-${props.paginationSettings.color}`,
79
+ ]);
80
+
81
+ watch(currentSlide, (newSlide) => {
82
+ currentPage.value = newSlide + 1;
83
+ emit('update:currentSlide', newSlide);
84
+ });
85
+
86
+ watch(currentPage, (newPage) => {
87
+ currentSlide.value = newPage - 1;
88
+ emit('update:currentSlide', currentSlide.value);
89
+ });
90
+
91
+ const prevSlide = () => {
92
+ if (currentSlide.value > 0) {
93
+ currentSlide.value -= 1;
94
+ }
95
+ };
96
+
97
+ const nextSlide = () => {
98
+ if (currentSlide.value < props.images.length - 1) {
99
+ currentSlide.value += 1;
100
+ }
101
+ };
102
+
103
+ let autoplayIntervalId: ReturnType<typeof setInterval> | null = null;
104
+
105
+ const startAutoplay = () => {
106
+ if (props.autoplay && !autoplayIntervalId) {
107
+ autoplayIntervalId = setInterval(() => {
108
+ nextSlide();
109
+ if (currentSlide.value >= props.images.length - 1) {
110
+ currentSlide.value = 0; // Возвращаемся к первому слайду
111
+ }
112
+ }, props.autoplayInterval);
113
+ }
114
+ };
115
+
116
+ const stopAutoplay = () => {
117
+ if (autoplayIntervalId) {
118
+ clearInterval(autoplayIntervalId);
119
+ autoplayIntervalId = null;
120
+ }
121
+ };
122
+
123
+ onMounted(() => {
124
+ startAutoplay();
125
+ });
126
+
127
+ onUnmounted(() => {
128
+ stopAutoplay();
129
+ });
130
+ </script>
131
+
132
+ <style lang="scss" scoped>
133
+ @import '../../styles/variables';
134
+ @import '../../styles/root';
135
+
136
+ .base-swiper {
137
+ $swiper: &;
138
+
139
+ position: relative;
140
+ width: 100%;
141
+ max-width: 640px;
142
+ overflow: hidden;
143
+
144
+ &__container {
145
+ overflow: hidden;
146
+ position: relative;
147
+ }
148
+
149
+ &__slides {
150
+ display: flex;
151
+ width: 100%;
152
+ height: 100%;
153
+ }
154
+
155
+ &__slide {
156
+ flex: 0 0 100%;
157
+ height: 100%;
158
+ display: flex;
159
+ justify-content: center;
160
+ align-items: center;
161
+ transition: all var(--transition);
162
+ }
163
+
164
+ &__image {
165
+ max-width: 100%;
166
+ max-height: 400px;
167
+ object-fit: contain;
168
+ border-radius: var(--corner-radius-m);
169
+ }
170
+
171
+ &__nav {
172
+ position: absolute;
173
+ top: 50%;
174
+ transform: translateY(-50%);
175
+ border: none;
176
+ cursor: pointer;
177
+ border-radius: 50%;
178
+ z-index: 10;
179
+
180
+ &--prev {
181
+ left: var(--spacing-m);
182
+ }
183
+
184
+ &--next {
185
+ right: var(--spacing-m);
186
+ }
187
+
188
+ &:disabled {
189
+ opacity: 0.5;
190
+ cursor: not-allowed;
191
+ }
192
+ }
193
+
194
+ &__nav.--color-primary {
195
+ background: var(--primary-blue);
196
+ color: var(--primary-black-white);
197
+ }
198
+
199
+ &__nav.--color-secondary {
200
+ background: var(--primary-blue-50);
201
+ color: var(--primary-blue-800);
202
+ }
203
+
204
+ &__nav.--color-black {
205
+ background: #000;
206
+ color: var(--primary-black-white);
207
+ }
208
+
209
+ &__nav.--color-white {
210
+ background: var(--primary-black-white);
211
+ color: var(--primary-black-700);
212
+ }
213
+
214
+ &__nav.--medium-size {
215
+ padding: var(--spacing-s);
216
+ }
217
+
218
+ &__nav.--large-size {
219
+ padding: var(--spacing-2m);
220
+ }
221
+
222
+ &__pagination {
223
+ position: absolute;
224
+ bottom: 10px;
225
+ left: 50%;
226
+ transform: translateX(-50%);
227
+ }
228
+ }
229
+ </style>
@@ -88,6 +88,7 @@ function handleInput(event: Event) {
88
88
  color: var(--primary-text-primary);
89
89
  background: var(--bg-light);
90
90
  border: 1px solid var(--primary-black-300);
91
+ transition: all var(--transition);
91
92
 
92
93
  &::placeholder {
93
94
  color: var(--primary-text-tertiary);
package/src/index.ts CHANGED
@@ -28,6 +28,8 @@ import BaseSiteInput from "./components/BaseSiteInput/BaseSiteInput.vue";
28
28
  import BaseInputPhone from "./components/BaseInputPhone/BaseInputPhone.vue";
29
29
  import BaseInputCurrency from "./components/BaseInputCurrency/BaseInputCurrency.vue";
30
30
  import BaseSegmentedButtons from "./components/BaseSegmentedButtons/BaseSegmentedButtons.vue";
31
+ import BaseChips from "./components/BaseChips/BaseChips.vue";
32
+ import BaseSwiper from "./components/BaseSwiper/BaseSwiper.vue";
31
33
 
32
34
  const components = {
33
35
  Modal,
@@ -54,7 +56,9 @@ const components = {
54
56
  BaseInputPhone,
55
57
  BaseInputCurrency,
56
58
  BasePagination,
57
- BaseSegmentedButtons
59
+ BaseSegmentedButtons,
60
+ BaseChips,
61
+ BaseSwiper
58
62
  };
59
63
 
60
64
  // Функция для загрузки sprite.svg
@@ -134,5 +138,7 @@ export {
134
138
  BaseInputPhone,
135
139
  BaseInputCurrency,
136
140
  BasePagination,
137
- BaseSegmentedButtons
141
+ BaseSegmentedButtons,
142
+ BaseChips,
143
+ BaseSwiper
138
144
  };
@@ -148,6 +148,8 @@
148
148
  --corner-radius-s: 10px;
149
149
  --corner-radius-m: 12px;
150
150
  --corner-radius-l: 16px;
151
+ --corner-radius-xl: 24px;
152
+ --corner-radius-2xl: 32px;
151
153
  --spacing-2xs: 2px;
152
154
  --spacing-xs: 4px;
153
155
  --spacing-2s: 6px;
@@ -0,0 +1,10 @@
1
+ import type { ICoreSize } from './utils';
2
+
3
+ export interface ICoreChipsBaseProps {
4
+ text: string;
5
+ active: boolean;
6
+ iconName?: string;
7
+ count?: number;
8
+ }
9
+
10
+ export type ICoreChipsProps = ICoreChipsBaseProps & ICoreSize;
@@ -1,7 +1,7 @@
1
1
  import type { ICoreSize } from './utils';
2
2
 
3
- type PaginationColor = 'primary' | 'secondary' | 'white' | 'black';
4
- type PaginationType = 'dots' | 'dotsWithBackground' | 'dashes' | 'dashesWithBackground' | 'numbers';
3
+ export type PaginationColor = 'primary' | 'secondary' | 'white' | 'black';
4
+ export type PaginationType = 'dots' | 'dotsWithBackground' | 'dashes' | 'dashesWithBackground' | 'numbers';
5
5
  export interface IPaginationProps {
6
6
  type?: PaginationType;
7
7
  currentPage?: number;
@@ -0,0 +1,17 @@
1
+ import type { PaginationColor, PaginationType } from './pagination';
2
+ import type { ICoreSize } from './utils';
3
+
4
+ type TButtonSize = 'medium' | 'large';
5
+
6
+ export interface ICoreSwiperProps {
7
+ images: string[];
8
+ paginationSettings?: {
9
+ type?: PaginationType;
10
+ color?: PaginationColor;
11
+ size?: ICoreSize;
12
+ }
13
+ currentSlide?: number;
14
+ autoplay?: boolean;
15
+ autoplayInterval?: number;
16
+ buttonSize?: TButtonSize;
17
+ }