spoko-design-system 1.1.0 → 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.
- package/.claude/settings.local.json +2 -1
- package/.github/workflows/code-quality.yml +3 -3
- package/.github/workflows/sonarcloud.yml +1 -1
- 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.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/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/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
|
@@ -42,10 +42,10 @@ jobs:
|
|
|
42
42
|
run: pnpm install --frozen-lockfile
|
|
43
43
|
|
|
44
44
|
- name: Check Prettier formatting
|
|
45
|
-
run: pnpm
|
|
45
|
+
run: pnpm run format:check
|
|
46
46
|
|
|
47
47
|
- name: Run ESLint
|
|
48
|
-
run: pnpm
|
|
48
|
+
run: pnpm run lint
|
|
49
49
|
|
|
50
50
|
- name: Type check
|
|
51
|
-
run: pnpm
|
|
51
|
+
run: pnpm run check
|
|
@@ -45,7 +45,7 @@ jobs:
|
|
|
45
45
|
run: pnpm run build
|
|
46
46
|
|
|
47
47
|
- name: SonarCloud Scan
|
|
48
|
-
uses: SonarSource/
|
|
48
|
+
uses: SonarSource/sonarqube-scan-action@master
|
|
49
49
|
env:
|
|
50
50
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
|
51
51
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
package/.prettierrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.1.2](https://github.com/polo-blue/sds/compare/v1.1.1...v1.1.2) (2025-09-23)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* add Prettier Astro plugin and format most files ([19e776d](https://github.com/polo-blue/sds/commit/19e776df1bed0ded35ca9b287db266b653ecb1ae))
|
|
6
|
+
|
|
7
|
+
## [1.1.1](https://github.com/polo-blue/sds/compare/v1.1.0...v1.1.1) (2025-09-23)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update SonarCloud workflow to use non-deprecated action ([0523ea3](https://github.com/polo-blue/sds/commit/0523ea3e4e236a4bb2d972b5bb9090df33d72c50))
|
|
12
|
+
|
|
1
13
|
## [1.1.0](https://github.com/polo-blue/sds/compare/v1.0.1...v1.1.0) (2025-09-23)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -21,7 +21,12 @@
|
|
|
21
21
|
"build": "astro build",
|
|
22
22
|
"preview": "astro preview",
|
|
23
23
|
"semantic-release": "semantic-release",
|
|
24
|
-
"prepublishOnly": "pnpm run build"
|
|
24
|
+
"prepublishOnly": "pnpm run build",
|
|
25
|
+
"format": "prettier --write \"src/**/*.{js,ts,jsx,tsx,vue,astro,json,css,md}\"",
|
|
26
|
+
"format:check": "prettier --check \"src/**/*.{js,ts,jsx,tsx,vue,astro,json,css,md}\"",
|
|
27
|
+
"lint": "eslint \"src/**/*.{js,ts,jsx,tsx,vue,astro}\"",
|
|
28
|
+
"lint:fix": "eslint \"src/**/*.{js,ts,jsx,tsx,vue,astro}\" --fix",
|
|
29
|
+
"check": "astro check"
|
|
25
30
|
},
|
|
26
31
|
"repository": {
|
|
27
32
|
"type": "git",
|
|
@@ -121,6 +126,7 @@
|
|
|
121
126
|
"eslint-plugin-astro": "^1.3.1",
|
|
122
127
|
"eslint-plugin-vue": "^10.5.0",
|
|
123
128
|
"prettier": "^3.6.2",
|
|
129
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
124
130
|
"semantic-release": "^24.2.9",
|
|
125
131
|
"unocss": "^0.65.0",
|
|
126
132
|
"vite": "^7.1.7"
|
package/src/MyComponent.astro
CHANGED
package/src/components/Badge.vue
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
import Badge from
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
import Badge from './Badge.vue';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
badges: {
|
|
7
7
|
type: Array as PropType<string[]>,
|
|
8
8
|
required: false,
|
|
9
9
|
default() {
|
|
10
|
-
return []
|
|
10
|
+
return [];
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
-
})
|
|
13
|
+
});
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<div v-if="
|
|
18
|
-
<Badge
|
|
19
|
-
|
|
17
|
+
<div v-if="props.badges && props.badges.length > 0" class="absolute z-2">
|
|
18
|
+
<Badge
|
|
19
|
+
v-for="(badge, index) in props.badges"
|
|
20
|
+
:key="index"
|
|
21
|
+
:badge="badge"
|
|
22
|
+
:class="
|
|
23
|
+
badge.toLocaleLowerCase().includes('gti')
|
|
24
|
+
? 'bg-red-600'
|
|
25
|
+
: badge.toLocaleLowerCase().includes('motorsport')
|
|
26
|
+
? 'bg-blue-wrc'
|
|
27
|
+
: 'bg-black'
|
|
28
|
+
"
|
|
29
|
+
/>
|
|
20
30
|
</div>
|
|
21
31
|
</template>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
2
|
export interface Breadcrumb {
|
|
4
|
-
name: string
|
|
5
|
-
path: string
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
|
-
import type { PropType } from 'vue'
|
|
7
|
+
import type { PropType } from 'vue';
|
|
9
8
|
|
|
10
9
|
const props = defineProps({
|
|
11
10
|
showBack: {
|
|
@@ -15,7 +14,7 @@ const props = defineProps({
|
|
|
15
14
|
textBack: {
|
|
16
15
|
type: String,
|
|
17
16
|
required: false,
|
|
18
|
-
default: 'Back'
|
|
17
|
+
default: 'Back',
|
|
19
18
|
},
|
|
20
19
|
showHome: {
|
|
21
20
|
type: Boolean,
|
|
@@ -23,71 +22,80 @@ const props = defineProps({
|
|
|
23
22
|
},
|
|
24
23
|
breadcrumbs: {
|
|
25
24
|
type: Array as PropType<Breadcrumb[]>,
|
|
26
|
-
required: true
|
|
25
|
+
required: true,
|
|
27
26
|
},
|
|
28
27
|
productNumber: {
|
|
29
28
|
type: String,
|
|
30
29
|
required: false,
|
|
31
|
-
default: null
|
|
32
|
-
}
|
|
33
|
-
})
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
34
33
|
|
|
35
34
|
const isLast = (index: number) => {
|
|
36
|
-
return index === props.breadcrumbs.length - 1
|
|
37
|
-
}
|
|
35
|
+
return index === props.breadcrumbs.length - 1;
|
|
36
|
+
};
|
|
38
37
|
</script>
|
|
39
38
|
|
|
40
39
|
<template>
|
|
41
40
|
<nav>
|
|
42
41
|
<ul class="breadcrumbs-base">
|
|
43
42
|
<li v-if="props.showBack" class="breadcrumb-item">
|
|
44
|
-
<button
|
|
45
|
-
class="breadcrumb-back-btn"
|
|
46
|
-
:title="props.textBack"
|
|
47
|
-
onclick="history.back()"
|
|
48
|
-
>
|
|
43
|
+
<button class="breadcrumb-back-btn" :title="props.textBack" onclick="history.back()">
|
|
49
44
|
<span class="block px-3" i-bx-bx-arrow-back />
|
|
50
45
|
</button>
|
|
51
46
|
</li>
|
|
52
47
|
</ul>
|
|
53
|
-
<ul
|
|
54
|
-
|
|
48
|
+
<ul
|
|
49
|
+
class="breadcrumbs-base overflow-x-auto overflow-y-hidden sm:mr-12"
|
|
50
|
+
itemscope
|
|
51
|
+
itemtype="https://schema.org/BreadcrumbList"
|
|
52
|
+
>
|
|
55
53
|
<li v-if="props.showHome" class="breadcrumb-item">
|
|
56
|
-
<a
|
|
54
|
+
<a
|
|
55
|
+
href="/"
|
|
57
56
|
class="breadcrumb-link flex items-center px-3 sm:px-0 py-4.25 sm:py-1 hover:text-brand-secondary whitespace-nowrap translate-y-0 text-sm my-auto"
|
|
58
|
-
:title="props.textBack"
|
|
59
|
-
itemprop="item"
|
|
60
|
-
i-carbon-home
|
|
57
|
+
:title="props.textBack"
|
|
58
|
+
itemprop="item"
|
|
59
|
+
i-carbon-home
|
|
60
|
+
>
|
|
61
61
|
</a>
|
|
62
|
-
<meta itemprop="position" content="1"
|
|
62
|
+
<meta itemprop="position" content="1" />
|
|
63
63
|
</li>
|
|
64
|
-
<li
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
<li
|
|
65
|
+
v-for="(crumb, index) in breadcrumbs"
|
|
66
|
+
:key="index"
|
|
67
|
+
class="breadcrumb-item"
|
|
68
|
+
itemprop="itemListElement"
|
|
69
|
+
itemscope
|
|
70
|
+
itemtype="https://schema.org/ListItem"
|
|
71
|
+
>
|
|
70
72
|
<span v-if="index > 0 || props.showHome" class="text-gray-400 px-1 py-4.25 sm:py-1">/</span>
|
|
71
|
-
|
|
72
|
-
<a
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
|
|
74
|
+
<a
|
|
75
|
+
v-if="!isLast(index)"
|
|
76
|
+
:href="crumb.path"
|
|
77
|
+
class="breadcrumb-link"
|
|
78
|
+
itemprop="item"
|
|
79
|
+
:title="`Polo 6R ${crumb.name}`"
|
|
80
|
+
>
|
|
77
81
|
<strong class="font-normal" itemprop="name">{{ crumb.name }}</strong>
|
|
78
82
|
</a>
|
|
79
|
-
<a
|
|
83
|
+
<a
|
|
84
|
+
v-else
|
|
80
85
|
:href="crumb.path"
|
|
81
86
|
class="breadcrumb-link breadcrumb-link-disabled"
|
|
82
87
|
:title="`Polo 6R ${crumb.name} ${productNumber}`"
|
|
83
|
-
itemprop="item"
|
|
88
|
+
itemprop="item"
|
|
89
|
+
>
|
|
84
90
|
<span class="font-normal" itemprop="name">
|
|
85
91
|
<span v-html="crumb.name"></span>
|
|
86
|
-
<b v-if="productNumber" class="hidden sm:inline font-normal ml-1"
|
|
92
|
+
<b v-if="productNumber" class="hidden sm:inline font-normal ml-1"
|
|
93
|
+
> {{ productNumber }}</b
|
|
94
|
+
>
|
|
87
95
|
</span>
|
|
88
96
|
</a>
|
|
89
97
|
|
|
90
|
-
<meta itemprop="position" :content="String(props.showHome ? index + 2 : index + 1)"
|
|
98
|
+
<meta itemprop="position" :content="String(props.showHome ? index + 2 : index + 1)" />
|
|
91
99
|
</li>
|
|
92
100
|
</ul>
|
|
93
101
|
</nav>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useAttrs } from 'vue'
|
|
2
|
+
import { useAttrs } from 'vue';
|
|
3
3
|
|
|
4
4
|
interface ButtonProps {
|
|
5
5
|
href?: string;
|
|
@@ -26,43 +26,44 @@ interface ButtonProps {
|
|
|
26
26
|
const props = defineProps<ButtonProps>();
|
|
27
27
|
|
|
28
28
|
// Check if we should add a default mediumHover for tertiary
|
|
29
|
-
const shouldAddDefaultMediumHover =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const shouldAddDefaultMediumHover =
|
|
30
|
+
props.tertiary ||
|
|
31
|
+
(props.tertiaryOutline &&
|
|
32
|
+
!props.whiteHover &&
|
|
33
|
+
!props.lightHover &&
|
|
34
|
+
!props.mediumHover &&
|
|
35
|
+
!props.darkHover);
|
|
34
36
|
|
|
35
|
-
const tag = props.href && props.href.length ? 'a' : 'button'
|
|
37
|
+
const tag = props.href && props.href.length ? 'a' : 'button';
|
|
36
38
|
const classes = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
'btn-primary': props.primary,
|
|
40
|
+
'btn-primary-outline': props.primaryOutline,
|
|
41
|
+
'btn-secondary': props.secondary,
|
|
42
|
+
'btn-secondary-outline': props.secondaryOutline,
|
|
43
|
+
'btn-tertiary': props.tertiary,
|
|
44
|
+
'btn-tertiary-outline': props.tertiaryOutline,
|
|
45
|
+
'btn-text': props.text,
|
|
46
|
+
'btn-tag': props.tag,
|
|
47
|
+
'btn-sm': props.medium,
|
|
48
|
+
'btn-xs': props.small,
|
|
49
|
+
'btn-normal': !props.small && !props.medium,
|
|
50
|
+
'rounded-full': props.rounded,
|
|
51
|
+
'btn-circle': props.circle,
|
|
52
|
+
'btn-white-hover': props.whiteHover,
|
|
53
|
+
'btn-light-hover': props.lightHover,
|
|
54
|
+
'btn-medium-hover': props.mediumHover || shouldAddDefaultMediumHover,
|
|
55
|
+
'btn-dark-hover': props.darkHover,
|
|
54
56
|
};
|
|
55
57
|
|
|
56
|
-
|
|
57
58
|
const attrs = useAttrs();
|
|
58
59
|
</script>
|
|
59
60
|
|
|
60
61
|
<template>
|
|
61
|
-
|
|
62
|
-
:is="tag"
|
|
63
|
-
:class="classes"
|
|
62
|
+
<component
|
|
63
|
+
:is="tag"
|
|
64
|
+
:class="classes"
|
|
64
65
|
v-bind="attrs"
|
|
65
|
-
:href="props.href"
|
|
66
|
+
:href="props.href"
|
|
66
67
|
:title="props.title ? props.title : null"
|
|
67
68
|
>
|
|
68
69
|
<slot></slot>
|
|
@@ -99,4 +100,4 @@ const attrs = useAttrs();
|
|
|
99
100
|
.btn-circle svg {
|
|
100
101
|
margin: 0;
|
|
101
102
|
}
|
|
102
|
-
</style>
|
|
103
|
+
</style>
|
|
@@ -8,11 +8,7 @@ interface Props {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const {
|
|
12
|
-
productNumber,
|
|
13
|
-
tooltipClasses = '',
|
|
14
|
-
texts
|
|
15
|
-
} = Astro.props;
|
|
11
|
+
const { productNumber, tooltipClasses = '', texts } = Astro.props;
|
|
16
12
|
|
|
17
13
|
// SVG icon as data URL for mask
|
|
18
14
|
const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
@@ -20,18 +16,17 @@ const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
|
20
16
|
)}")`;
|
|
21
17
|
---
|
|
22
18
|
|
|
23
|
-
<button
|
|
24
|
-
aria-label={texts.copy}
|
|
25
|
-
class="btn-copy has-tooltip"
|
|
19
|
+
<button
|
|
20
|
+
aria-label={texts.copy}
|
|
21
|
+
class="btn-copy has-tooltip"
|
|
26
22
|
data-copy-text={productNumber}
|
|
27
23
|
data-category={Astro.url.pathname.split('/')[1] || ''}
|
|
28
24
|
>
|
|
29
|
-
<span
|
|
30
|
-
class:list={[
|
|
25
|
+
<span
|
|
26
|
+
class:list={['tooltip rounded-full btn-copy-text', tooltipClasses]}
|
|
31
27
|
data-text={texts.copy}
|
|
32
|
-
data-copied-text={texts.copied}
|
|
33
|
-
|
|
34
|
-
<span class="copy-icon" role="img" aria-hidden="true" />
|
|
28
|
+
data-copied-text={texts.copied}></span>
|
|
29
|
+
<span class="copy-icon" role="img" aria-hidden="true"></span>
|
|
35
30
|
</button>
|
|
36
31
|
|
|
37
32
|
<script>
|
|
@@ -85,7 +80,7 @@ const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
|
85
80
|
productCode: this.copyText,
|
|
86
81
|
category: this.category,
|
|
87
82
|
pageUrl: window.location.pathname,
|
|
88
|
-
timestamp: new Date().toISOString()
|
|
83
|
+
timestamp: new Date().toISOString(),
|
|
89
84
|
});
|
|
90
85
|
}
|
|
91
86
|
|
|
@@ -109,10 +104,10 @@ const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
|
109
104
|
textArea.value = this.copyText;
|
|
110
105
|
textArea.style.position = 'fixed';
|
|
111
106
|
textArea.style.opacity = '0';
|
|
112
|
-
|
|
107
|
+
|
|
113
108
|
document.body.appendChild(textArea);
|
|
114
109
|
textArea.select();
|
|
115
|
-
|
|
110
|
+
|
|
116
111
|
try {
|
|
117
112
|
document.execCommand('copy');
|
|
118
113
|
} catch (err) {
|
|
@@ -181,4 +176,4 @@ const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
|
181
176
|
-webkit-mask-size: 100% 100%;
|
|
182
177
|
mask-size: 100% 100%;
|
|
183
178
|
}
|
|
184
|
-
</style>
|
|
179
|
+
</style>
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useClipboard } from
|
|
2
|
+
import { useClipboard } from '@vueuse/core';
|
|
3
3
|
// import { Icon } from "@iconify/vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
productNumber: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: null,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
tooltipClasses: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false,
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
texts: {
|
|
17
|
+
type: Object as PropType<{ copy: String; copied: String }>,
|
|
18
|
+
required: true,
|
|
19
|
+
default: {
|
|
20
|
+
copy: 'copy',
|
|
21
|
+
copied: 'copied',
|
|
10
22
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
required: false,
|
|
14
|
-
default: '',
|
|
15
|
-
},
|
|
16
|
-
texts: {
|
|
17
|
-
type: Object as PropType<{ copy: String, copied: String }>,
|
|
18
|
-
required: true,
|
|
19
|
-
default: {
|
|
20
|
-
copy: 'copy',
|
|
21
|
-
copied: 'copied',
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
})
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
25
|
const source = props.productNumber;
|
|
26
26
|
const { copy, copied, isSupported } = useClipboard({ source, legacy: true });
|
|
27
|
-
|
|
28
27
|
</script>
|
|
29
28
|
|
|
30
29
|
<template>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
<button :aria-label="texts.copy" class="btn-copy has-tooltip" @click="copy()">
|
|
31
|
+
<span
|
|
32
|
+
:class="`tooltip rounded-full btn-copy-text ${tooltipClasses}`"
|
|
33
|
+
:data-text="!copied ? texts.copy : texts.copied"
|
|
34
|
+
/>
|
|
35
|
+
<span i-ph-copy-simple-light class="leading-none w-full h-full" />
|
|
36
|
+
</button>
|
|
36
37
|
</template>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
const { class: className, imgSrc, imgAlt, href } = Astro.props;
|
|
3
3
|
|
|
4
|
-
import Image from
|
|
4
|
+
import Image from '../components/Image.astro';
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
<div
|
|
8
|
-
class="bg-white border border-gray-200 rounded-lg shadow overflow-hidden"
|
|
9
|
-
>
|
|
7
|
+
<div class="bg-white border border-gray-200 rounded-lg shadow overflow-hidden">
|
|
10
8
|
<a href={href} class="aspect-ratio-video block relative">
|
|
11
9
|
{
|
|
12
10
|
imgSrc && (
|
|
@@ -14,8 +12,8 @@ import Image from "../components/Image.astro";
|
|
|
14
12
|
imageObject={{
|
|
15
13
|
src: imgSrc,
|
|
16
14
|
alt: imgAlt,
|
|
17
|
-
height:
|
|
18
|
-
width:
|
|
15
|
+
height: '405',
|
|
16
|
+
width: '720',
|
|
19
17
|
}}
|
|
20
18
|
/>
|
|
21
19
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
export const productObject = {
|
|
3
|
-
name:
|
|
4
|
-
url:
|
|
5
|
-
number:
|
|
3
|
+
name: 'Combi-instrument MFA+',
|
|
4
|
+
url: 'https://google.com',
|
|
5
|
+
number: '6R0920870F',
|
|
6
6
|
photo:
|
|
7
|
-
|
|
7
|
+
'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337',
|
|
8
8
|
};
|
|
9
9
|
---
|
|
10
10
|
|