spoko-design-system 1.9.0 → 1.9.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.json +1 -1
- package/.husky/pre-commit +17 -1
- package/.prettierrc +8 -4
- package/CHANGELOG.md +35 -0
- package/index.ts +8 -2
- package/package.json +4 -3
- package/src/components/Badge.vue +1 -4
- package/src/components/Badges.vue +1 -4
- package/src/components/Breadcrumbs.vue +10 -44
- package/src/components/Button.vue +1 -5
- package/src/components/ButtonCopy.astro +2 -7
- package/src/components/ButtonCopy.vue +2 -9
- package/src/components/Card.astro +1 -4
- package/src/components/Category/CategoriesCarousel.astro +3 -11
- package/src/components/Category/CategoryDetails.astro +7 -32
- package/src/components/Category/CategoryLink.vue +1 -5
- package/src/components/Category/CategorySidebarToggler.vue +1 -5
- package/src/components/Category/CategoryTile.astro +2 -9
- package/src/components/Category/CategoryViewToggler.astro +3 -16
- package/src/components/Copyright.astro +1 -4
- package/src/components/Date.astro +1 -4
- package/src/components/Faq.astro +1 -5
- package/src/components/FaqItem.astro +3 -14
- package/src/components/FeaturesList.vue +2 -9
- package/src/components/FuckRussia.vue +9 -36
- package/src/components/HandDrive.astro +2 -12
- package/src/components/Header/Header.astro +3 -14
- package/src/components/Header/SkipToContent.astro +1 -5
- package/src/components/Input.vue +19 -31
- package/src/components/Jumbotron/index.astro +7 -41
- package/src/components/Jumbotron/variants/Default.astro +2 -17
- package/src/components/Jumbotron/variants/Hero.astro +3 -17
- package/src/components/Jumbotron/variants/Post.astro +3 -13
- package/src/components/Jumbotron/variants/PostSplit.astro +3 -13
- package/src/components/Jumbotron.astro +3 -12
- package/src/components/LanguageSuggestion.astro +3 -14
- package/src/components/MainColors.vue +7 -25
- package/src/components/MainInput.vue +2 -1
- package/src/components/Modal.astro +43 -41
- package/src/components/PageContent.astro +1 -4
- package/src/components/PartNumber.vue +1 -4
- package/src/components/PostHeader.astro +3 -13
- package/src/components/PrCode.vue +2 -2
- package/src/components/Product/ProductButton.vue +1 -4
- package/src/components/Product/ProductDetailName.vue +1 -4
- package/src/components/Product/ProductDetails.vue +19 -65
- package/src/components/Product/ProductDoc.vue +1 -4
- package/src/components/Product/ProductEngine.astro +67 -0
- package/src/components/Product/ProductEngineType.vue +1 -4
- package/src/components/Product/ProductEngines.astro +43 -0
- package/src/components/Product/ProductLink.astro +8 -32
- package/src/components/Product/ProductLink.vue +8 -36
- package/src/components/Product/ProductLinkInfo.astro +4 -19
- package/src/components/Product/ProductModel.vue +3 -5
- package/src/components/Product/ProductModels.vue +2 -10
- package/src/components/Product/ProductNumber.astro +6 -26
- package/src/components/Product/ProductPositions.vue +1 -5
- package/src/components/ProductCodes.vue +6 -14
- package/src/components/ProductDetailName.vue +2 -7
- package/src/components/ProductDetailsList.vue +7 -33
- package/src/components/ProductTile.astro +3 -13
- package/src/components/ReloadPrompt.astro +1 -5
- package/src/components/SlimBanner.vue +10 -15
- package/src/components/Table.vue +3 -15
- package/src/components/Translations.vue +1 -4
- package/src/components/layout/CallToAction.astro +2 -7
- package/src/components/layout/Container.astro +1 -3
- package/src/components/layout/Header.astro +2 -12
- package/src/layouts/Layout.astro +2 -9
- package/src/layouts/MainLayout.astro +4 -17
- package/src/layouts/partials/HeadCommon.astro +7 -24
- package/src/layouts/partials/HeadSEO.astro +12 -48
- package/src/pages/components/icons.astro +1 -4
- package/src/pages/components/product-engine.mdx +75 -31
- package/src/pages/core/typography.astro +2 -6
- package/src/pages/index.astro +16 -63
- package/src/scripts/tooltips.ts +33 -28
- package/src/styles/main.css +4 -0
- package/src/styles/tippy-theme.css +4 -2
- package/src/utils/product/getEngineTooltipContent.ts +158 -0
- package/src/utils/product/getPriceFormatted.ts +2 -6
- package/src/utils/product/useFormatProductNumber.ts +1 -4
- package/src/utils/seo/getShorterDescription.ts +1 -4
- package/uno-config/index.ts +1 -1
- package/src/components/Product/ProductEngine.vue +0 -240
- package/src/components/Product/ProductEngines.vue +0 -116
package/.claude/settings.json
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"Bash(git log:*)",
|
|
15
15
|
"Bash(git add:*)",
|
|
16
16
|
"Bash(git commit:*)"
|
|
17
|
+
"Bash(git push:*)"
|
|
17
18
|
],
|
|
18
19
|
"deny": [
|
|
19
20
|
"Bash(pnpm semantic-release:*)",
|
|
20
21
|
"Bash(pnpm publish:*)",
|
|
21
22
|
"Bash(npm publish:*)",
|
|
22
|
-
"Bash(git push:*)"
|
|
23
23
|
],
|
|
24
24
|
"ask": [
|
|
25
25
|
"Bash(rm:*)",
|
package/.husky/pre-commit
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
echo "🔍 Running pre-commit checks..."
|
|
2
2
|
|
|
3
|
+
# Run format check
|
|
4
|
+
echo "🎨 Checking code formatting..."
|
|
5
|
+
pnpm run format:check
|
|
6
|
+
if [ $? -ne 0 ]; then
|
|
7
|
+
echo "❌ Format check failed! Run 'pnpm run format' to fix."
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Run linting
|
|
12
|
+
echo "🔍 Running linter..."
|
|
13
|
+
pnpm run lint
|
|
14
|
+
if [ $? -ne 0 ]; then
|
|
15
|
+
echo "❌ Lint check failed! Run 'pnpm run lint:fix' to fix."
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
3
19
|
# Run Astro build to catch MDX and component errors
|
|
4
20
|
echo "🏗️ Building project..."
|
|
5
21
|
pnpm run build
|
|
6
22
|
|
|
7
23
|
if [ $? -eq 0 ]; then
|
|
8
|
-
echo "✅
|
|
24
|
+
echo "✅ All checks passed! Proceeding with commit..."
|
|
9
25
|
else
|
|
10
26
|
echo "❌ Build failed! Please fix errors before committing."
|
|
11
27
|
exit 1
|
package/.prettierrc
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
"singleQuote": true,
|
|
4
4
|
"tabWidth": 2,
|
|
5
5
|
"trailingComma": "es5",
|
|
6
|
-
"printWidth":
|
|
6
|
+
"printWidth": 110,
|
|
7
7
|
"useTabs": false,
|
|
8
8
|
"bracketSpacing": true,
|
|
9
9
|
"arrowParens": "avoid",
|
|
10
10
|
"endOfLine": "lf",
|
|
11
|
-
"singleAttributePerLine":
|
|
12
|
-
"plugins": [
|
|
11
|
+
"singleAttributePerLine": false,
|
|
12
|
+
"plugins": [
|
|
13
|
+
"prettier-plugin-astro"
|
|
14
|
+
],
|
|
13
15
|
"overrides": [
|
|
14
16
|
{
|
|
15
17
|
"files": "*.astro",
|
|
@@ -20,7 +22,9 @@
|
|
|
20
22
|
{
|
|
21
23
|
"files": "*.vue",
|
|
22
24
|
"options": {
|
|
23
|
-
"parser": "vue"
|
|
25
|
+
"parser": "vue",
|
|
26
|
+
"vueIndentScriptAndStyle": false,
|
|
27
|
+
"htmlWhitespaceSensitivity": "ignore"
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## [1.9.2](https://github.com/polo-blue/sds/compare/v1.9.1...v1.9.2) (2025-10-30)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* improve prettier config and add comprehensive pre-commit checks ([847641e](https://github.com/polo-blue/sds/commit/847641e17566fa85a1fa5466b87a7028ae3287bb))
|
|
6
|
+
|
|
7
|
+
## [1.9.1](https://github.com/polo-blue/sds/compare/v1.9.0...v1.9.1) (2025-10-30)
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* ProductEngine and ProductEngines are now Astro components
|
|
12
|
+
|
|
13
|
+
Replace Vue components with Astro for better performance and SEO:
|
|
14
|
+
- Convert ProductEngine.vue to ProductEngine.astro (SSR-friendly)
|
|
15
|
+
- Convert ProductEngines.vue to ProductEngines.astro
|
|
16
|
+
- Add getEngineTooltipContent utility for tooltip generation
|
|
17
|
+
- Create global tooltip delegation script for performance
|
|
18
|
+
- Add tippy.js CSS to main.css (tippy.css + tippy-theme.css)
|
|
19
|
+
|
|
20
|
+
Benefits:
|
|
21
|
+
- Engine codes now in HTML for SEO (no client-side hydration)
|
|
22
|
+
- 1 global script handles all tooltips via delegation pattern
|
|
23
|
+
- Tooltips created on-demand when hovered (not on mount)
|
|
24
|
+
- Works for both engine codes and PR codes
|
|
25
|
+
- Massive performance improvement on pages with many engines
|
|
26
|
+
|
|
27
|
+
Migration:
|
|
28
|
+
- Remove client:load directive from ProductEngines usage
|
|
29
|
+
- Import and call initTooltips() in your layout
|
|
30
|
+
- ProductEngine/ProductEngines now pure Astro (no Vue)
|
|
31
|
+
|
|
32
|
+
### Code Refactoring
|
|
33
|
+
|
|
34
|
+
* migrate ProductEngine from Vue to Astro with tooltip delegation ([b3589cc](https://github.com/polo-blue/sds/commit/b3589cc75da9cbf514bcffce2d06a8a36d67012e))
|
|
35
|
+
|
|
1
36
|
## [1.9.0](https://github.com/polo-blue/sds/compare/v1.8.1...v1.9.0) (2025-10-29)
|
|
2
37
|
|
|
3
38
|
### Features
|
package/index.ts
CHANGED
|
@@ -19,8 +19,7 @@ export { default as Headline } from './src/components/Headline.vue';
|
|
|
19
19
|
export { default as Quote } from './src/components/Quote.vue';
|
|
20
20
|
|
|
21
21
|
export { default as ProductEngineType } from './src/components/Product/ProductEngineType.vue';
|
|
22
|
-
|
|
23
|
-
export { default as ProductEngines } from './src/components/Product/ProductEngines.vue';
|
|
22
|
+
// ProductEngine and ProductEngines are now Astro components (see Astro Components section below)
|
|
24
23
|
export { default as ProductButton } from './src/components/Product/ProductButton.vue';
|
|
25
24
|
export { default as ProductColors } from './src/components/Product/ProductColors.vue';
|
|
26
25
|
export { default as ProductDetailName } from './src/components/Product/ProductDetailName.vue';
|
|
@@ -50,6 +49,8 @@ export { default as ButtonCopy } from './src/components/ButtonCopy.astro';
|
|
|
50
49
|
export { default as CallToAction } from './src/components/Layout/CallToAction.astro';
|
|
51
50
|
|
|
52
51
|
export { default as ProductImage } from './src/components/Product/ProductImage.astro';
|
|
52
|
+
export { default as ProductEngine } from './src/components/Product/ProductEngine.astro';
|
|
53
|
+
export { default as ProductEngines } from './src/components/Product/ProductEngines.astro';
|
|
53
54
|
|
|
54
55
|
export { default as CategoryDetails } from './src/components/Category/CategoryDetails.astro';
|
|
55
56
|
export { default as CategoryTile } from './src/components/Category/CategoryTile.astro';
|
|
@@ -58,6 +59,8 @@ export { default as CategoryTile } from './src/components/Category/CategoryTile.
|
|
|
58
59
|
// Utils: Product
|
|
59
60
|
export { default as getPriceFormatted } from './src/utils/product/getPriceFormatted';
|
|
60
61
|
export { default as getProductChecklist } from './src/utils/product/getProductChecklist';
|
|
62
|
+
export { getEngineTooltipContent } from './src/utils/product/getEngineTooltipContent';
|
|
63
|
+
export type { Engine, EngineTranslations } from './src/utils/product/getEngineTooltipContent';
|
|
61
64
|
|
|
62
65
|
// Utils: SEO
|
|
63
66
|
export { default as getShorterDescription } from './src/utils/seo/getShorterDescription';
|
|
@@ -70,3 +73,6 @@ export { default as formatLocaleNumber } from './src/utils/text/formatLocaleNumb
|
|
|
70
73
|
export { default as formatPad } from './src/utils/text/formatPad';
|
|
71
74
|
export { default as getNumberFormatted } from './src/utils/text/getNumberFormatted';
|
|
72
75
|
export { default as getTranslatedLink } from './src/utils/text/getTranslatedLink';
|
|
76
|
+
|
|
77
|
+
// Scripts
|
|
78
|
+
export { initTooltips } from './src/scripts/tooltips';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"spoko design system"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@algolia/client-search": "^5.
|
|
55
|
+
"@algolia/client-search": "^5.42.0",
|
|
56
56
|
"@astrojs/mdx": "^4.3.9",
|
|
57
57
|
"@astrojs/node": "^9.5.0",
|
|
58
58
|
"@astrojs/sitemap": "^3.6.0",
|
|
@@ -145,7 +145,8 @@
|
|
|
145
145
|
},
|
|
146
146
|
"ignoredBuiltDependencies": [
|
|
147
147
|
"esbuild",
|
|
148
|
-
"sharp"
|
|
148
|
+
"sharp",
|
|
149
|
+
"vue-demi"
|
|
149
150
|
]
|
|
150
151
|
},
|
|
151
152
|
"engines": {
|
package/src/components/Badge.vue
CHANGED
|
@@ -47,10 +47,7 @@ const getBadgeColor = (badge: string | BadgeObject): string => {
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<template>
|
|
50
|
-
<div
|
|
51
|
-
v-if="props.badges && props.badges.length > 0"
|
|
52
|
-
class="absolute z-2"
|
|
53
|
-
>
|
|
50
|
+
<div v-if="props.badges && props.badges.length > 0" class="absolute z-2">
|
|
54
51
|
<Badge
|
|
55
52
|
v-for="(badge, index) in props.badges"
|
|
56
53
|
:key="index"
|
|
@@ -39,19 +39,9 @@ const isLast = (index: number) => {
|
|
|
39
39
|
<template>
|
|
40
40
|
<nav>
|
|
41
41
|
<ul class="breadcrumbs-base">
|
|
42
|
-
<li
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
<button
|
|
47
|
-
class="breadcrumb-back-btn"
|
|
48
|
-
:title="props.textBack"
|
|
49
|
-
onclick="history.back()"
|
|
50
|
-
>
|
|
51
|
-
<span
|
|
52
|
-
class="block px-3"
|
|
53
|
-
i-bx-bx-arrow-back
|
|
54
|
-
/>
|
|
42
|
+
<li v-if="props.showBack" class="breadcrumb-item">
|
|
43
|
+
<button class="breadcrumb-back-btn" :title="props.textBack" onclick="history.back()">
|
|
44
|
+
<span class="block px-3" i-bx-bx-arrow-back />
|
|
55
45
|
</button>
|
|
56
46
|
</li>
|
|
57
47
|
</ul>
|
|
@@ -60,10 +50,7 @@ const isLast = (index: number) => {
|
|
|
60
50
|
itemscope
|
|
61
51
|
itemtype="https://schema.org/BreadcrumbList"
|
|
62
52
|
>
|
|
63
|
-
<li
|
|
64
|
-
v-if="props.showHome"
|
|
65
|
-
class="breadcrumb-item"
|
|
66
|
-
>
|
|
53
|
+
<li v-if="props.showHome" class="breadcrumb-item">
|
|
67
54
|
<a
|
|
68
55
|
href="/"
|
|
69
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"
|
|
@@ -71,10 +58,7 @@ const isLast = (index: number) => {
|
|
|
71
58
|
itemprop="item"
|
|
72
59
|
i-carbon-home
|
|
73
60
|
/>
|
|
74
|
-
<meta
|
|
75
|
-
itemprop="position"
|
|
76
|
-
content="1"
|
|
77
|
-
/>
|
|
61
|
+
<meta itemprop="position" content="1" />
|
|
78
62
|
</li>
|
|
79
63
|
<li
|
|
80
64
|
v-for="(crumb, index) in breadcrumbs"
|
|
@@ -84,11 +68,7 @@ const isLast = (index: number) => {
|
|
|
84
68
|
itemscope
|
|
85
69
|
itemtype="https://schema.org/ListItem"
|
|
86
70
|
>
|
|
87
|
-
<span
|
|
88
|
-
v-if="index > 0 || props.showHome"
|
|
89
|
-
class="text-gray-400 px-1 py-4.25 sm:py-1"
|
|
90
|
-
>/</span
|
|
91
|
-
>
|
|
71
|
+
<span v-if="index > 0 || props.showHome" class="text-gray-400 px-1 py-4.25 sm:py-1">/</span>
|
|
92
72
|
|
|
93
73
|
<a
|
|
94
74
|
v-if="!isLast(index)"
|
|
@@ -97,11 +77,7 @@ const isLast = (index: number) => {
|
|
|
97
77
|
itemprop="item"
|
|
98
78
|
:title="`Polo 6R ${crumb.name}`"
|
|
99
79
|
>
|
|
100
|
-
<strong
|
|
101
|
-
class="font-normal"
|
|
102
|
-
itemprop="name"
|
|
103
|
-
>{{ crumb.name }}</strong
|
|
104
|
-
>
|
|
80
|
+
<strong class="font-normal" itemprop="name">{{ crumb.name }}</strong>
|
|
105
81
|
</a>
|
|
106
82
|
<a
|
|
107
83
|
v-else
|
|
@@ -110,23 +86,13 @@ const isLast = (index: number) => {
|
|
|
110
86
|
:title="`Polo 6R ${crumb.name} ${productNumber}`"
|
|
111
87
|
itemprop="item"
|
|
112
88
|
>
|
|
113
|
-
<span
|
|
114
|
-
class="font-normal"
|
|
115
|
-
itemprop="name"
|
|
116
|
-
>
|
|
89
|
+
<span class="font-normal" itemprop="name">
|
|
117
90
|
<span v-html="crumb.name" />
|
|
118
|
-
<b
|
|
119
|
-
v-if="productNumber"
|
|
120
|
-
class="hidden sm:inline font-normal ml-1"
|
|
121
|
-
> {{ productNumber }}</b
|
|
122
|
-
>
|
|
91
|
+
<b v-if="productNumber" class="hidden sm:inline font-normal ml-1"> {{ productNumber }}</b>
|
|
123
92
|
</span>
|
|
124
93
|
</a>
|
|
125
94
|
|
|
126
|
-
<meta
|
|
127
|
-
itemprop="position"
|
|
128
|
-
:content="String(props.showHome ? index + 2 : index + 1)"
|
|
129
|
-
/>
|
|
95
|
+
<meta itemprop="position" :content="String(props.showHome ? index + 2 : index + 1)" />
|
|
130
96
|
</li>
|
|
131
97
|
</ul>
|
|
132
98
|
</nav>
|
|
@@ -28,11 +28,7 @@ const props = defineProps<ButtonProps>();
|
|
|
28
28
|
// Check if we should add a default mediumHover for tertiary
|
|
29
29
|
const shouldAddDefaultMediumHover =
|
|
30
30
|
props.tertiary ||
|
|
31
|
-
(props.tertiaryOutline &&
|
|
32
|
-
!props.whiteHover &&
|
|
33
|
-
!props.lightHover &&
|
|
34
|
-
!props.mediumHover &&
|
|
35
|
-
!props.darkHover);
|
|
31
|
+
(props.tertiaryOutline && !props.whiteHover && !props.lightHover && !props.mediumHover && !props.darkHover);
|
|
36
32
|
|
|
37
33
|
const tag = props.href && props.href.length ? 'a' : 'button';
|
|
38
34
|
const classes = {
|
|
@@ -25,13 +25,8 @@ const COPY_ICON = `url("data:image/svg+xml;utf8,${encodeURIComponent(
|
|
|
25
25
|
<span
|
|
26
26
|
class:list={['tooltip rounded-full btn-copy-text', tooltipClasses]}
|
|
27
27
|
data-text={texts.copy}
|
|
28
|
-
data-copied-text={texts.copied}
|
|
29
|
-
></span>
|
|
30
|
-
<span
|
|
31
|
-
class="copy-icon"
|
|
32
|
-
role="img"
|
|
33
|
-
aria-hidden="true"
|
|
34
|
-
></span>
|
|
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>
|
|
@@ -27,18 +27,11 @@ const { copy, copied } = useClipboard({ source, legacy: true });
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<button
|
|
31
|
-
:aria-label="texts.copy"
|
|
32
|
-
class="btn-copy has-tooltip"
|
|
33
|
-
@click="copy()"
|
|
34
|
-
>
|
|
30
|
+
<button :aria-label="texts.copy" class="btn-copy has-tooltip" @click="copy()">
|
|
35
31
|
<span
|
|
36
32
|
:class="`tooltip rounded-full btn-copy-text ${tooltipClasses}`"
|
|
37
33
|
:data-text="!copied ? texts.copy : texts.copied"
|
|
38
34
|
/>
|
|
39
|
-
<span
|
|
40
|
-
i-ph-copy-simple-light
|
|
41
|
-
class="leading-none w-full h-full"
|
|
42
|
-
/>
|
|
35
|
+
<span i-ph-copy-simple-light class="leading-none w-full h-full" />
|
|
43
36
|
</button>
|
|
44
37
|
</template>
|
|
@@ -5,10 +5,7 @@ import Image from '../components/Image.astro';
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<div class="bg-white border border-gray-200 rounded-lg shadow overflow-hidden">
|
|
8
|
-
<a
|
|
9
|
-
href={href}
|
|
10
|
-
class="aspect-ratio-video block relative"
|
|
11
|
-
>
|
|
8
|
+
<a href={href} class="aspect-ratio-video block relative">
|
|
12
9
|
{
|
|
13
10
|
imgSrc && (
|
|
14
11
|
<Image
|
|
@@ -9,9 +9,7 @@ const categories = await getMainCategoryList();
|
|
|
9
9
|
const imgDomain = 'https://api.polo.blue/img/';
|
|
10
10
|
|
|
11
11
|
const activeIndex =
|
|
12
|
-
activeCategorySlug && categories
|
|
13
|
-
? categories.map(a => a.slug).findIndex(e => e === activeCategorySlug)
|
|
14
|
-
: 0;
|
|
12
|
+
activeCategorySlug && categories ? categories.map(a => a.slug).findIndex(e => e === activeCategorySlug) : 0;
|
|
15
13
|
---
|
|
16
14
|
|
|
17
15
|
<!-- <div class={`cat-menu ${className ? className : ''}`}
|
|
@@ -45,10 +43,7 @@ const activeIndex =
|
|
|
45
43
|
role="presentation"
|
|
46
44
|
class={`swiper-slide cats-slide group ${category.slug === activeCategorySlug ? 'active' : ''}`}
|
|
47
45
|
>
|
|
48
|
-
<a
|
|
49
|
-
href={getTranslatedLink(`/${category.slug}/`)}
|
|
50
|
-
class="carousel-item"
|
|
51
|
-
>
|
|
46
|
+
<a href={getTranslatedLink(`/${category.slug}/`)} class="carousel-item">
|
|
52
47
|
{
|
|
53
48
|
// itemprop="url"
|
|
54
49
|
// role="menuitem"
|
|
@@ -67,10 +62,7 @@ const activeIndex =
|
|
|
67
62
|
/>
|
|
68
63
|
<div class="swiper-lazy-preloader" />
|
|
69
64
|
|
|
70
|
-
<div
|
|
71
|
-
class="cat-name"
|
|
72
|
-
itemprop="name"
|
|
73
|
-
>
|
|
65
|
+
<div class="cat-name" itemprop="name">
|
|
74
66
|
{category.name}
|
|
75
67
|
</div>
|
|
76
68
|
</a>
|
|
@@ -3,16 +3,8 @@ import CategorySidebarToggler from './CategorySidebarToggler.vue';
|
|
|
3
3
|
import CategoryViewToggler from './CategoryViewToggler.astro';
|
|
4
4
|
import { Icon } from 'astro-icon/components';
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
subcategory,
|
|
9
|
-
subtitle,
|
|
10
|
-
subsubtitle,
|
|
11
|
-
titleSmall,
|
|
12
|
-
showViewToggler,
|
|
13
|
-
viewerLabels,
|
|
14
|
-
locale,
|
|
15
|
-
} = Astro.props;
|
|
6
|
+
const { category, subcategory, subtitle, subsubtitle, titleSmall, showViewToggler, viewerLabels } =
|
|
7
|
+
Astro.props;
|
|
16
8
|
|
|
17
9
|
// Use paths directly from API - they already include locale and proper slashes
|
|
18
10
|
const categoryPath = category?.path || `/${category.slug}/`;
|
|
@@ -24,16 +16,9 @@ const subcategoryPath = subcategory?.path || `/${category.slug}/${subcategory?.s
|
|
|
24
16
|
transition:name="category-details"
|
|
25
17
|
transition:animate="fade"
|
|
26
18
|
>
|
|
27
|
-
<CategorySidebarToggler
|
|
28
|
-
class="category-sidebar-toggler w-12 md:w-8"
|
|
29
|
-
data-state="desktop"
|
|
30
|
-
>
|
|
19
|
+
<CategorySidebarToggler class="category-sidebar-toggler w-12 md:w-8" data-state="desktop">
|
|
31
20
|
<div class="desktop-icons hidden md:block">
|
|
32
|
-
<Icon
|
|
33
|
-
name="ant-design:menu-fold-outlined"
|
|
34
|
-
class="toggler-btn w-6 expanded-icon"
|
|
35
|
-
aria-hidden="true"
|
|
36
|
-
/>
|
|
21
|
+
<Icon name="ant-design:menu-fold-outlined" class="toggler-btn w-6 expanded-icon" aria-hidden="true" />
|
|
37
22
|
<Icon
|
|
38
23
|
name="ant-design:menu-unfold-outlined"
|
|
39
24
|
class="toggler-btn w-6 collapsed-icon hidden"
|
|
@@ -41,11 +26,7 @@ const subcategoryPath = subcategory?.path || `/${category.slug}/${subcategory?.s
|
|
|
41
26
|
/>
|
|
42
27
|
</div>
|
|
43
28
|
<div class="mobile-icon block md:hidden">
|
|
44
|
-
<Icon
|
|
45
|
-
name="ant-design:menu-outlined"
|
|
46
|
-
class="toggler-btn w-6"
|
|
47
|
-
aria-hidden="true"
|
|
48
|
-
/>
|
|
29
|
+
<Icon name="ant-design:menu-outlined" class="toggler-btn w-6" aria-hidden="true" />
|
|
49
30
|
</div>
|
|
50
31
|
</CategorySidebarToggler>
|
|
51
32
|
|
|
@@ -53,10 +34,7 @@ const subcategoryPath = subcategory?.path || `/${category.slug}/${subcategory?.s
|
|
|
53
34
|
{
|
|
54
35
|
subtitle ? (
|
|
55
36
|
<>
|
|
56
|
-
<a
|
|
57
|
-
class="text-lg font-vw-headregular whitespace-nowrap block"
|
|
58
|
-
href={categoryPath}
|
|
59
|
-
>
|
|
37
|
+
<a class="text-lg font-vw-headregular whitespace-nowrap block" href={categoryPath}>
|
|
60
38
|
{category.name}
|
|
61
39
|
{titleSmall && <small>{titleSmall}</small>}
|
|
62
40
|
</a>
|
|
@@ -89,10 +67,7 @@ const subcategoryPath = subcategory?.path || `/${category.slug}/${subcategory?.s
|
|
|
89
67
|
|
|
90
68
|
{
|
|
91
69
|
showViewToggler && (
|
|
92
|
-
<CategoryViewToggler
|
|
93
|
-
{...viewerLabels}
|
|
94
|
-
class="hidden lg:flex items-center gap-2 ml-auto"
|
|
95
|
-
/>
|
|
70
|
+
<CategoryViewToggler {...viewerLabels} class="hidden lg:flex items-center gap-2 ml-auto" />
|
|
96
71
|
)
|
|
97
72
|
}
|
|
98
73
|
</div>
|
|
@@ -22,11 +22,7 @@ const prefix = locale === 'en' ? '' : `${locale}/`;
|
|
|
22
22
|
const href = `/${prefix}${CategoryObject.slug}/`;
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
<a
|
|
26
|
-
href={href}
|
|
27
|
-
class="carousel-item"
|
|
28
|
-
data-astro-prefetch
|
|
29
|
-
>
|
|
25
|
+
<a href={href} class="carousel-item" data-astro-prefetch>
|
|
30
26
|
<Image
|
|
31
27
|
src={CategoryObject.photo}
|
|
32
28
|
alt={CategoryObject.alt}
|
|
@@ -38,10 +34,7 @@ const href = `/${prefix}${CategoryObject.slug}/`;
|
|
|
38
34
|
class="cats-img"
|
|
39
35
|
/>
|
|
40
36
|
<div class="swiper-lazy-preloader"></div>
|
|
41
|
-
<div
|
|
42
|
-
class="cat-name"
|
|
43
|
-
itemprop="name"
|
|
44
|
-
>
|
|
37
|
+
<div class="cat-name" itemprop="name">
|
|
45
38
|
{CategoryObject.name}
|
|
46
39
|
</div>
|
|
47
40
|
</a>
|
|
@@ -10,14 +10,7 @@ interface Props {
|
|
|
10
10
|
class?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const {
|
|
14
|
-
showText,
|
|
15
|
-
listText,
|
|
16
|
-
gridText,
|
|
17
|
-
listAriaLabel,
|
|
18
|
-
gridAriaLabel,
|
|
19
|
-
class: className,
|
|
20
|
-
} = Astro.props;
|
|
13
|
+
const { showText, listText, gridText, listAriaLabel, gridAriaLabel, class: className } = Astro.props;
|
|
21
14
|
---
|
|
22
15
|
|
|
23
16
|
<div class:list={[className]}>
|
|
@@ -29,10 +22,7 @@ const {
|
|
|
29
22
|
class="view-toggle flex items-center gap-1 px-3 py-0.5 transition-colors"
|
|
30
23
|
aria-label={listAriaLabel}
|
|
31
24
|
>
|
|
32
|
-
<Icon
|
|
33
|
-
name="ant-design:bars-outlined"
|
|
34
|
-
class="w-4 h-4"
|
|
35
|
-
/>
|
|
25
|
+
<Icon name="ant-design:bars-outlined" class="w-4 h-4" />
|
|
36
26
|
<span class="text-sm">{listText}</span>
|
|
37
27
|
</button>
|
|
38
28
|
<button
|
|
@@ -41,10 +31,7 @@ const {
|
|
|
41
31
|
class="view-toggle flex items-center gap-1 px-3 py-0.5 transition-colors"
|
|
42
32
|
aria-label={gridAriaLabel}
|
|
43
33
|
>
|
|
44
|
-
<Icon
|
|
45
|
-
name="ant-design:appstore-outlined"
|
|
46
|
-
class="w-4 h-4"
|
|
47
|
-
/>
|
|
34
|
+
<Icon name="ant-design:appstore-outlined" class="w-4 h-4" />
|
|
48
35
|
<span class="text-sm">{gridText}</span>
|
|
49
36
|
</button>
|
|
50
37
|
</div>
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
const { class: className } = Astro.props;
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
<div
|
|
6
|
-
class="bg-vw h-11 flex items-center font-headlight justify-between px-4"
|
|
7
|
-
class:list={[className]}
|
|
8
|
-
>
|
|
5
|
+
<div class="bg-vw h-11 flex items-center font-headlight justify-between px-4" class:list={[className]}>
|
|
9
6
|
<slot name="left-item" />
|
|
10
7
|
<slot name="middle-item" />
|
|
11
8
|
<slot name="right-item" />
|
package/src/components/Faq.astro
CHANGED
|
@@ -17,11 +17,7 @@ interface Props {
|
|
|
17
17
|
const { questions } = Astro.props;
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
<div
|
|
21
|
-
class="flex flex-col mt-6 mb-4 w-full px-4 md:px-0"
|
|
22
|
-
itemscope
|
|
23
|
-
itemtype="https://schema.org/FAQPage"
|
|
24
|
-
>
|
|
20
|
+
<div class="flex flex-col mt-6 mb-4 w-full px-4 md:px-0" itemscope itemtype="https://schema.org/FAQPage">
|
|
25
21
|
<div class="mb-6 text-4xl font-headbold sm:text-4xl text-blue-802 faq-heading">
|
|
26
22
|
Frequently Asked Questions
|
|
27
23
|
</div>
|
|
@@ -23,21 +23,10 @@ const { data } = Astro.props;
|
|
|
23
23
|
class="py-2 outline-none cursor-pointer focus:underline text-xl font-500 relative items-center flex justify-between list-none
|
|
24
24
|
after:(block duration-200 content-empty bg-[url(/arrow-bottom.svg)] bg-contain bg-center bg-no-repeat h-3 w-4 min-w-4 my-auto ml-4 opacity-60)"
|
|
25
25
|
>
|
|
26
|
-
<h2
|
|
27
|
-
itemprop="name"
|
|
28
|
-
class="font-headbold"
|
|
29
|
-
set:html={data.question}
|
|
30
|
-
/>
|
|
26
|
+
<h2 itemprop="name" class="font-headbold" set:html={data.question} />
|
|
31
27
|
</summary>
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
itemprop="acceptedAnswer"
|
|
35
|
-
itemtype="https://schema.org/Answer"
|
|
36
|
-
>
|
|
37
|
-
<div
|
|
38
|
-
itemprop="text"
|
|
39
|
-
class="px-0 pb-4"
|
|
40
|
-
>
|
|
28
|
+
<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
|
|
29
|
+
<div itemprop="text" class="px-0 pb-4">
|
|
41
30
|
<Markdown content={data.answer} />
|
|
42
31
|
</div>
|
|
43
32
|
</div>
|
|
@@ -16,18 +16,11 @@ const props = defineProps({
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<h2
|
|
20
|
-
v-if="props.caption"
|
|
21
|
-
class="features-list-caption"
|
|
22
|
-
>
|
|
19
|
+
<h2 v-if="props.caption" class="features-list-caption">
|
|
23
20
|
{{ props.caption }}
|
|
24
21
|
</h2>
|
|
25
22
|
<ul class="features-list-ul">
|
|
26
|
-
<li
|
|
27
|
-
v-for="(item, index) in props.items"
|
|
28
|
-
:key="index"
|
|
29
|
-
class="features-list-item"
|
|
30
|
-
>
|
|
23
|
+
<li v-for="(item, index) in props.items" :key="index" class="features-list-item">
|
|
31
24
|
{{ item }}
|
|
32
25
|
</li>
|
|
33
26
|
</ul>
|