spoko-design-system 1.1.1 → 1.1.3
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/.claude/settings.local.json +2 -1
- package/.github/workflows/code-quality.yml +3 -3
- package/.prettierrc +1 -0
- package/CHANGELOG.md +12 -0
- package/package.json +8 -2
- package/src/MyComponent.astro +1 -1
- package/src/components/Badge.vue +2 -2
- package/src/components/Badges.vue +17 -7
- package/src/components/Breadcrumbs.vue +47 -39
- package/src/components/Button.vue +31 -30
- package/src/components/ButtonCopy.astro +12 -17
- package/src/components/ButtonCopy.vue +26 -25
- package/src/components/Card.astro +4 -6
- package/src/components/Carousel.astro +4 -4
- package/src/components/Category/CategoriesCarousel.astro +75 -75
- package/src/components/Category/CategoryDetails.astro +75 -79
- package/src/components/Category/CategoryLink.vue +8 -12
- package/src/components/Category/CategorySidebarToggler.vue +2 -7
- package/src/components/Category/CategoryTile.astro +3 -3
- package/src/components/Category/CategoryViewToggler.astro +18 -18
- package/src/components/Category/SubCategoryLink.vue +13 -13
- package/src/components/Faq.astro +16 -17
- package/src/components/FaqItem.astro +27 -27
- package/src/components/FeaturesList.vue +19 -29
- package/src/components/FuckRussia.vue +40 -27
- package/src/components/HandDrive.astro +11 -15
- package/src/components/Header/Header.astro +165 -166
- package/src/components/Header/SkipToContent.astro +1 -1
- package/src/components/Headline.vue +44 -27
- package/src/components/Image.astro +5 -7
- package/src/components/Input.vue +143 -153
- package/src/components/Jumbotron/index.astro +143 -156
- package/src/components/Jumbotron/types.ts +28 -29
- package/src/components/Jumbotron/variants/Default.astro +44 -40
- package/src/components/Jumbotron/variants/Hero.astro +45 -53
- package/src/components/Jumbotron/variants/Post.astro +68 -64
- package/src/components/Jumbotron/variants/PostSplit.astro +89 -81
- package/src/components/Jumbotron.astro +12 -12
- package/src/components/LanguageSuggestion.astro +66 -69
- package/src/components/LeftSidebar.astro +10 -10
- package/src/components/MainColors.vue +2 -2
- package/src/components/MainInput.vue +6 -3
- package/src/components/Modal.astro +2 -2
- package/src/components/PartNumber.vue +2 -3
- package/src/components/Post/PostCategories.astro +2 -4
- package/src/components/Post/PostCategories.vue +2 -2
- package/src/components/PostHeader.astro +4 -6
- package/src/components/PrCode.vue +20 -19
- package/src/components/Product/ProductButton.vue +2 -5
- package/src/components/Product/ProductCarousel.astro +38 -27
- package/src/components/Product/ProductColors.vue +46 -42
- package/src/components/Product/ProductDetailName.vue +22 -22
- package/src/components/Product/ProductDetails.vue +115 -99
- package/src/components/Product/ProductDoc.vue +27 -25
- package/src/components/Product/ProductEngineType.vue +13 -10
- package/src/components/Product/ProductImage.astro +18 -19
- package/src/components/Product/ProductLink.astro +78 -57
- package/src/components/Product/ProductLink.vue +55 -58
- package/src/components/Product/ProductLinkInfo.astro +15 -18
- package/src/components/Product/ProductModel.vue +25 -24
- package/src/components/Product/ProductModels.vue +29 -33
- package/src/components/Product/ProductName.vue +15 -15
- package/src/components/Product/ProductNumber.astro +23 -31
- package/src/components/Product/ProductPositions.vue +32 -34
- package/src/components/ProductCarousel.astro +5 -5
- package/src/components/ProductCodes.vue +12 -14
- package/src/components/ProductDetailName.vue +18 -20
- package/src/components/ProductDetailsList.vue +48 -27
- package/src/components/ProductTile.astro +40 -36
- package/src/components/Quote.vue +8 -6
- package/src/components/ReloadPrompt.astro +39 -47
- package/src/components/SlimBanner.vue +44 -19
- package/src/components/Table.vue +4 -6
- package/src/components/Translations.vue +17 -8
- package/src/components/flags/FlagPL.vue +4 -3
- package/src/components/flags/FlagUA.vue +2 -2
- package/src/components/layout/CallToAction.astro +17 -12
- package/src/components/layout/Container.astro +3 -1
- package/src/components/layout/Header.astro +12 -21
- package/src/config.ts +43 -43
- package/src/design.config.ts +63 -63
- package/src/env.d.ts +4 -4
- package/src/layouts/Layout.astro +10 -19
- package/src/layouts/MainLayout.astro +13 -19
- package/src/layouts/partials/FooterCommon.astro +2 -2
- package/src/layouts/partials/HeadCommon.astro +9 -9
- package/src/layouts/partials/HeadSEO.astro +12 -5
- package/src/pages/components/icons.astro +130 -121
- package/src/pages/core/shadows.astro +18 -11
- package/src/pages/core/typography.astro +36 -36
- package/src/pages/index.astro +178 -75
- package/src/pwa.ts +4 -4
- package/src/styles/base/base.css +14 -19
- package/src/styles/base/grid.css +54 -58
- package/src/styles/base/typography.css +40 -40
- package/src/styles/content.css +25 -23
- package/src/styles/main.css +5 -6
- package/src/types/Product.ts +31 -31
- package/src/types/astro.d.ts +1 -1
- package/src/types/index.ts +234 -237
- package/src/utils/api/getCategories.ts +9 -9
- package/src/utils/category/getMainCategoryList.ts +22 -22
- package/src/utils/category/getSortedCategories.ts +7 -11
- package/src/utils/product/getPriceFormatted.ts +14 -11
- package/src/utils/product/getProductChecklist.ts +10 -11
- package/src/utils/product/useFormatProductNumber.ts +18 -9
- package/src/utils/seo/getShorterDescription.ts +6 -4
- package/src/utils/text/formatDate.ts +2 -3
- package/src/utils/text/formatLocaleNumber.ts +2 -2
- package/src/utils/text/formatPad.ts +2 -2
- package/src/utils/text/getNumberFormatted.ts +10 -10
- package/src/utils/text/getTranslatedLink.ts +3 -3
- package/src/utils/text.ts +11 -8
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
locale: string;
|
|
8
8
|
index: number;
|
|
9
9
|
bigTile?: boolean;
|
|
10
|
-
loading?:
|
|
10
|
+
loading?: 'eager' | 'lazy';
|
|
11
11
|
isShopProduct?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -17,80 +17,101 @@ const {
|
|
|
17
17
|
bigTile,
|
|
18
18
|
locale,
|
|
19
19
|
index,
|
|
20
|
-
loading =
|
|
20
|
+
loading = 'lazy',
|
|
21
21
|
isShopProduct = false,
|
|
22
22
|
} = Astro.props;
|
|
23
23
|
|
|
24
24
|
import { getProductById } from '@utils/product/getProductById';
|
|
25
25
|
import { getShopProductById } from '@utils/product/getShopProductById';
|
|
26
|
-
import { getProductUrl } from
|
|
27
|
-
import { getShopProductUrl } from
|
|
28
|
-
import { getProductTranslation } from
|
|
26
|
+
import { getProductUrl } from '@utils/product/getProductUrl';
|
|
27
|
+
import { getShopProductUrl } from '@utils/product/getShopProductUrl';
|
|
28
|
+
import { getProductTranslation } from '@utils/product/getProductTranslation';
|
|
29
29
|
import { getImageUrl } from '@utils/getImageUrl';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
ProductImage,
|
|
32
|
+
ProductNumber,
|
|
33
|
+
removeSemicolon,
|
|
34
|
+
getPriceFormatted,
|
|
35
|
+
} from 'spoko-design-system';
|
|
31
36
|
|
|
32
37
|
// Użycie productObject jeśli przekazane, inaczej pobranie produktu na podstawie productId
|
|
33
|
-
const product =
|
|
38
|
+
const product =
|
|
39
|
+
productObject ||
|
|
40
|
+
(productId
|
|
41
|
+
? isShopProduct
|
|
42
|
+
? await getShopProductById(productId)
|
|
43
|
+
: await getProductById(productId)
|
|
44
|
+
: null);
|
|
34
45
|
|
|
35
46
|
// Określenie URL miniatury produktu
|
|
36
|
-
const thumb = product
|
|
37
|
-
isShopProduct
|
|
38
|
-
? await getImageUrl(product.images?.[0]?.path ||
|
|
39
|
-
: await getImageUrl(product.photo ||
|
|
40
|
-
|
|
47
|
+
const thumb = product
|
|
48
|
+
? isShopProduct
|
|
49
|
+
? await getImageUrl(product.images?.[0]?.path || '', 'SHOP')
|
|
50
|
+
: await getImageUrl(product.photo || '', `'ProductLink' ${product.number}`)
|
|
51
|
+
: '';
|
|
41
52
|
|
|
42
53
|
// Product translation removed - using English only
|
|
43
|
-
const productTranslation = productId
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
const productTranslation = productId
|
|
55
|
+
? await getProductTranslation(productId, product?.number || '')
|
|
56
|
+
: null;
|
|
57
|
+
|
|
58
|
+
const productName = product
|
|
59
|
+
? isShopProduct
|
|
47
60
|
? product.name_en || product.name
|
|
48
61
|
: productTranslation?.name || product.name
|
|
49
|
-
|
|
62
|
+
: 'NO NAME';
|
|
50
63
|
|
|
51
64
|
const nameFormatted = removeSemicolon(productName.toString());
|
|
52
65
|
---
|
|
53
66
|
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
{
|
|
68
|
+
product && (
|
|
69
|
+
<>
|
|
70
|
+
<div
|
|
71
|
+
class={bigTile ? 'product-link--big-tile' : 'product-thumb--plp product-thumb--carousel'}
|
|
72
|
+
>
|
|
73
|
+
{product.photo !== null && thumb ? (
|
|
74
|
+
<ProductImage
|
|
75
|
+
imagesApiUrl="https://api.polo.blue"
|
|
76
|
+
imageObject={{
|
|
77
|
+
src: thumb,
|
|
78
|
+
alt: productName,
|
|
79
|
+
height: '180',
|
|
80
|
+
width: '240',
|
|
81
|
+
loading,
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
) : (
|
|
85
|
+
<img src="/1x1.png" class="bg-neutral-lightest/70" alt={productName} />
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class={bigTile ? '' : 'sm:pl-4'}>
|
|
90
|
+
{product.price_pln && (
|
|
91
|
+
<p class="block mb-2 font-600 font-headbold text-5">{getPriceFormatted(product)}</p>
|
|
92
|
+
)}
|
|
71
93
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
<a
|
|
95
|
+
class="product-link--url"
|
|
96
|
+
href={
|
|
97
|
+
isShopProduct
|
|
98
|
+
? getShopProductUrl(product.slug, locale)
|
|
99
|
+
: getProductUrl(product.number, locale)
|
|
100
|
+
}
|
|
101
|
+
itemprop="url"
|
|
102
|
+
title={product.number}
|
|
103
|
+
set:html={nameFormatted}
|
|
104
|
+
/>
|
|
78
105
|
|
|
79
|
-
|
|
80
|
-
class="product-link--url"
|
|
81
|
-
href={isShopProduct ? getShopProductUrl(product.slug, locale) : getProductUrl(product.number, locale)}
|
|
82
|
-
itemprop="url"
|
|
83
|
-
title={product.number}
|
|
84
|
-
set:html={nameFormatted}
|
|
85
|
-
/>
|
|
106
|
+
<ProductNumber productNumber={product.number} copyDisabled={true} />
|
|
86
107
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
{index !== null && (
|
|
109
|
+
<>
|
|
110
|
+
<meta itemprop="position" content={index.toString()} />
|
|
111
|
+
<meta itemprop="name" content={nameFormatted} />
|
|
112
|
+
</>
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
@@ -1,60 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div :class="[bigTile ? '' : 'sm:pl-4']">
|
|
13
|
-
<p v-if="price" class="block mb-2 font-600 font-headbold text-5">
|
|
14
|
-
{{ price }}
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
<a
|
|
18
|
-
class="product-link--url"
|
|
19
|
-
:href="url"
|
|
20
|
-
itemprop="url"
|
|
21
|
-
:title="productNumber"
|
|
22
|
-
v-html="nameFormatted"
|
|
23
|
-
/>
|
|
24
|
-
|
|
25
|
-
<ProductNumber
|
|
26
|
-
:productNumber="productNumber"
|
|
27
|
-
:copyDisabled="true"
|
|
28
|
-
/>
|
|
29
|
-
|
|
30
|
-
<template v-if="index !== null">
|
|
31
|
-
<meta itemprop="position" :content="index.toString()" />
|
|
32
|
-
<meta itemprop="name" :content="nameFormatted" />
|
|
33
|
-
</template>
|
|
34
|
-
</div>
|
|
2
|
+
<div class="product-link" itemscope itemtype="https://schema.org/Product">
|
|
3
|
+
<div
|
|
4
|
+
:class="[bigTile ? 'product-link--big-tile' : 'product-thumb--plp product-thumb--carousel']"
|
|
5
|
+
>
|
|
6
|
+
<!-- Slot na ProductImage z Astro -->
|
|
7
|
+
<slot name="image">
|
|
8
|
+
<img src="/1x1.png" class="bg-neutral-lightest/70" :alt="productName" />
|
|
9
|
+
</slot>
|
|
35
10
|
</div>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
11
|
+
|
|
12
|
+
<div :class="[bigTile ? '' : 'sm:pl-4']">
|
|
13
|
+
<p v-if="price" class="block mb-2 font-600 font-headbold text-5">
|
|
14
|
+
{{ price }}
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<a
|
|
18
|
+
class="product-link--url"
|
|
19
|
+
:href="url"
|
|
20
|
+
itemprop="url"
|
|
21
|
+
:title="productNumber"
|
|
22
|
+
v-html="nameFormatted"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<ProductNumber :productNumber="productNumber" :copyDisabled="true" />
|
|
26
|
+
|
|
27
|
+
<template v-if="index !== null">
|
|
28
|
+
<meta itemprop="position" :content="index.toString()" />
|
|
29
|
+
<meta itemprop="name" :content="nameFormatted" />
|
|
30
|
+
</template>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { computed } from 'vue';
|
|
37
|
+
import { ProductNumber } from 'spoko-design-system';
|
|
38
|
+
import { removeSemicolon } from 'spoko-design-system';
|
|
39
|
+
|
|
40
|
+
interface Props {
|
|
41
|
+
productName: string;
|
|
42
|
+
productNumber: string;
|
|
43
|
+
url: string;
|
|
44
|
+
price?: string;
|
|
45
|
+
bigTile?: boolean;
|
|
46
|
+
index?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
50
|
+
bigTile: false,
|
|
51
|
+
index: null,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const nameFormatted = computed(() => {
|
|
55
|
+
return removeSemicolon(props.productName.toString());
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { Product } from '../../types/Product';
|
|
3
|
-
import ProductNumber from
|
|
3
|
+
import ProductNumber from './ProductNumber.astro';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
product: Product;
|
|
@@ -12,27 +12,24 @@ interface Props {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const { product, nameFormatted, price, url, index, bigTile } = Astro.props;
|
|
15
|
-
|
|
16
15
|
---
|
|
17
16
|
|
|
18
17
|
<div class={`flex flex-col ${bigTile ? '' : 'sm:pl-4'}`}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/>
|
|
31
|
-
<ProductNumber productNumber={product.number} copyDisabled={true} />
|
|
32
|
-
{index !== null && (
|
|
18
|
+
{price && <p class="block mb-2 font-600 font-headbold text-5">{price}</p>}
|
|
19
|
+
<a
|
|
20
|
+
class="product-link--url"
|
|
21
|
+
href={url}
|
|
22
|
+
itemprop="url"
|
|
23
|
+
title={product.number}
|
|
24
|
+
set:html={nameFormatted}
|
|
25
|
+
/>
|
|
26
|
+
<ProductNumber productNumber={product.number} copyDisabled={true} />
|
|
27
|
+
{
|
|
28
|
+
index !== null && (
|
|
33
29
|
<>
|
|
34
30
|
<meta itemprop="position" content={index} />
|
|
35
31
|
<meta itemprop="name" content={nameFormatted} />
|
|
36
32
|
</>
|
|
37
|
-
)
|
|
38
|
-
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
</div>
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { Model } from 'types/index';
|
|
3
|
-
import type { PropType } from 'vue';
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
carModel: {
|
|
7
|
-
type: Object as PropType<Model>,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
</
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { Model } from 'types/index';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
carModel: {
|
|
7
|
+
type: Object as PropType<Model>,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
<template>
|
|
13
|
+
<strong class="product-model" :data-pagefind-filter="`model:${props.carModel.name}`">{{
|
|
14
|
+
props.carModel.name
|
|
15
|
+
}}</strong>
|
|
16
|
+
</template>
|
|
17
|
+
<style>
|
|
18
|
+
.product-model:not(:last-child) {
|
|
19
|
+
@apply mr-1;
|
|
20
|
+
|
|
21
|
+
&:after {
|
|
22
|
+
content: ',';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
modelIds: {
|
|
6
|
-
type: Array as PropType<(string | number)[]>,
|
|
7
|
-
default: () => [],
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
content: ','
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
</style>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelIds: {
|
|
6
|
+
type: Array as PropType<(string | number)[]>,
|
|
7
|
+
default: () => [],
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div inline-flex flex-wrap max-w-max>
|
|
15
|
+
<span v-for="(modelId, index) in modelIds" :key="index" class="product-model block">
|
|
16
|
+
<ProductModel :id="modelId" />
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.product-model:not(:last-child) {
|
|
23
|
+
@apply mr-1;
|
|
24
|
+
|
|
25
|
+
&:after {
|
|
26
|
+
content: ',';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
name: {
|
|
4
|
-
type: String,
|
|
5
|
-
default: '',
|
|
6
|
-
required: true,
|
|
7
|
-
},
|
|
8
|
-
})
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<h1 class="pdp-headline select-all">
|
|
13
|
-
{{ props.name }}
|
|
14
|
-
</h1>
|
|
15
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
name: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: '',
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<h1 class="pdp-headline select-all">
|
|
13
|
+
{{ props.name }}
|
|
14
|
+
</h1>
|
|
15
|
+
</template>
|
|
@@ -9,18 +9,16 @@ const {
|
|
|
9
9
|
small = false,
|
|
10
10
|
big = false,
|
|
11
11
|
class: customClass = '',
|
|
12
|
-
buttonTexts = { copy:
|
|
12
|
+
buttonTexts = { copy: 'Copy', copied: 'Copied' },
|
|
13
13
|
} = Astro.props;
|
|
14
14
|
|
|
15
15
|
// Use formatted product number using a helper function
|
|
16
16
|
const { formattedNumbers: formatted } = useFormatProductNumber(productNumber);
|
|
17
17
|
|
|
18
18
|
// Define classes dynamically
|
|
19
|
-
const classNames = [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
customClass,
|
|
23
|
-
].filter(Boolean).join(' ');
|
|
19
|
+
const classNames = ['product-number', big ? 'text-4.5' : 'number-big', customClass]
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.join(' ');
|
|
24
22
|
|
|
25
23
|
const trackingClass = small ? 'tracking-wide' : 'tracking-tight';
|
|
26
24
|
|
|
@@ -29,32 +27,26 @@ const ProductWrapper = isPdp ? 'h2' : 'div';
|
|
|
29
27
|
const FormattedWrapper = isPdp ? 'h3' : 'div';
|
|
30
28
|
---
|
|
31
29
|
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
<div class={
|
|
35
|
-
<
|
|
36
|
-
{productNumber}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{big && (
|
|
40
|
-
<ButtonCopy
|
|
41
|
-
productNumber={productNumber}
|
|
42
|
-
texts={buttonTexts}
|
|
43
|
-
tooltipClasses=""
|
|
44
|
-
/>
|
|
45
|
-
)}
|
|
46
|
-
</div>
|
|
30
|
+
{
|
|
31
|
+
productNumber && formatted && (
|
|
32
|
+
<div class={classNames}>
|
|
33
|
+
<div class={['p-number', small ? 'w-full' : ''].join(' ')} itemprop="identifier">
|
|
34
|
+
<ProductWrapper id={productNumber} class="product-code">
|
|
35
|
+
{productNumber}
|
|
36
|
+
</ProductWrapper>
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
<div class="relative inset-0" data-pagefind-ignore>
|
|
50
|
-
{formatted.dot}
|
|
38
|
+
{big && <ButtonCopy productNumber={productNumber} texts={buttonTexts} tooltipClasses="" />}
|
|
51
39
|
</div>
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
|
|
41
|
+
<div class={['code-formatted', trackingClass].join(' ')}>
|
|
42
|
+
<div class="relative inset-0" data-pagefind-ignore>
|
|
43
|
+
{formatted.dot}
|
|
44
|
+
</div>
|
|
45
|
+
<div class="absolute inset-0" data-pagefind-ignore>
|
|
46
|
+
{formatted.dash}
|
|
47
|
+
</div>
|
|
48
|
+
<FormattedWrapper class="number-secondary">{formatted.standard}</FormattedWrapper>
|
|
54
49
|
</div>
|
|
55
|
-
<FormattedWrapper class="number-secondary">
|
|
56
|
-
{formatted.standard}
|
|
57
|
-
</FormattedWrapper>
|
|
58
50
|
</div>
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
)
|
|
52
|
+
}
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { Position } from 'types/index';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
positions: {
|
|
6
|
+
type: Array as PropType<Position[]>,
|
|
7
|
+
default: null,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
locale: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: null,
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<span v-for="position in positions" :key="position.sort" class="product-position">
|
|
20
|
+
{{ position.name }}
|
|
21
|
+
</span>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
.product-position:not(:last-child) {
|
|
26
|
+
margin-right: 0.25rem;
|
|
27
|
+
|
|
28
|
+
&:after {
|
|
29
|
+
content: ',';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import ProductTile from
|
|
2
|
+
import ProductTile from '../components/ProductTile.astro';
|
|
3
3
|
export const productObject = {
|
|
4
|
-
name:
|
|
5
|
-
url:
|
|
6
|
-
number:
|
|
4
|
+
name: 'Combi-instrument MFA+',
|
|
5
|
+
url: 'https://google.com',
|
|
6
|
+
number: '6R0920870F',
|
|
7
7
|
photo:
|
|
8
|
-
|
|
8
|
+
'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337',
|
|
9
9
|
};
|
|
10
10
|
---
|
|
11
11
|
|