itube-specs 0.0.873 → 0.0.874

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.
@@ -3,7 +3,7 @@
3
3
  :is="component"
4
4
  :class="{
5
5
  '--active': isActive,
6
- '--image': !!item.image,
6
+ [`--image-${imageFit}`]: !!item.image,
7
7
  '--alphabet': alphabet,
8
8
  '--small': mini,
9
9
  '--micro': micro,
@@ -25,10 +25,11 @@
25
25
  v-if="item.image"
26
26
  :src="item.image"
27
27
  :alt="name"
28
+ :class="`--${imageFit}`"
29
+ :width="imageBox.width"
30
+ :height="imageBox.height"
28
31
  class="ui-chips__img"
29
32
  sizes="20px sm:24px"
30
- width="20"
31
- height="20"
32
33
  />
33
34
  {{ name }}
34
35
  <UiIcon
@@ -63,6 +64,12 @@ const emit = defineEmits<{
63
64
 
64
65
  const route = useRoute();
65
66
 
67
+ const imageFit = computed(() => props.item.imageFit ?? 'cover');
68
+
69
+ const imageBox = computed(() => imageFit.value === 'contain'
70
+ ? { width: 22, height: 16 }
71
+ : { width: 20, height: 20 });
72
+
66
73
  const component = computed(() => {
67
74
  if (props.isLink) {
68
75
  if (isActive.value && props.alphabet) {
@@ -237,15 +244,24 @@ const name = computed(() => {
237
244
  }
238
245
 
239
246
  .ui-chips__img {
247
+ flex-shrink: 0;
248
+ }
249
+
250
+ .ui-chips__img.--cover {
240
251
  width: var(--chips-height);
241
252
  height: var(--chips-height);
242
- flex-shrink: 0;
243
253
  object-fit: cover;
244
254
  object-position: center 70%;
245
255
  border-radius: 0 $radius-small $radius-small 0;
246
256
  }
247
257
 
248
- .ui-chips.--image {
258
+ .ui-chips__img.--contain {
259
+ width: 22px;
260
+ height: 16px;
261
+ object-fit: contain;
262
+ }
263
+
264
+ .ui-chips.--image-cover {
249
265
  padding-left: 0;
250
266
  overflow: hidden;
251
267
  }
@@ -159,6 +159,7 @@ const categoriesChips = computed((): IChipsItem[] => props.data.categories && pr
159
159
  title: item.title,
160
160
  value: item.name,
161
161
  image: item.icon ? `/icons/flags/${item.icon}.svg` : undefined,
162
+ imageFit: 'contain',
162
163
  prefix: 'categories',
163
164
  })));
164
165
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.873",
4
+ "version": "0.0.874",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -1,3 +1,5 @@
1
+ export type ChipsImageFits = 'cover' | 'contain'
2
+
1
3
  export interface IChipsItem {
2
4
  title: string
3
5
  value?: string | string[] | number
@@ -7,4 +9,5 @@ export interface IChipsItem {
7
9
  key?: string
8
10
  query?: string
9
11
  image?: string
12
+ imageFit?: ChipsImageFits
10
13
  }