spoko-design-system 1.1.1 → 1.1.2

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 (110) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.github/workflows/code-quality.yml +3 -3
  3. package/.prettierrc +1 -0
  4. package/CHANGELOG.md +6 -0
  5. package/package.json +8 -2
  6. package/src/MyComponent.astro +1 -1
  7. package/src/components/Badge.vue +2 -2
  8. package/src/components/Badges.vue +17 -7
  9. package/src/components/Breadcrumbs.vue +47 -39
  10. package/src/components/Button.vue +31 -30
  11. package/src/components/ButtonCopy.astro +12 -17
  12. package/src/components/ButtonCopy.vue +26 -25
  13. package/src/components/Card.astro +4 -6
  14. package/src/components/Carousel.astro +4 -4
  15. package/src/components/Category/CategoriesCarousel.astro +75 -75
  16. package/src/components/Category/CategoryDetails.astro +75 -79
  17. package/src/components/Category/CategoryLink.vue +8 -12
  18. package/src/components/Category/CategorySidebarToggler.vue +2 -7
  19. package/src/components/Category/CategoryTile.astro +3 -3
  20. package/src/components/Category/CategoryViewToggler.astro +18 -18
  21. package/src/components/Category/SubCategoryLink.vue +13 -13
  22. package/src/components/Faq.astro +16 -17
  23. package/src/components/FaqItem.astro +27 -27
  24. package/src/components/FeaturesList.vue +19 -29
  25. package/src/components/FuckRussia.vue +40 -27
  26. package/src/components/HandDrive.astro +11 -15
  27. package/src/components/Header/Header.astro +165 -166
  28. package/src/components/Header/SkipToContent.astro +1 -1
  29. package/src/components/Headline.vue +44 -27
  30. package/src/components/Image.astro +5 -7
  31. package/src/components/Input.vue +143 -153
  32. package/src/components/Jumbotron/index.astro +143 -156
  33. package/src/components/Jumbotron/types.ts +28 -29
  34. package/src/components/Jumbotron/variants/Default.astro +44 -40
  35. package/src/components/Jumbotron/variants/Hero.astro +45 -53
  36. package/src/components/Jumbotron/variants/Post.astro +68 -64
  37. package/src/components/Jumbotron/variants/PostSplit.astro +89 -81
  38. package/src/components/Jumbotron.astro +12 -12
  39. package/src/components/LanguageSuggestion.astro +66 -69
  40. package/src/components/LeftSidebar.astro +10 -10
  41. package/src/components/MainColors.vue +2 -2
  42. package/src/components/MainInput.vue +6 -3
  43. package/src/components/Modal.astro +2 -2
  44. package/src/components/PartNumber.vue +2 -3
  45. package/src/components/Post/PostCategories.astro +2 -4
  46. package/src/components/Post/PostCategories.vue +2 -2
  47. package/src/components/PostHeader.astro +4 -6
  48. package/src/components/PrCode.vue +20 -19
  49. package/src/components/Product/ProductButton.vue +2 -5
  50. package/src/components/Product/ProductCarousel.astro +38 -27
  51. package/src/components/Product/ProductColors.vue +46 -42
  52. package/src/components/Product/ProductDetailName.vue +22 -22
  53. package/src/components/Product/ProductDetails.vue +115 -99
  54. package/src/components/Product/ProductDoc.vue +27 -25
  55. package/src/components/Product/ProductEngineType.vue +13 -10
  56. package/src/components/Product/ProductImage.astro +18 -19
  57. package/src/components/Product/ProductLink.vue +55 -58
  58. package/src/components/Product/ProductLinkInfo.astro +15 -18
  59. package/src/components/Product/ProductModel.vue +25 -24
  60. package/src/components/Product/ProductModels.vue +29 -33
  61. package/src/components/Product/ProductName.vue +15 -15
  62. package/src/components/Product/ProductNumber.astro +23 -31
  63. package/src/components/Product/ProductPositions.vue +32 -34
  64. package/src/components/ProductCarousel.astro +5 -5
  65. package/src/components/ProductCodes.vue +12 -14
  66. package/src/components/ProductDetailName.vue +18 -20
  67. package/src/components/ProductDetailsList.vue +48 -27
  68. package/src/components/Quote.vue +8 -6
  69. package/src/components/ReloadPrompt.astro +39 -47
  70. package/src/components/SlimBanner.vue +44 -19
  71. package/src/components/Table.vue +4 -6
  72. package/src/components/Translations.vue +17 -8
  73. package/src/components/flags/FlagPL.vue +4 -3
  74. package/src/components/flags/FlagUA.vue +2 -2
  75. package/src/components/layout/CallToAction.astro +17 -12
  76. package/src/components/layout/Container.astro +3 -1
  77. package/src/components/layout/Header.astro +12 -21
  78. package/src/config.ts +43 -43
  79. package/src/design.config.ts +63 -63
  80. package/src/env.d.ts +4 -4
  81. package/src/layouts/Layout.astro +10 -19
  82. package/src/layouts/MainLayout.astro +13 -19
  83. package/src/layouts/partials/FooterCommon.astro +2 -2
  84. package/src/layouts/partials/HeadCommon.astro +9 -9
  85. package/src/layouts/partials/HeadSEO.astro +12 -5
  86. package/src/pages/components/icons.astro +130 -121
  87. package/src/pages/core/shadows.astro +18 -11
  88. package/src/pages/index.astro +178 -75
  89. package/src/pwa.ts +4 -4
  90. package/src/styles/base/base.css +14 -19
  91. package/src/styles/base/grid.css +54 -58
  92. package/src/styles/base/typography.css +40 -40
  93. package/src/styles/content.css +25 -23
  94. package/src/styles/main.css +5 -6
  95. package/src/types/Product.ts +31 -31
  96. package/src/types/astro.d.ts +1 -1
  97. package/src/types/index.ts +234 -237
  98. package/src/utils/api/getCategories.ts +9 -9
  99. package/src/utils/category/getMainCategoryList.ts +22 -22
  100. package/src/utils/category/getSortedCategories.ts +7 -11
  101. package/src/utils/product/getPriceFormatted.ts +14 -11
  102. package/src/utils/product/getProductChecklist.ts +10 -11
  103. package/src/utils/product/useFormatProductNumber.ts +18 -9
  104. package/src/utils/seo/getShorterDescription.ts +6 -4
  105. package/src/utils/text/formatDate.ts +2 -3
  106. package/src/utils/text/formatLocaleNumber.ts +2 -2
  107. package/src/utils/text/formatPad.ts +2 -2
  108. package/src/utils/text/getNumberFormatted.ts +10 -10
  109. package/src/utils/text/getTranslatedLink.ts +3 -3
  110. package/src/utils/text.ts +11 -8
@@ -3,27 +3,30 @@
3
3
  VAG group (VW/Audi/Skoda/Seat/Porsche/Bentley/Lamborghini/Ducati/Cupra/Scania/MAN) manufacturer PR-Code
4
4
  */
5
5
 
6
- import type { PropType } from 'vue'
6
+ import type { PropType } from 'vue';
7
7
 
8
8
  const props = defineProps({
9
- prcode: {
10
- type: String,
11
- default: null,
12
- required: true,
13
- },
14
- isPdp: {
15
- type: Boolean,
16
- default: false,
17
- required: false,
18
- },
19
- })
9
+ prcode: {
10
+ type: String,
11
+ default: null,
12
+ required: true,
13
+ },
14
+ isPdp: {
15
+ type: Boolean,
16
+ default: false,
17
+ required: false,
18
+ },
19
+ });
20
20
  </script>
21
21
 
22
22
  <template>
23
- <span data-pagefind-filter="PR-Code" class="btn-prcode "
24
- :class="`btn-prcode--${props.prcode} ${props.isPdp ? ' btn-prcode--pdp' : ''}`">
25
- {{ props.prcode }}
26
- </span>
23
+ <span
24
+ data-pagefind-filter="PR-Code"
25
+ class="btn-prcode"
26
+ :class="`btn-prcode--${props.prcode} ${props.isPdp ? ' btn-prcode--pdp' : ''}`"
27
+ >
28
+ {{ props.prcode }}
29
+ </span>
27
30
  </template>
28
31
 
29
32
  <style>
@@ -137,6 +140,4 @@ const props = defineProps({
137
140
  .btn-prcode--2JD::before {
138
141
  content: 'GTI';
139
142
  }
140
-
141
-
142
- </style>
143
+ </style>
@@ -5,14 +5,11 @@ const props = defineProps({
5
5
  default: false,
6
6
  required: false,
7
7
  },
8
- })
8
+ });
9
9
  </script>
10
10
 
11
11
  <template>
12
- <button
13
- class="product-button"
14
- :class="props.shadow ? 'drop-shadow hover:(drop-shadow-md)' : ''"
15
- >
12
+ <button class="product-button" :class="props.shadow ? 'drop-shadow hover:(drop-shadow-md)' : ''">
16
13
  <slot />
17
14
  </button>
18
15
  </template>
@@ -1,36 +1,47 @@
1
1
  ---
2
- import ProductLink from "./ProductLink.astro";
2
+ import ProductLink from './ProductLink.astro';
3
3
 
4
4
  // Get the product directly from the prop on render
5
5
  const { locale, class: className, products, isShopProduct = false, ...rest } = Astro.props;
6
-
7
6
  ---
8
7
 
9
-
10
8
  {
11
- products && products.length && (
12
- <swiper-container slides-per-view="auto" space-between="0" class="flex"
13
- itemscope itemtype="https://schema.org/ItemList">
14
- {
15
- products.map((product, index) => (
16
- <swiper-slide class="product-carousel"
17
- itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" >
18
- <ProductLink productObject={product} locale={locale} index={index+1} bigTile loading="eager" isShopProduct={isShopProduct} />
19
- <div class="swiper-lazy-preloader"></div>
20
- </swiper-slide>
21
- ))
22
- }
23
- </swiper-container>
24
- )
25
- }
26
-
27
- <style>
28
- .similar-section {
29
- @apply relative z-20;
9
+ products && products.length && (
10
+ <swiper-container
11
+ slides-per-view="auto"
12
+ space-between="0"
13
+ class="flex"
14
+ itemscope
15
+ itemtype="https://schema.org/ItemList"
16
+ >
17
+ {products.map((product, index) => (
18
+ <swiper-slide
19
+ class="product-carousel"
20
+ itemprop="itemListElement"
21
+ itemscope
22
+ itemtype="https://schema.org/ListItem"
23
+ >
24
+ <ProductLink
25
+ productObject={product}
26
+ locale={locale}
27
+ index={index + 1}
28
+ bigTile
29
+ loading="eager"
30
+ isShopProduct={isShopProduct}
31
+ />
32
+ <div class="swiper-lazy-preloader" />
33
+ </swiper-slide>
34
+ ))}
35
+ </swiper-container>
36
+ )
37
+ }
30
38
 
31
- &:hover {
32
- content-visibility: visible;
33
- }
39
+ <style>
40
+ .similar-section {
41
+ @apply relative z-20;
42
+
43
+ &:hover {
44
+ content-visibility: visible;
34
45
  }
35
-
36
- </style>
46
+ }
47
+ </style>
@@ -1,42 +1,46 @@
1
- <script lang="ts" setup>
2
- import type { PropType } from 'vue'
3
-
4
- const props = defineProps({
5
- colors: {
6
- type: Array as PropType<{id: number, slug: string, name: string}[]>,
7
- default: null,
8
- required: true,
9
- },
10
- small: {
11
- type: Boolean,
12
- required: false,
13
- },
14
- isPdp: {
15
- type: Boolean,
16
- required: false,
17
- default: false,
18
- },
19
- filterName: {
20
- type: String,
21
- required: false,
22
- default: 'Color'
23
- }
24
- })
25
-
26
- </script>
27
-
28
- <template>
29
- <span v-for="(color, index) in colors" :key="index" class="product-color" :data-pagefind-filter="filterName">
30
- {{ color.name }}
31
- </span>
32
- </template>
33
-
34
- <style >
35
- .product-color:not(:last-child) {
36
- @apply mr-1;
37
-
38
- &:after {
39
- content: ','
40
- }
41
- }
42
- </style>
1
+ <script lang="ts" setup>
2
+ import type { PropType } from 'vue';
3
+
4
+ const props = defineProps({
5
+ colors: {
6
+ type: Array as PropType<{ id: number; slug: string; name: string }[]>,
7
+ default: null,
8
+ required: true,
9
+ },
10
+ small: {
11
+ type: Boolean,
12
+ required: false,
13
+ },
14
+ isPdp: {
15
+ type: Boolean,
16
+ required: false,
17
+ default: false,
18
+ },
19
+ filterName: {
20
+ type: String,
21
+ required: false,
22
+ default: 'Color',
23
+ },
24
+ });
25
+ </script>
26
+
27
+ <template>
28
+ <span
29
+ v-for="(color, index) in colors"
30
+ :key="index"
31
+ class="product-color"
32
+ :data-pagefind-filter="filterName"
33
+ >
34
+ {{ color.name }}
35
+ </span>
36
+ </template>
37
+
38
+ <style>
39
+ .product-color:not(:last-child) {
40
+ @apply mr-1;
41
+
42
+ &:after {
43
+ content: ',';
44
+ }
45
+ }
46
+ </style>
@@ -1,22 +1,22 @@
1
- <script lang="ts" setup>
2
- const props = defineProps({
3
- text: {
4
- type: String,
5
- default: '',
6
- required: true,
7
- },
8
- styles: {
9
- type: String,
10
- default: '',
11
- required: false,
12
- }
13
- })
14
- </script>
15
-
16
- <template>
17
- <div class="font-bold detail-name w-full sm:w-50 flex">
18
- <span class="colon-after" :class="styles && styles.length ? styles : 'mt-auto'">
19
- {{ props.text }}
20
- </span>
21
- </div>
22
- </template>
1
+ <script lang="ts" setup>
2
+ const props = defineProps({
3
+ text: {
4
+ type: String,
5
+ default: '',
6
+ required: true,
7
+ },
8
+ styles: {
9
+ type: String,
10
+ default: '',
11
+ required: false,
12
+ },
13
+ });
14
+ </script>
15
+
16
+ <template>
17
+ <div class="font-bold detail-name w-full sm:w-50 flex">
18
+ <span class="colon-after" :class="styles && styles.length ? styles : 'mt-auto'">
19
+ {{ props.text }}
20
+ </span>
21
+ </div>
22
+ </template>
@@ -1,99 +1,115 @@
1
- <script lang="ts" setup>
2
- import type { PropType } from 'vue'
3
- import type { DetailList, DetailObject } from '../../types/index'
4
- import ProductDetailName from './ProductDetailName.vue'
5
- import {getTranslation} from "../../utils/text"
6
- // import ProductColors from "@components/Product/ProductColors.vue"
7
-
8
- const props = defineProps({
9
- details: {
10
- type: Array as PropType<DetailList[]> | null,
11
- default: null,
12
- required: false,
13
- },
14
- small: {
15
- type: Boolean,
16
- required: false,
17
- },
18
- colors: {
19
- type: Array as PropType<string[] | null>,
20
- default: null,
21
- required: false,
22
- },
23
- locale: {
24
- type: String,
25
- default: 'en',
26
- required: false,
27
- },
28
- })
29
-
30
- </script>
31
-
32
- <template>
33
- <template v-for="(detail, index) in details" :key="index" class="" v-if="details && details.length">
34
- <!-- PDP PAGE - PRODUCT ROW -->
35
- <!-- <pre>{{ JSON.stringify(details) }}</pre> -->
36
- <li v-if="props.small" class="text-xs md:text-sm text-slate-darkest dark:text-neutral-light leading-tight font-textlight md:font-textregular">
37
-
38
- <span v-if="detail.id" class="inline-block mr-1 items--0">
39
- {{ getTranslation(`detail.${detail.id}`) }}:
40
- </span>
41
-
42
- <span v-if="detail.translated" :class="detail.id ? 'font-semibold' : ''" class="items--1">
43
- {{ detail.value }}
44
- </span>
45
-
46
- <div v-else-if="detail.value !== undefined && detail.id === 'color' && detail.isArrayValue" class="items--2 inline-block">
47
- <span class="comma" v-for="(color, indexColor) in detail.value" :key="indexColor">
48
- {{ color['name'] }}
49
- </span>
50
- </div>
51
-
52
- <span v-else-if="detail.id !== 'paint-marks' && !detail.isArrayValue" class="items--3">
53
- {{ locale === 'en' ? String(detail.value).replace(/,/g, '.') : String(detail.value) }}
54
- </span>
55
-
56
- <span v-else-if="detail.id && detail.id === 'paint-marks'" class="items items--4">
57
- {{ detail.value }}
58
- <!-- <span v-for="(mark, index2) in JSON.parse(String(detail.value))" :key="index2" class="item">
59
- {{ mark[0] }} x <span>{{ getTranslation(`color.${mark[1]}`) }}</span>
60
- </span> -->
61
- </span>
62
-
63
- </li>
64
-
65
- <div v-else class="text-sm mt-1 md:mt-4 mb-4 grid grid-cols-2
66
- sm:(grid-cols-details-desktop grid-flow-col auto-cols-max) gap-4">
67
- <!-- PRODUCT CARD -->
68
- <ProductDetailName v-if="detail.id" :text="getTranslation(`detail.${detail.id}`)" />
69
- <div v-if="detail.value"
70
- class="leading-4 flex items-end">
71
-
72
- <span v-if="detail.translated && !detail.isArrayValue" :class="detail.id === 'light-function' ? 'whitespace-pre-line' : ''">
73
- {{ getTranslation(`detail.value.${detail.value}`) }}
74
- </span>
75
-
76
- <span v-else-if="detail.id !== 'paint-marks' && !detail.isArrayValue" class="">
77
- {{ detail.value }}
78
- </span>
79
-
80
- <span v-else-if="detail.value !== undefined && detail.id === 'for-exterior-colour' && detail.isArrayValue" class="">
81
- <div v-for="(color, indexColor) in JSON.parse(String(detail.value))" :key="indexColor">
82
- <span class="font-mono">{{ color }}</span> - {{ getTranslation(`colorCodes.${color}`) }}
83
- </div>
84
- </span>
85
-
86
- <span v-else-if="detail.id && detail.id === 'paint-marks'" class="items">
87
- <span v-for="(mark, index) in JSON.parse(String(detail.value))" :key="index" class="item">
88
- {{ mark[0] }} x <span>{{ getTranslation(`color.${mark[1]}`) }}</span>
89
- </span>
90
- </span>
91
- <ul v-else-if="detail.id && detail.isArrayValue" class="items">
92
- <li v-for="(d, index3) in JSON.parse(String(detail.value))" :key="index3" class="item">
93
- · {{ d }}
94
- </li>
95
- </ul>
96
- </div>
97
- </div>
98
- </template>
99
- </template>
1
+ <script lang="ts" setup>
2
+ import type { PropType } from 'vue';
3
+ import type { DetailList, DetailObject } from '../../types/index';
4
+ import ProductDetailName from './ProductDetailName.vue';
5
+ import { getTranslation } from '../../utils/text';
6
+ // import ProductColors from "@components/Product/ProductColors.vue"
7
+
8
+ const props = defineProps({
9
+ details: {
10
+ type: Array as PropType<DetailList[]> | null,
11
+ default: null,
12
+ required: false,
13
+ },
14
+ small: {
15
+ type: Boolean,
16
+ required: false,
17
+ },
18
+ colors: {
19
+ type: Array as PropType<string[] | null>,
20
+ default: null,
21
+ required: false,
22
+ },
23
+ locale: {
24
+ type: String,
25
+ default: 'en',
26
+ required: false,
27
+ },
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <template
33
+ v-for="(detail, index) in details"
34
+ :key="index"
35
+ class=""
36
+ v-if="details && details.length"
37
+ >
38
+ <!-- PDP PAGE - PRODUCT ROW -->
39
+ <!-- <pre>{{ JSON.stringify(details) }}</pre> -->
40
+ <li
41
+ v-if="props.small"
42
+ class="text-xs md:text-sm text-slate-darkest dark:text-neutral-light leading-tight font-textlight md:font-textregular"
43
+ >
44
+ <span v-if="detail.id" class="inline-block mr-1 items--0">
45
+ {{ getTranslation(`detail.${detail.id}`) }}:
46
+ </span>
47
+
48
+ <span v-if="detail.translated" :class="detail.id ? 'font-semibold' : ''" class="items--1">
49
+ {{ detail.value }}
50
+ </span>
51
+
52
+ <div
53
+ v-else-if="detail.value !== undefined && detail.id === 'color' && detail.isArrayValue"
54
+ class="items--2 inline-block"
55
+ >
56
+ <span class="comma" v-for="(color, indexColor) in detail.value" :key="indexColor">
57
+ {{ color['name'] }}
58
+ </span>
59
+ </div>
60
+
61
+ <span v-else-if="detail.id !== 'paint-marks' && !detail.isArrayValue" class="items--3">
62
+ {{ locale === 'en' ? String(detail.value).replace(/,/g, '.') : String(detail.value) }}
63
+ </span>
64
+
65
+ <span v-else-if="detail.id && detail.id === 'paint-marks'" class="items items--4">
66
+ {{ detail.value }}
67
+ <!-- <span v-for="(mark, index2) in JSON.parse(String(detail.value))" :key="index2" class="item">
68
+ {{ mark[0] }} x <span>{{ getTranslation(`color.${mark[1]}`) }}</span>
69
+ </span> -->
70
+ </span>
71
+ </li>
72
+
73
+ <div
74
+ v-else
75
+ class="text-sm mt-1 md:mt-4 mb-4 grid grid-cols-2 sm:(grid-cols-details-desktop grid-flow-col auto-cols-max) gap-4"
76
+ >
77
+ <!-- PRODUCT CARD -->
78
+ <ProductDetailName v-if="detail.id" :text="getTranslation(`detail.${detail.id}`)" />
79
+ <div v-if="detail.value" class="leading-4 flex items-end">
80
+ <span
81
+ v-if="detail.translated && !detail.isArrayValue"
82
+ :class="detail.id === 'light-function' ? 'whitespace-pre-line' : ''"
83
+ >
84
+ {{ getTranslation(`detail.value.${detail.value}`) }}
85
+ </span>
86
+
87
+ <span v-else-if="detail.id !== 'paint-marks' && !detail.isArrayValue" class="">
88
+ {{ detail.value }}
89
+ </span>
90
+
91
+ <span
92
+ v-else-if="
93
+ detail.value !== undefined && detail.id === 'for-exterior-colour' && detail.isArrayValue
94
+ "
95
+ class=""
96
+ >
97
+ <div v-for="(color, indexColor) in JSON.parse(String(detail.value))" :key="indexColor">
98
+ <span class="font-mono">{{ color }}</span> - {{ getTranslation(`colorCodes.${color}`) }}
99
+ </div>
100
+ </span>
101
+
102
+ <span v-else-if="detail.id && detail.id === 'paint-marks'" class="items">
103
+ <span v-for="(mark, index) in JSON.parse(String(detail.value))" :key="index" class="item">
104
+ {{ mark[0] }} x <span>{{ getTranslation(`color.${mark[1]}`) }}</span>
105
+ </span>
106
+ </span>
107
+ <ul v-else-if="detail.id && detail.isArrayValue" class="items">
108
+ <li v-for="(d, index3) in JSON.parse(String(detail.value))" :key="index3" class="item">
109
+ · {{ d }}
110
+ </li>
111
+ </ul>
112
+ </div>
113
+ </div>
114
+ </template>
115
+ </template>
@@ -1,25 +1,27 @@
1
- <script lang="ts" setup>
2
- const props = defineProps({
3
- file: {
4
- type: Object,
5
- default: null,
6
- required: true,
7
- },
8
- locale: {
9
- type: String,
10
- default: 'en',
11
- required: false
12
- }
13
- })
14
- </script>
15
-
16
- <template>
17
- <li v-if="props.file">
18
- <a :href="`${locale !== 'en' ? `/${locale}` : ''}/docs/${props.file.name}/`"
19
- :title="props.file.path"
20
- class="flex items-center hover:underline underline-offset-2 hover:underline-1"
21
- >
22
- <div i-system-uicons-document-justified class="text-blue-lightest dark:text-accent-light" /> <span>{{ props.file.name }}</span>
23
- </a>
24
- </li>
25
- </template>
1
+ <script lang="ts" setup>
2
+ const props = defineProps({
3
+ file: {
4
+ type: Object,
5
+ default: null,
6
+ required: true,
7
+ },
8
+ locale: {
9
+ type: String,
10
+ default: 'en',
11
+ required: false,
12
+ },
13
+ });
14
+ </script>
15
+
16
+ <template>
17
+ <li v-if="props.file">
18
+ <a
19
+ :href="`${locale !== 'en' ? `/${locale}` : ''}/docs/${props.file.name}/`"
20
+ :title="props.file.path"
21
+ class="flex items-center hover:underline underline-offset-2 hover:underline-1"
22
+ >
23
+ <div i-system-uicons-document-justified class="text-blue-lightest dark:text-accent-light" />
24
+ <span>{{ props.file.name }}</span>
25
+ </a>
26
+ </li>
27
+ </template>
@@ -4,17 +4,20 @@ interface Engine {
4
4
  name: string;
5
5
  }
6
6
 
7
- const props = withDefaults(defineProps<{
8
- engines: Engine[];
9
- }>(), {
10
- engines: () => []
11
- });
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ engines: Engine[];
10
+ }>(),
11
+ {
12
+ engines: () => [],
13
+ }
14
+ );
12
15
  </script>
13
16
 
14
17
  <template>
15
18
  <ul v-if="engines.length" class="engine-types">
16
- <li
17
- v-for="(engine, index) in engines"
19
+ <li
20
+ v-for="(engine, index) in engines"
18
21
  :key="engine.id"
19
22
  class="engine-type"
20
23
  :class="{ 'with-comma': index !== engines.length - 1 }"
@@ -24,7 +27,7 @@ const props = withDefaults(defineProps<{
24
27
  </ul>
25
28
  </template>
26
29
 
27
- <style >
30
+ <style>
28
31
  .engine-types {
29
32
  @apply flex flex-wrap items-center;
30
33
  }
@@ -34,10 +37,10 @@ const props = withDefaults(defineProps<{
34
37
 
35
38
  &.with-comma {
36
39
  @apply mr-1;
37
-
40
+
38
41
  &:after {
39
42
  content: ',';
40
43
  }
41
44
  }
42
45
  }
43
- </style>
46
+ </style>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { Image } from 'astro:assets'
2
+ import { Image } from 'astro:assets';
3
3
  interface ImageObject {
4
4
  src: string;
5
5
  alt?: string;
@@ -11,31 +11,30 @@ interface ImageObject {
11
11
  index?: number;
12
12
  }
13
13
 
14
- const { imageObject } = Astro.props as { imageObject: ImageObject; };
14
+ const { imageObject } = Astro.props as { imageObject: ImageObject };
15
15
 
16
16
  let inputProps = {};
17
17
 
18
-
19
18
  if (imageObject.index && imageObject.index === 1) {
20
19
  inputProps['data-pagefind-meta'] = 'image[src], image_alt[alt]';
21
- imageObject.loading = 'eager'
20
+ imageObject.loading = 'eager';
22
21
  }
23
22
 
24
23
  if (imageObject.srcset && imageObject.srcset.length) {
25
- inputProps['widths'] = imageObject.srcset
24
+ inputProps['widths'] = imageObject.srcset;
26
25
  }
27
-
28
26
  ---
29
- <Image
30
- src={imageObject.src}
31
- alt={imageObject.alt}
32
- height={Number(imageObject.height)}
33
- width={Number(imageObject.width)}
34
- loading={imageObject.loading ? imageObject.loading : 'lazy'}
35
- itemprop="image"
36
- format="avif"
37
- data-pagefind-index-attrs={imageObject.alt}
38
- onerror="this.style.display='none';"
39
- class={`product-image ${imageObject.class || ''}`}
40
- { ...inputProps}
41
- />
27
+
28
+ <Image
29
+ src={imageObject.src}
30
+ alt={imageObject.alt}
31
+ height={Number(imageObject.height)}
32
+ width={Number(imageObject.width)}
33
+ loading={imageObject.loading ? imageObject.loading : 'lazy'}
34
+ itemprop="image"
35
+ format="avif"
36
+ data-pagefind-index-attrs={imageObject.alt}
37
+ onerror="this.style.display='none';"
38
+ class={`product-image ${imageObject.class || ''}`}
39
+ {...inputProps}
40
+ />