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.
Files changed (113) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.github/workflows/code-quality.yml +3 -3
  3. package/.prettierrc +1 -0
  4. package/CHANGELOG.md +12 -0
  5. package/package.json +8 -2
  6. package/src/MyComponent.astro +1 -1
  7. package/src/components/Badge.vue +2 -2
  8. package/src/components/Badges.vue +17 -7
  9. package/src/components/Breadcrumbs.vue +47 -39
  10. package/src/components/Button.vue +31 -30
  11. package/src/components/ButtonCopy.astro +12 -17
  12. package/src/components/ButtonCopy.vue +26 -25
  13. package/src/components/Card.astro +4 -6
  14. package/src/components/Carousel.astro +4 -4
  15. package/src/components/Category/CategoriesCarousel.astro +75 -75
  16. package/src/components/Category/CategoryDetails.astro +75 -79
  17. package/src/components/Category/CategoryLink.vue +8 -12
  18. package/src/components/Category/CategorySidebarToggler.vue +2 -7
  19. package/src/components/Category/CategoryTile.astro +3 -3
  20. package/src/components/Category/CategoryViewToggler.astro +18 -18
  21. package/src/components/Category/SubCategoryLink.vue +13 -13
  22. package/src/components/Faq.astro +16 -17
  23. package/src/components/FaqItem.astro +27 -27
  24. package/src/components/FeaturesList.vue +19 -29
  25. package/src/components/FuckRussia.vue +40 -27
  26. package/src/components/HandDrive.astro +11 -15
  27. package/src/components/Header/Header.astro +165 -166
  28. package/src/components/Header/SkipToContent.astro +1 -1
  29. package/src/components/Headline.vue +44 -27
  30. package/src/components/Image.astro +5 -7
  31. package/src/components/Input.vue +143 -153
  32. package/src/components/Jumbotron/index.astro +143 -156
  33. package/src/components/Jumbotron/types.ts +28 -29
  34. package/src/components/Jumbotron/variants/Default.astro +44 -40
  35. package/src/components/Jumbotron/variants/Hero.astro +45 -53
  36. package/src/components/Jumbotron/variants/Post.astro +68 -64
  37. package/src/components/Jumbotron/variants/PostSplit.astro +89 -81
  38. package/src/components/Jumbotron.astro +12 -12
  39. package/src/components/LanguageSuggestion.astro +66 -69
  40. package/src/components/LeftSidebar.astro +10 -10
  41. package/src/components/MainColors.vue +2 -2
  42. package/src/components/MainInput.vue +6 -3
  43. package/src/components/Modal.astro +2 -2
  44. package/src/components/PartNumber.vue +2 -3
  45. package/src/components/Post/PostCategories.astro +2 -4
  46. package/src/components/Post/PostCategories.vue +2 -2
  47. package/src/components/PostHeader.astro +4 -6
  48. package/src/components/PrCode.vue +20 -19
  49. package/src/components/Product/ProductButton.vue +2 -5
  50. package/src/components/Product/ProductCarousel.astro +38 -27
  51. package/src/components/Product/ProductColors.vue +46 -42
  52. package/src/components/Product/ProductDetailName.vue +22 -22
  53. package/src/components/Product/ProductDetails.vue +115 -99
  54. package/src/components/Product/ProductDoc.vue +27 -25
  55. package/src/components/Product/ProductEngineType.vue +13 -10
  56. package/src/components/Product/ProductImage.astro +18 -19
  57. package/src/components/Product/ProductLink.astro +78 -57
  58. package/src/components/Product/ProductLink.vue +55 -58
  59. package/src/components/Product/ProductLinkInfo.astro +15 -18
  60. package/src/components/Product/ProductModel.vue +25 -24
  61. package/src/components/Product/ProductModels.vue +29 -33
  62. package/src/components/Product/ProductName.vue +15 -15
  63. package/src/components/Product/ProductNumber.astro +23 -31
  64. package/src/components/Product/ProductPositions.vue +32 -34
  65. package/src/components/ProductCarousel.astro +5 -5
  66. package/src/components/ProductCodes.vue +12 -14
  67. package/src/components/ProductDetailName.vue +18 -20
  68. package/src/components/ProductDetailsList.vue +48 -27
  69. package/src/components/ProductTile.astro +40 -36
  70. package/src/components/Quote.vue +8 -6
  71. package/src/components/ReloadPrompt.astro +39 -47
  72. package/src/components/SlimBanner.vue +44 -19
  73. package/src/components/Table.vue +4 -6
  74. package/src/components/Translations.vue +17 -8
  75. package/src/components/flags/FlagPL.vue +4 -3
  76. package/src/components/flags/FlagUA.vue +2 -2
  77. package/src/components/layout/CallToAction.astro +17 -12
  78. package/src/components/layout/Container.astro +3 -1
  79. package/src/components/layout/Header.astro +12 -21
  80. package/src/config.ts +43 -43
  81. package/src/design.config.ts +63 -63
  82. package/src/env.d.ts +4 -4
  83. package/src/layouts/Layout.astro +10 -19
  84. package/src/layouts/MainLayout.astro +13 -19
  85. package/src/layouts/partials/FooterCommon.astro +2 -2
  86. package/src/layouts/partials/HeadCommon.astro +9 -9
  87. package/src/layouts/partials/HeadSEO.astro +12 -5
  88. package/src/pages/components/icons.astro +130 -121
  89. package/src/pages/core/shadows.astro +18 -11
  90. package/src/pages/core/typography.astro +36 -36
  91. package/src/pages/index.astro +178 -75
  92. package/src/pwa.ts +4 -4
  93. package/src/styles/base/base.css +14 -19
  94. package/src/styles/base/grid.css +54 -58
  95. package/src/styles/base/typography.css +40 -40
  96. package/src/styles/content.css +25 -23
  97. package/src/styles/main.css +5 -6
  98. package/src/types/Product.ts +31 -31
  99. package/src/types/astro.d.ts +1 -1
  100. package/src/types/index.ts +234 -237
  101. package/src/utils/api/getCategories.ts +9 -9
  102. package/src/utils/category/getMainCategoryList.ts +22 -22
  103. package/src/utils/category/getSortedCategories.ts +7 -11
  104. package/src/utils/product/getPriceFormatted.ts +14 -11
  105. package/src/utils/product/getProductChecklist.ts +10 -11
  106. package/src/utils/product/useFormatProductNumber.ts +18 -9
  107. package/src/utils/seo/getShorterDescription.ts +6 -4
  108. package/src/utils/text/formatDate.ts +2 -3
  109. package/src/utils/text/formatLocaleNumber.ts +2 -2
  110. package/src/utils/text/formatPad.ts +2 -2
  111. package/src/utils/text/getNumberFormatted.ts +10 -10
  112. package/src/utils/text/getTranslatedLink.ts +3 -3
  113. 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 "@utils/text/getTranslatedLink"
5
- import { getMainCategoryList } from "@utils/category/getMainCategoryList"
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 = activeCategorySlug && categories ? categories.map(a => a.slug).findIndex(e => e === activeCategorySlug) : 0
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
- <swiper-container
20
- class={`categories-carousel flex pb-1 sm:pb-0 bg-white cat-menu ${className ? className : ''}`}
21
- data-pagefind-ignore
22
- itemscope itemtype="https://schema.org/SiteNavigationElement"
23
- transition:persist={`catcarousel${activeIndex}`}
24
- transition:animate="none"
25
- data-active={activeIndex}
26
- initial-slide={activeIndex}
27
- space-between="0"
28
- slides-per-view="auto"
29
- scrollbar="true"
30
- draggable="true"
31
- keyboard
32
- free-mode
33
- data-off-observer
34
- run-callbacks-on-init="false"
35
- >
36
- {
37
- categories.map((category, index) => (
38
- <swiper-slide itemprop="hasPart" role="presentation"
39
- class={`swiper-slide cats-slide group ${category.slug === activeCategorySlug ? 'active': ''}`}
40
- >
41
- <a href={getTranslatedLink(`/${category.slug}/`)}
42
- class="carousel-item"
43
- >
44
- {
45
- // itemprop="url"
46
- // role="menuitem"
47
- // aria-label={ t(`cat.${category.slug}.name`) }
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
- <Image
51
- src={`${imgDomain}${category.photo}`}
52
- alt={category.name}
53
- height="70"
54
- width="70"
55
- format="avif"
56
- loading="eager"
57
- onerror="this.style.display='none';"
58
- class="cats-img"
59
- />
60
- <div class="swiper-lazy-preloader"></div>
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
- </swiper-container>
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
- @apply bg-blue-darker text-white bg-opacity-100;
77
+ <style>
78
+ .active {
79
+ @apply bg-blue-darker text-white bg-opacity-100;
78
80
 
79
- &:not(:hover) .cats-img {
80
- filter: invert(100%);
81
- /* // @apply filter-invert; */
81
+ &:not(:hover) .cats-img {
82
+ filter: invert(100%);
83
+ /* // @apply filter-invert; */
84
+ }
82
85
  }
83
-
84
- }
85
86
 
86
- .categories-carousel {
87
- @apply overflow-hidden;
87
+ .categories-carousel {
88
+ @apply overflow-hidden;
88
89
 
89
- &.swiper-initialized {
90
- .img-preloader {
91
- display: none;
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
- <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
42
- name="ant-design:menu-outlined"
43
- class="toggler-btn w-6"
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
- {subtitle ? (
52
- <>
53
- <a class="text-lg font-vw-headregular whitespace-nowrap block" href={`${baseURL}/${category.slug}/`}>
54
- {category.name}
55
- {titleSmall && <small>{titleSmall}</small>}
56
- </a>
57
- <span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
58
- {!subsubtitle ? (
59
- <h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap underline underline-offset-6 decoration-blue-300 decoration-0.5">
60
- {subtitle} <span class="sr-only"> catalog</span>
61
- </h1>
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
- {subsubtitle} <span class="sr-only"> catalog</span>
59
+ {subtitle} <span class="sr-only"> catalog</span>
72
60
  </h1>
73
- </>
74
- )}
75
- </>
76
- ) : (
77
- <h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap">
78
- {category.name}
79
- {titleSmall && <small>{titleSmall}</small>}
80
- <span class="sr-only"> catalog</span>
81
- </h1>
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
- {showViewToggler && (
86
- <CategoryViewToggler
87
- {...viewerLabels}
88
- class="hidden lg:flex items-center gap-2 ml-auto"
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("(max-width: 768px)").matches;
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,10 +1,5 @@
1
-
2
1
  <template>
3
- <button
4
- class="category-toggler md:w-8"
5
- type="button"
6
- aria-label="toggle menu"
7
- >
2
+ <button class="category-toggler md:w-8" type="button" aria-label="toggle menu">
8
3
  <slot />
9
4
  </button>
10
- </template>
5
+ </template>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { Image } from "astro:assets";
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; // "Show:"
6
- listText: string; // "List"
7
- gridText: string; // "Grid"
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={[ className ]}>
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
- text: string
4
- active: boolean
5
- }>()
3
+ text: string;
4
+ active: boolean;
5
+ }>();
6
6
  </script>
7
7
 
8
8
  <template>
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>
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>
@@ -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 "../components/FaqItem.astro"
8
+ import FaqItem from '../components/FaqItem.astro';
10
9
 
11
10
  interface Props {
12
-
13
- questions: {
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 class="flex flex-col mt-6 mb-4 w-full px-4 md:px-0" itemscope itemtype="https://schema.org/FAQPage" >
23
- <div class="mb-6 text-4xl font-headbold sm:text-4xl text-blue-802 faq-heading">
24
- Frequently Asked Questions
25
- </div>
26
- <div class="flex flex-col divide-y dark:divide-gray-700">
27
- {
28
- questions.map((question) =>
29
- <FaqItem data={question} />)
30
- }
31
- </div>
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>