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.
- package/.claude/settings.local.json +2 -1
- package/.github/workflows/code-quality.yml +3 -3
- package/.prettierrc +1 -0
- package/CHANGELOG.md +6 -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
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
---
|
|
2
2
|
const { activeCategorySlug, locale, class: className } = Astro.props;
|
|
3
3
|
|
|
4
|
-
import { getTranslatedLink } from
|
|
5
|
-
import { getMainCategoryList } from
|
|
6
|
-
import { Image } from 'astro:assets'
|
|
4
|
+
import { getTranslatedLink } from '@utils/text/getTranslatedLink';
|
|
5
|
+
import { getMainCategoryList } from '@utils/category/getMainCategoryList';
|
|
6
|
+
import { Image } from 'astro:assets';
|
|
7
7
|
|
|
8
|
-
const categories = await getMainCategoryList()
|
|
8
|
+
const categories = await getMainCategoryList();
|
|
9
9
|
const imgDomain = 'https://api.polo.blue/img/';
|
|
10
10
|
|
|
11
|
-
const activeIndex =
|
|
11
|
+
const activeIndex =
|
|
12
|
+
activeCategorySlug && categories
|
|
13
|
+
? categories.map(a => a.slug).findIndex(e => e === activeCategorySlug)
|
|
14
|
+
: 0;
|
|
12
15
|
---
|
|
16
|
+
|
|
13
17
|
<!-- <div class={`cat-menu ${className ? className : ''}`}
|
|
14
18
|
data-pagefind-ignore
|
|
15
19
|
itemscope itemtype="https://schema.org/SiteNavigationElement"
|
|
16
20
|
transition:persist={`catcarousel${activeIndex}`}
|
|
17
21
|
transition:animate="none"
|
|
18
22
|
> -->
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
23
|
+
<swiper-container
|
|
24
|
+
class={`categories-carousel flex pb-1 sm:pb-0 bg-white cat-menu ${className ? className : ''}`}
|
|
25
|
+
data-pagefind-ignore
|
|
26
|
+
itemscope
|
|
27
|
+
itemtype="https://schema.org/SiteNavigationElement"
|
|
28
|
+
transition:persist={`catcarousel${activeIndex}`}
|
|
29
|
+
transition:animate="none"
|
|
30
|
+
data-active={activeIndex}
|
|
31
|
+
initial-slide={activeIndex}
|
|
32
|
+
space-between="0"
|
|
33
|
+
slides-per-view="auto"
|
|
34
|
+
scrollbar="true"
|
|
35
|
+
draggable="true"
|
|
36
|
+
keyboard
|
|
37
|
+
free-mode
|
|
38
|
+
data-off-observer
|
|
39
|
+
run-callbacks-on-init="false"
|
|
40
|
+
>
|
|
41
|
+
{
|
|
42
|
+
categories.map((category, index) => (
|
|
43
|
+
<swiper-slide
|
|
44
|
+
itemprop="hasPart"
|
|
45
|
+
role="presentation"
|
|
46
|
+
class={`swiper-slide cats-slide group ${category.slug === activeCategorySlug ? 'active' : ''}`}
|
|
47
|
+
>
|
|
48
|
+
<a href={getTranslatedLink(`/${category.slug}/`)} class="carousel-item">
|
|
49
|
+
{
|
|
50
|
+
// itemprop="url"
|
|
51
|
+
// role="menuitem"
|
|
52
|
+
// aria-label={ t(`cat.${category.slug}.name`) }
|
|
53
|
+
}
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<div class="cat-name"
|
|
63
|
-
// itemprop="name"
|
|
64
|
-
>
|
|
65
|
-
{ category.name }
|
|
66
|
-
</div>
|
|
67
|
-
</a>
|
|
68
|
-
</swiper-slide>
|
|
69
|
-
))
|
|
70
|
-
}
|
|
55
|
+
<Image
|
|
56
|
+
src={`${imgDomain}${category.photo}`}
|
|
57
|
+
alt={category.name}
|
|
58
|
+
height="70"
|
|
59
|
+
width="70"
|
|
60
|
+
format="avif"
|
|
61
|
+
loading="eager"
|
|
62
|
+
onerror="this.style.display='none';"
|
|
63
|
+
class="cats-img"
|
|
64
|
+
/>
|
|
65
|
+
<div class="swiper-lazy-preloader" />
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
<div class="cat-name" itemprop="name">
|
|
68
|
+
{category.name}
|
|
69
|
+
</div>
|
|
70
|
+
</a>
|
|
71
|
+
</swiper-slide>
|
|
72
|
+
))
|
|
73
|
+
}
|
|
74
|
+
</swiper-container>
|
|
73
75
|
<!-- </div> -->
|
|
74
76
|
|
|
75
|
-
<style
|
|
76
|
-
.active {
|
|
77
|
-
|
|
77
|
+
<style>
|
|
78
|
+
.active {
|
|
79
|
+
@apply bg-blue-darker text-white bg-opacity-100;
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
&:not(:hover) .cats-img {
|
|
82
|
+
filter: invert(100%);
|
|
83
|
+
/* // @apply filter-invert; */
|
|
84
|
+
}
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
}
|
|
85
86
|
|
|
86
|
-
.categories-carousel {
|
|
87
|
-
|
|
87
|
+
.categories-carousel {
|
|
88
|
+
@apply overflow-hidden;
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
&.swiper-initialized {
|
|
91
|
+
.img-preloader {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.swiper-slide {
|
|
97
|
-
@apply transition w-[calc(100%/3.55)] min-w-[calc(100%/3.55)] sm:w-35 sm:min-w-35 3xl:min-w-[calc(100%/12.5-4px)];
|
|
98
|
-
}
|
|
99
96
|
|
|
97
|
+
.swiper-slide {
|
|
98
|
+
@apply transition w-[calc(100%/3.55)] min-w-[calc(100%/3.55)] sm:w-35 sm:min-w-35 3xl:min-w-[calc(100%/12.5-4px)];
|
|
99
|
+
}
|
|
100
100
|
</style>
|
|
@@ -3,98 +3,95 @@ 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
|
-
category,
|
|
8
|
-
subcategory,
|
|
9
|
-
subtitle,
|
|
10
|
-
subsubtitle,
|
|
11
|
-
titleSmall,
|
|
12
|
-
locale,
|
|
13
|
-
showViewToggler,
|
|
14
|
-
viewerLabels
|
|
6
|
+
const {
|
|
7
|
+
category,
|
|
8
|
+
subcategory,
|
|
9
|
+
subtitle,
|
|
10
|
+
subsubtitle,
|
|
11
|
+
titleSmall,
|
|
12
|
+
locale,
|
|
13
|
+
showViewToggler,
|
|
14
|
+
viewerLabels,
|
|
15
15
|
} = Astro.props;
|
|
16
16
|
|
|
17
17
|
const baseURL = '';
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
<div
|
|
20
|
+
<div
|
|
21
21
|
class="flex flex-nowrap items-center pr-3 sm:pb-3 sm:pt-4 md:pl-4 relative z-10-off bg-neutral-lightest md:bg-white"
|
|
22
22
|
transition:name="category-details"
|
|
23
23
|
transition:animate="fade"
|
|
24
24
|
>
|
|
25
|
-
<CategorySidebarToggler class="category-sidebar-toggler w-12 md:w-8" data-state="desktop">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
aria-hidden="true"
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
</CategorySidebarToggler>
|
|
48
|
-
|
|
25
|
+
<CategorySidebarToggler class="category-sidebar-toggler w-12 md:w-8" data-state="desktop">
|
|
26
|
+
<div class="desktop-icons hidden md:block">
|
|
27
|
+
<!-- Desktop icons container -->
|
|
28
|
+
<Icon
|
|
29
|
+
name="ant-design:menu-fold-outlined"
|
|
30
|
+
class="toggler-btn w-6 expanded-icon"
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
/>
|
|
33
|
+
<Icon
|
|
34
|
+
name="ant-design:menu-unfold-outlined"
|
|
35
|
+
class="toggler-btn w-6 collapsed-icon hidden"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
<!-- Mobile icon in separate container -->
|
|
40
|
+
<div class="mobile-icon block md:hidden">
|
|
41
|
+
<Icon name="ant-design:menu-outlined" class="toggler-btn w-6" aria-hidden="true" />
|
|
42
|
+
</div>
|
|
43
|
+
</CategorySidebarToggler>
|
|
49
44
|
|
|
50
45
|
<div class="overflow-x-auto overflow-y-hidden flex max-w-full items-center">
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<>
|
|
64
|
-
<div class="text-lg py-2.5 sm:py-0 whitespace-nowrap">
|
|
65
|
-
<a href={`${baseURL}/${category.slug}/${subcategory.slug}/`}>
|
|
66
|
-
{subtitle}
|
|
67
|
-
</a>
|
|
68
|
-
</div>
|
|
69
|
-
<span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
|
|
46
|
+
{
|
|
47
|
+
subtitle ? (
|
|
48
|
+
<>
|
|
49
|
+
<a
|
|
50
|
+
class="text-lg font-vw-headregular whitespace-nowrap block"
|
|
51
|
+
href={`${baseURL}/${category.slug}/`}
|
|
52
|
+
>
|
|
53
|
+
{category.name}
|
|
54
|
+
{titleSmall && <small>{titleSmall}</small>}
|
|
55
|
+
</a>
|
|
56
|
+
<span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
|
|
57
|
+
{!subsubtitle ? (
|
|
70
58
|
<h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap underline underline-offset-6 decoration-blue-300 decoration-0.5">
|
|
71
|
-
{
|
|
59
|
+
{subtitle} <span class="sr-only"> catalog</span>
|
|
72
60
|
</h1>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
) : (
|
|
62
|
+
<>
|
|
63
|
+
<div class="text-lg py-2.5 sm:py-0 whitespace-nowrap">
|
|
64
|
+
<a href={`${baseURL}/${category.slug}/${subcategory.slug}/`}>{subtitle}</a>
|
|
65
|
+
</div>
|
|
66
|
+
<span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
|
|
67
|
+
<h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap underline underline-offset-6 decoration-blue-300 decoration-0.5">
|
|
68
|
+
{subsubtitle} <span class="sr-only"> catalog</span>
|
|
69
|
+
</h1>
|
|
70
|
+
</>
|
|
71
|
+
)}
|
|
72
|
+
</>
|
|
73
|
+
) : (
|
|
74
|
+
<h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap">
|
|
75
|
+
{category.name}
|
|
76
|
+
{titleSmall && <small>{titleSmall}</small>}
|
|
77
|
+
<span class="sr-only"> catalog</span>
|
|
78
|
+
</h1>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
83
81
|
</div>
|
|
84
82
|
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
{...viewerLabels}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)}
|
|
83
|
+
{
|
|
84
|
+
showViewToggler && (
|
|
85
|
+
<CategoryViewToggler {...viewerLabels} class="hidden lg:flex items-center gap-2 ml-auto" />
|
|
86
|
+
)
|
|
87
|
+
}
|
|
91
88
|
</div>
|
|
92
89
|
|
|
93
90
|
<script>
|
|
94
91
|
function initializeSidebar() {
|
|
95
92
|
const sidebar = document.getElementById('sidebar');
|
|
96
93
|
const savedState = localStorage.getItem('sidebarState') || 'open';
|
|
97
|
-
|
|
94
|
+
|
|
98
95
|
if (sidebar) {
|
|
99
96
|
sidebar.classList.toggle('collapsed', savedState === 'closed');
|
|
100
97
|
updateTogglers(savedState === 'closed');
|
|
@@ -105,18 +102,18 @@ const baseURL = '';
|
|
|
105
102
|
document.querySelectorAll('.category-sidebar-toggler').forEach(toggler => {
|
|
106
103
|
const expandedIcon = toggler.querySelector('.expanded-icon');
|
|
107
104
|
const collapsedIcon = toggler.querySelector('.collapsed-icon');
|
|
108
|
-
|
|
105
|
+
|
|
109
106
|
if (expandedIcon && collapsedIcon) {
|
|
110
107
|
expandedIcon.classList.toggle('hidden', isCollapsed);
|
|
111
108
|
collapsedIcon.classList.toggle('hidden', !isCollapsed);
|
|
112
109
|
}
|
|
113
110
|
});
|
|
114
111
|
}
|
|
115
|
-
|
|
112
|
+
|
|
116
113
|
function toggleSidebar() {
|
|
117
114
|
const sidebar = document.getElementById('sidebar');
|
|
118
|
-
const isMobile = window.matchMedia(
|
|
119
|
-
|
|
115
|
+
const isMobile = window.matchMedia('(max-width: 768px)').matches;
|
|
116
|
+
|
|
120
117
|
if (sidebar) {
|
|
121
118
|
if (isMobile) {
|
|
122
119
|
const isShown = sidebar.classList.toggle('show');
|
|
@@ -142,7 +139,7 @@ const baseURL = '';
|
|
|
142
139
|
initializeSidebar();
|
|
143
140
|
setupTogglers();
|
|
144
141
|
});
|
|
145
|
-
|
|
142
|
+
|
|
146
143
|
// Preserve state during view transitions
|
|
147
144
|
document.addEventListener('astro:before-swap', () => {
|
|
148
145
|
const sidebarState = localStorage.getItem('sidebarState');
|
|
@@ -150,7 +147,7 @@ const baseURL = '';
|
|
|
150
147
|
sessionStorage.setItem('tempSidebarState', sidebarState);
|
|
151
148
|
}
|
|
152
149
|
});
|
|
153
|
-
|
|
150
|
+
|
|
154
151
|
document.addEventListener('astro:after-swap', () => {
|
|
155
152
|
const tempState = sessionStorage.getItem('tempSidebarState');
|
|
156
153
|
if (tempState) {
|
|
@@ -161,9 +158,8 @@ const baseURL = '';
|
|
|
161
158
|
});
|
|
162
159
|
</script>
|
|
163
160
|
|
|
164
|
-
|
|
165
161
|
<style>
|
|
166
162
|
.toggler-btn {
|
|
167
163
|
@apply md:-mt-0.5;
|
|
168
164
|
}
|
|
169
|
-
</style>
|
|
165
|
+
</style>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a
|
|
3
|
-
:href="href"
|
|
4
|
-
class="category-link"
|
|
5
|
-
:class="{ 'active': active }"
|
|
6
|
-
>
|
|
2
|
+
<a :href="href" class="category-link" :class="{ active: active }">
|
|
7
3
|
{{ text }}
|
|
8
4
|
</a>
|
|
9
5
|
</template>
|
|
@@ -14,16 +10,16 @@ export default {
|
|
|
14
10
|
props: {
|
|
15
11
|
active: {
|
|
16
12
|
type: Boolean,
|
|
17
|
-
default: false
|
|
13
|
+
default: false,
|
|
18
14
|
},
|
|
19
15
|
text: {
|
|
20
16
|
type: String,
|
|
21
|
-
required: true
|
|
17
|
+
required: true,
|
|
22
18
|
},
|
|
23
19
|
href: {
|
|
24
20
|
type: String,
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { Image } from
|
|
2
|
+
import { Image } from 'astro:assets';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
CategoryObject: {
|
|
@@ -33,6 +33,6 @@ const href = `/${prefix}${CategoryObject.slug}/`;
|
|
|
33
33
|
onerror="this.style.display='none';"
|
|
34
34
|
class="cats-img"
|
|
35
35
|
/>
|
|
36
|
-
<div class="swiper-lazy-preloader"
|
|
36
|
+
<div class="swiper-lazy-preloader"></div>
|
|
37
37
|
<div class="cat-name" itemprop="name">{CategoryObject.name}</div>
|
|
38
|
-
</a>
|
|
38
|
+
</a>
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import { Icon } from 'astro-icon/components';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
showText: string;
|
|
6
|
-
listText: string;
|
|
7
|
-
gridText: string;
|
|
5
|
+
showText: string; // "Show:"
|
|
6
|
+
listText: string; // "List"
|
|
7
|
+
gridText: string; // "Grid"
|
|
8
8
|
listAriaLabel: string; // "List view"
|
|
9
9
|
gridAriaLabel: string; // "Grid view"
|
|
10
|
-
class?: string;
|
|
10
|
+
class?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const {
|
|
14
|
-
showText,
|
|
15
|
-
listText,
|
|
16
|
-
gridText,
|
|
17
|
-
listAriaLabel,
|
|
18
|
-
gridAriaLabel,
|
|
19
|
-
class: className
|
|
13
|
+
const {
|
|
14
|
+
showText,
|
|
15
|
+
listText,
|
|
16
|
+
gridText,
|
|
17
|
+
listAriaLabel,
|
|
18
|
+
gridAriaLabel,
|
|
19
|
+
class: className,
|
|
20
20
|
} = Astro.props;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<div class:list={[
|
|
23
|
+
<div class:list={[className]}>
|
|
24
24
|
<span class="text-slate-default text-sm">{showText}</span>
|
|
25
25
|
<div class="flex border rounded">
|
|
26
|
-
<button
|
|
26
|
+
<button
|
|
27
27
|
data-view="list"
|
|
28
28
|
data-view-toggle
|
|
29
29
|
class="view-toggle flex items-center gap-1 px-3 py-0.5 transition-colors"
|
|
@@ -32,7 +32,7 @@ const {
|
|
|
32
32
|
<Icon name="ant-design:bars-outlined" class="w-4 h-4" />
|
|
33
33
|
<span class="text-sm">{listText}</span>
|
|
34
34
|
</button>
|
|
35
|
-
<button
|
|
35
|
+
<button
|
|
36
36
|
data-view="grid"
|
|
37
37
|
data-view-toggle
|
|
38
38
|
class="view-toggle flex items-center gap-1 px-3 py-0.5 transition-colors"
|
|
@@ -48,7 +48,7 @@ const {
|
|
|
48
48
|
function initializeView() {
|
|
49
49
|
const savedView = localStorage.getItem('categoryView') || 'list';
|
|
50
50
|
updateUI(savedView);
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
// Clean up existing listeners to prevent duplicates
|
|
53
53
|
document.querySelectorAll('[data-view-toggle]').forEach(btn => {
|
|
54
54
|
btn.removeEventListener('click', handleViewToggle);
|
|
@@ -59,7 +59,7 @@ const {
|
|
|
59
59
|
function handleViewToggle(e: Event) {
|
|
60
60
|
const button = e.currentTarget as HTMLElement;
|
|
61
61
|
if (!button?.dataset.view) return;
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
const view = button.dataset.view;
|
|
64
64
|
localStorage.setItem('categoryView', view);
|
|
65
65
|
updateUI(view);
|
|
@@ -69,7 +69,7 @@ const {
|
|
|
69
69
|
window.dataLayer.push({
|
|
70
70
|
event: 'view_style_change',
|
|
71
71
|
viewType: view,
|
|
72
|
-
category: window.location.pathname
|
|
72
|
+
category: window.location.pathname,
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -87,4 +87,4 @@ const {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
document.addEventListener('astro:page-load', initializeView);
|
|
90
|
-
</script>
|
|
90
|
+
</script>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
defineProps<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}>()
|
|
3
|
+
text: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
}>();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
<component
|
|
10
|
+
:is="active ? 'div' : 'a'"
|
|
11
|
+
:class="[
|
|
12
|
+
'w-full block text-base font-medium py-2 pl-6 pr-2 hover:(bg-gray-50 sm:bg-inherit)',
|
|
13
|
+
'sm:(w-auto text-sm pr-3) md:(py-0.5 pr-4)',
|
|
14
|
+
active ? 's-active' : 'text-gray-400',
|
|
15
|
+
]"
|
|
16
|
+
>
|
|
17
|
+
{{ text }}
|
|
18
|
+
</component>
|
|
19
19
|
</template>
|
package/src/components/Faq.astro
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
2
|
/*
|
|
4
3
|
FAQ component for questons & answers with structured microdata for rich snippets
|
|
5
4
|
https://developers.google.com/search/docs/appearance/structured-data/faqpage?hl=en
|
|
6
5
|
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
import FaqItem from
|
|
8
|
+
import FaqItem from '../components/FaqItem.astro';
|
|
10
9
|
|
|
11
10
|
interface Props {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
question: string;
|
|
11
|
+
questions: {
|
|
12
|
+
question: string;
|
|
15
13
|
answer: string;
|
|
16
|
-
|
|
14
|
+
}[];
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
const { questions } = Astro.props
|
|
17
|
+
const { questions } = Astro.props;
|
|
20
18
|
---
|
|
21
19
|
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
+
>
|
|
25
|
+
<div class="mb-6 text-4xl font-headbold sm:text-4xl text-blue-802 faq-heading">
|
|
26
|
+
Frequently Asked Questions
|
|
27
|
+
</div>
|
|
28
|
+
<div class="flex flex-col divide-y dark:divide-gray-700">
|
|
29
|
+
{questions.map(question => <FaqItem data={question} />)}
|
|
30
|
+
</div>
|
|
32
31
|
</div>
|