spoko-design-system 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +2 -1
- package/.github/workflows/code-quality.yml +3 -3
- package/.prettierrc +1 -0
- package/CHANGELOG.md +12 -0
- package/package.json +8 -2
- package/src/MyComponent.astro +1 -1
- package/src/components/Badge.vue +2 -2
- package/src/components/Badges.vue +17 -7
- package/src/components/Breadcrumbs.vue +47 -39
- package/src/components/Button.vue +31 -30
- package/src/components/ButtonCopy.astro +12 -17
- package/src/components/ButtonCopy.vue +26 -25
- package/src/components/Card.astro +4 -6
- package/src/components/Carousel.astro +4 -4
- package/src/components/Category/CategoriesCarousel.astro +75 -75
- package/src/components/Category/CategoryDetails.astro +75 -79
- package/src/components/Category/CategoryLink.vue +8 -12
- package/src/components/Category/CategorySidebarToggler.vue +2 -7
- package/src/components/Category/CategoryTile.astro +3 -3
- package/src/components/Category/CategoryViewToggler.astro +18 -18
- package/src/components/Category/SubCategoryLink.vue +13 -13
- package/src/components/Faq.astro +16 -17
- package/src/components/FaqItem.astro +27 -27
- package/src/components/FeaturesList.vue +19 -29
- package/src/components/FuckRussia.vue +40 -27
- package/src/components/HandDrive.astro +11 -15
- package/src/components/Header/Header.astro +165 -166
- package/src/components/Header/SkipToContent.astro +1 -1
- package/src/components/Headline.vue +44 -27
- package/src/components/Image.astro +5 -7
- package/src/components/Input.vue +143 -153
- package/src/components/Jumbotron/index.astro +143 -156
- package/src/components/Jumbotron/types.ts +28 -29
- package/src/components/Jumbotron/variants/Default.astro +44 -40
- package/src/components/Jumbotron/variants/Hero.astro +45 -53
- package/src/components/Jumbotron/variants/Post.astro +68 -64
- package/src/components/Jumbotron/variants/PostSplit.astro +89 -81
- package/src/components/Jumbotron.astro +12 -12
- package/src/components/LanguageSuggestion.astro +66 -69
- package/src/components/LeftSidebar.astro +10 -10
- package/src/components/MainColors.vue +2 -2
- package/src/components/MainInput.vue +6 -3
- package/src/components/Modal.astro +2 -2
- package/src/components/PartNumber.vue +2 -3
- package/src/components/Post/PostCategories.astro +2 -4
- package/src/components/Post/PostCategories.vue +2 -2
- package/src/components/PostHeader.astro +4 -6
- package/src/components/PrCode.vue +20 -19
- package/src/components/Product/ProductButton.vue +2 -5
- package/src/components/Product/ProductCarousel.astro +38 -27
- package/src/components/Product/ProductColors.vue +46 -42
- package/src/components/Product/ProductDetailName.vue +22 -22
- package/src/components/Product/ProductDetails.vue +115 -99
- package/src/components/Product/ProductDoc.vue +27 -25
- package/src/components/Product/ProductEngineType.vue +13 -10
- package/src/components/Product/ProductImage.astro +18 -19
- package/src/components/Product/ProductLink.astro +78 -57
- package/src/components/Product/ProductLink.vue +55 -58
- package/src/components/Product/ProductLinkInfo.astro +15 -18
- package/src/components/Product/ProductModel.vue +25 -24
- package/src/components/Product/ProductModels.vue +29 -33
- package/src/components/Product/ProductName.vue +15 -15
- package/src/components/Product/ProductNumber.astro +23 -31
- package/src/components/Product/ProductPositions.vue +32 -34
- package/src/components/ProductCarousel.astro +5 -5
- package/src/components/ProductCodes.vue +12 -14
- package/src/components/ProductDetailName.vue +18 -20
- package/src/components/ProductDetailsList.vue +48 -27
- package/src/components/ProductTile.astro +40 -36
- package/src/components/Quote.vue +8 -6
- package/src/components/ReloadPrompt.astro +39 -47
- package/src/components/SlimBanner.vue +44 -19
- package/src/components/Table.vue +4 -6
- package/src/components/Translations.vue +17 -8
- package/src/components/flags/FlagPL.vue +4 -3
- package/src/components/flags/FlagUA.vue +2 -2
- package/src/components/layout/CallToAction.astro +17 -12
- package/src/components/layout/Container.astro +3 -1
- package/src/components/layout/Header.astro +12 -21
- package/src/config.ts +43 -43
- package/src/design.config.ts +63 -63
- package/src/env.d.ts +4 -4
- package/src/layouts/Layout.astro +10 -19
- package/src/layouts/MainLayout.astro +13 -19
- package/src/layouts/partials/FooterCommon.astro +2 -2
- package/src/layouts/partials/HeadCommon.astro +9 -9
- package/src/layouts/partials/HeadSEO.astro +12 -5
- package/src/pages/components/icons.astro +130 -121
- package/src/pages/core/shadows.astro +18 -11
- package/src/pages/core/typography.astro +36 -36
- package/src/pages/index.astro +178 -75
- package/src/pwa.ts +4 -4
- package/src/styles/base/base.css +14 -19
- package/src/styles/base/grid.css +54 -58
- package/src/styles/base/typography.css +40 -40
- package/src/styles/content.css +25 -23
- package/src/styles/main.css +5 -6
- package/src/types/Product.ts +31 -31
- package/src/types/astro.d.ts +1 -1
- package/src/types/index.ts +234 -237
- package/src/utils/api/getCategories.ts +9 -9
- package/src/utils/category/getMainCategoryList.ts +22 -22
- package/src/utils/category/getSortedCategories.ts +7 -11
- package/src/utils/product/getPriceFormatted.ts +14 -11
- package/src/utils/product/getProductChecklist.ts +10 -11
- package/src/utils/product/useFormatProductNumber.ts +18 -9
- package/src/utils/seo/getShorterDescription.ts +6 -4
- package/src/utils/text/formatDate.ts +2 -3
- package/src/utils/text/formatLocaleNumber.ts +2 -2
- package/src/utils/text/formatPad.ts +2 -2
- package/src/utils/text/getNumberFormatted.ts +10 -10
- package/src/utils/text/getTranslatedLink.ts +3 -3
- package/src/utils/text.ts +11 -8
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
---
|
|
2
|
-
// variants/Post.astro
|
|
3
|
-
import type { Author, Category } from '../types';
|
|
4
|
-
import PostCategories from
|
|
5
|
-
import Date from
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
title?: string;
|
|
9
|
-
image?: string;
|
|
10
|
-
author?: Author;
|
|
11
|
-
date?: string;
|
|
12
|
-
categories?: Category[];
|
|
13
|
-
hasMetadata: boolean;
|
|
14
|
-
hasCategories: boolean;
|
|
15
|
-
lang?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
title =
|
|
20
|
-
image,
|
|
21
|
-
author,
|
|
22
|
-
date,
|
|
23
|
-
categories = [],
|
|
24
|
-
hasMetadata,
|
|
25
|
-
hasCategories,
|
|
26
|
-
lang = 'en'
|
|
27
|
-
} = Astro.props;
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
<header class="post-header pt-11 w-full justify-center text-white z-2 bg-blue-darkest relative">
|
|
31
|
-
<div class="heading text-white relative flex items-center justify-center mt-auto w-full z-[2]">
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</div>
|
|
64
|
-
|
|
1
|
+
---
|
|
2
|
+
// variants/Post.astro
|
|
3
|
+
import type { Author, Category } from '../types';
|
|
4
|
+
import PostCategories from '../../Post/PostCategories.astro';
|
|
5
|
+
import Date from '../../Date.astro';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
title?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
author?: Author;
|
|
11
|
+
date?: string;
|
|
12
|
+
categories?: Category[];
|
|
13
|
+
hasMetadata: boolean;
|
|
14
|
+
hasCategories: boolean;
|
|
15
|
+
lang?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
title = '',
|
|
20
|
+
image,
|
|
21
|
+
author,
|
|
22
|
+
date,
|
|
23
|
+
categories = [],
|
|
24
|
+
hasMetadata,
|
|
25
|
+
hasCategories,
|
|
26
|
+
lang = 'en',
|
|
27
|
+
} = Astro.props;
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<header class="post-header pt-11 w-full justify-center text-white z-2 bg-blue-darkest relative">
|
|
31
|
+
<div class="heading text-white relative flex items-center justify-center mt-auto w-full z-[2]">
|
|
32
|
+
<div
|
|
33
|
+
class="w-full sm:max-w-[640px] md:max-w-3xl lg:max-w-5xl xl:max-w-7xl 2xl:max-w-[1536px] px-4 py-5 flex flex-col flex-wrap"
|
|
34
|
+
>
|
|
35
|
+
<h1
|
|
36
|
+
class="font-headlight text-2xl mb-1 sm:text-3xl md:(text-4xl mb-3) xl:text-6xl mt-1 order-2 line-clamp-3 pb-1"
|
|
37
|
+
>
|
|
38
|
+
{title}
|
|
39
|
+
</h1>
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
hasCategories && (
|
|
43
|
+
<div class="order-1">
|
|
44
|
+
<PostCategories categories={categories} lang={lang} />
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
{
|
|
50
|
+
hasMetadata && (
|
|
51
|
+
<div class="order-3 flex items-center text-gray-100">
|
|
52
|
+
{author && (
|
|
53
|
+
<span class="text-sm" title={author.firstName}>
|
|
54
|
+
{author.name}
|
|
55
|
+
</span>
|
|
56
|
+
)}
|
|
57
|
+
{author && date && <span class="mx-1">-</span>}
|
|
58
|
+
{date && <Date date={date} />}
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="featured-image-overlay">
|
|
66
|
+
<img src={image} alt={title} class="w-full h-full object-cover block max-w-full" />
|
|
67
|
+
</div>
|
|
68
|
+
</header>
|
|
@@ -1,81 +1,89 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { Author, Category } from '../types';
|
|
3
|
-
import PostCategories from
|
|
4
|
-
import Date from
|
|
5
|
-
import { Image } from
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
title?: string;
|
|
9
|
-
image?: string;
|
|
10
|
-
author?: Author;
|
|
11
|
-
date?: string;
|
|
12
|
-
categories?: Category[];
|
|
13
|
-
hasMetadata: boolean;
|
|
14
|
-
hasCategories: boolean;
|
|
15
|
-
lang: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
title =
|
|
20
|
-
image,
|
|
21
|
-
author,
|
|
22
|
-
date,
|
|
23
|
-
categories = [],
|
|
24
|
-
hasMetadata,
|
|
25
|
-
hasCategories,
|
|
26
|
-
lang='en'
|
|
27
|
-
} = Astro.props;
|
|
28
|
-
|
|
29
|
-
// Helper function to remove HTML tags
|
|
30
|
-
const stripHtml = (html: string) => {
|
|
31
|
-
return html.replace(/<[^>]*>/g, '');
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// Get clean title for alt attribute
|
|
35
|
-
const cleanTitle = stripHtml(title);
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
<div class="jumbotron-split-wrapper bg-blue-900 bg-vw">
|
|
39
|
-
<div class="jumbotron-split-container">
|
|
40
|
-
<header class="jumbotron-split-header">
|
|
41
|
-
<div
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
---
|
|
2
|
+
import type { Author, Category } from '../types';
|
|
3
|
+
import PostCategories from '../../Post/PostCategories.astro';
|
|
4
|
+
import Date from '../../Date.astro';
|
|
5
|
+
import { Image } from 'astro:assets';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
title?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
author?: Author;
|
|
11
|
+
date?: string;
|
|
12
|
+
categories?: Category[];
|
|
13
|
+
hasMetadata: boolean;
|
|
14
|
+
hasCategories: boolean;
|
|
15
|
+
lang: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
title = '',
|
|
20
|
+
image,
|
|
21
|
+
author,
|
|
22
|
+
date,
|
|
23
|
+
categories = [],
|
|
24
|
+
hasMetadata,
|
|
25
|
+
hasCategories,
|
|
26
|
+
lang = 'en',
|
|
27
|
+
} = Astro.props;
|
|
28
|
+
|
|
29
|
+
// Helper function to remove HTML tags
|
|
30
|
+
const stripHtml = (html: string) => {
|
|
31
|
+
return html.replace(/<[^>]*>/g, '');
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Get clean title for alt attribute
|
|
35
|
+
const cleanTitle = stripHtml(title);
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<div class="jumbotron-split-wrapper bg-blue-900 bg-vw">
|
|
39
|
+
<div class="jumbotron-split-container">
|
|
40
|
+
<header class="jumbotron-split-header">
|
|
41
|
+
<div
|
|
42
|
+
class="heading flex flex-wrap text-white relative items-center justify-center mt-auto w-full z-[2]"
|
|
43
|
+
>
|
|
44
|
+
<div class="jumbotron-split-content">
|
|
45
|
+
<h1 class="jumbotron-split-title" set:html={title} />
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
hasCategories && (
|
|
49
|
+
<div class="jumbotron-categories">
|
|
50
|
+
<PostCategories categories={categories} lang={lang} />
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
hasMetadata && (
|
|
57
|
+
<div class="jumbotron-split-meta">
|
|
58
|
+
{author && (
|
|
59
|
+
<span class="text-sm" title={author.firstName} data-pagefind-ignore>
|
|
60
|
+
{author.name}
|
|
61
|
+
</span>
|
|
62
|
+
)}
|
|
63
|
+
{author && date && <span class="mx-1">-</span>}
|
|
64
|
+
{date && <Date date={date} />}
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
{
|
|
72
|
+
image && (
|
|
73
|
+
<div class="jumbotron-split-image-wrapper">
|
|
74
|
+
<div class="jumbotron-split-image">
|
|
75
|
+
<Image
|
|
76
|
+
class="jumbotron-split-img"
|
|
77
|
+
src={image}
|
|
78
|
+
alt={cleanTitle}
|
|
79
|
+
width={768}
|
|
80
|
+
height={432}
|
|
81
|
+
loading="eager"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
</header>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { Props } from
|
|
3
|
-
import BaseJumbotron from
|
|
4
|
-
|
|
5
|
-
const props = Astro.props as Props;
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<BaseJumbotron {...props}>
|
|
9
|
-
<slot name="intro" slot="intro" />
|
|
10
|
-
<slot name="subtitle" slot="subtitle" />
|
|
11
|
-
<slot name="cta-content" slot="cta-content" />
|
|
12
|
-
</BaseJumbotron>
|
|
1
|
+
---
|
|
2
|
+
import type { Props } from './Jumbotron/types';
|
|
3
|
+
import BaseJumbotron from './Jumbotron/index.astro';
|
|
4
|
+
|
|
5
|
+
const props = Astro.props as Props;
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<BaseJumbotron {...props}>
|
|
9
|
+
<slot name="intro" slot="intro" />
|
|
10
|
+
<slot name="subtitle" slot="subtitle" />
|
|
11
|
+
<slot name="cta-content" slot="cta-content" />
|
|
12
|
+
</BaseJumbotron>
|
|
@@ -1,69 +1,66 @@
|
|
|
1
|
-
---
|
|
2
|
-
// components/LanguageSuggestion.astro
|
|
3
|
-
interface Props {
|
|
4
|
-
position?: 'top' | 'bottom';
|
|
5
|
-
className?: string;
|
|
6
|
-
customPath?: string;
|
|
7
|
-
dismissTimeout?: number; // Auto-dismiss after X ms
|
|
8
|
-
showIcon?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
position = 'bottom',
|
|
13
|
-
className = '',
|
|
14
|
-
customPath,
|
|
15
|
-
dismissTimeout,
|
|
16
|
-
showIcon = true
|
|
17
|
-
} = Astro.props;
|
|
18
|
-
|
|
19
|
-
const currentLocale = Astro.currentLocale;
|
|
20
|
-
const preferredLocale = Astro.preferredLocale;
|
|
21
|
-
|
|
22
|
-
const targetPath = customPath
|
|
23
|
-
? `/${preferredLocale}${customPath}`
|
|
24
|
-
: `/${preferredLocale}${Astro.url.pathname}`;
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
<div
|
|
28
|
-
id="languageSuggestion"
|
|
29
|
-
class:list={[
|
|
30
|
-
'fixed right-4 bg-white shadow-lg p-4 rounded-lg hidden transition-opacity duration-300',
|
|
31
|
-
position === 'top' ? 'top-4' : 'bottom-4',
|
|
32
|
-
className
|
|
33
|
-
]}
|
|
34
|
-
role="alert"
|
|
35
|
-
>
|
|
36
|
-
<a
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
</script>
|
|
1
|
+
---
|
|
2
|
+
// components/LanguageSuggestion.astro
|
|
3
|
+
interface Props {
|
|
4
|
+
position?: 'top' | 'bottom';
|
|
5
|
+
className?: string;
|
|
6
|
+
customPath?: string;
|
|
7
|
+
dismissTimeout?: number; // Auto-dismiss after X ms
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
position = 'bottom',
|
|
13
|
+
className = '',
|
|
14
|
+
customPath,
|
|
15
|
+
dismissTimeout,
|
|
16
|
+
showIcon = true,
|
|
17
|
+
} = Astro.props;
|
|
18
|
+
|
|
19
|
+
const currentLocale = Astro.currentLocale;
|
|
20
|
+
const preferredLocale = Astro.preferredLocale;
|
|
21
|
+
|
|
22
|
+
const targetPath = customPath
|
|
23
|
+
? `/${preferredLocale}${customPath}`
|
|
24
|
+
: `/${preferredLocale}${Astro.url.pathname}`;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
id="languageSuggestion"
|
|
29
|
+
class:list={[
|
|
30
|
+
'fixed right-4 bg-white shadow-lg p-4 rounded-lg hidden transition-opacity duration-300',
|
|
31
|
+
position === 'top' ? 'top-4' : 'bottom-4',
|
|
32
|
+
className,
|
|
33
|
+
]}
|
|
34
|
+
role="alert"
|
|
35
|
+
>
|
|
36
|
+
<a href={targetPath} class="flex items-center gap-2 font-medium hover:underline">
|
|
37
|
+
{showIcon && <span class="material-icons-outlined text-sm">translate</span>}
|
|
38
|
+
{new Intl.DisplayNames([preferredLocale], { type: 'language' }).of(preferredLocale)}
|
|
39
|
+
</a>
|
|
40
|
+
<button
|
|
41
|
+
class="absolute top-1.5 right-1.5 p-1 opacity-60 hover:opacity-100 transition-opacity"
|
|
42
|
+
aria-label="Dismiss"
|
|
43
|
+
onclick="this.parentElement.remove(); localStorage.setItem('languageSuggestDenied', true);"
|
|
44
|
+
>
|
|
45
|
+
✕
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<script define:vars={{ currentLocale, preferredLocale, dismissTimeout }}>
|
|
50
|
+
const shouldShow =
|
|
51
|
+
preferredLocale &&
|
|
52
|
+
preferredLocale !== currentLocale &&
|
|
53
|
+
!localStorage.getItem('languageSuggestDenied');
|
|
54
|
+
|
|
55
|
+
if (shouldShow) {
|
|
56
|
+
const popup = document.getElementById('languageSuggestion');
|
|
57
|
+
popup?.classList.remove('hidden');
|
|
58
|
+
|
|
59
|
+
if (dismissTimeout) {
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
popup?.classList.add('opacity-0');
|
|
62
|
+
setTimeout(() => popup?.remove(), 300);
|
|
63
|
+
}, dismissTimeout);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { SIDEBAR } from
|
|
3
|
-
import { Astronav, MenuItems } from
|
|
2
|
+
import { SIDEBAR } from '../config';
|
|
3
|
+
import { Astronav, MenuItems } from 'astro-navbar';
|
|
4
4
|
const { currentPage } = Astro.props;
|
|
5
5
|
const currentPageMatch = currentPage.slice(1);
|
|
6
6
|
|
|
7
|
-
const isCurrentPage =
|
|
7
|
+
const isCurrentPage = item => {
|
|
8
8
|
if (item.link) {
|
|
9
9
|
return item.link.includes(currentPageMatch);
|
|
10
10
|
}
|
|
11
11
|
return false;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const getLinkClasses =
|
|
14
|
+
const getLinkClasses = link => {
|
|
15
15
|
const baseClasses =
|
|
16
|
-
|
|
16
|
+
'block py-1.5 px-6 my-1 transition-colors border-l hover:border-slate-400 text-slate-500 hover:text-slate-900';
|
|
17
17
|
|
|
18
18
|
if (isCurrentPage(link)) {
|
|
19
|
-
return baseClasses +
|
|
19
|
+
return baseClasses + ' border-slate-500 text-slate-900';
|
|
20
20
|
} else {
|
|
21
21
|
return baseClasses;
|
|
22
22
|
}
|
|
@@ -29,14 +29,14 @@ const getLinkClasses = (link) => {
|
|
|
29
29
|
>
|
|
30
30
|
<ul class="mt-0 mb-auto">
|
|
31
31
|
{
|
|
32
|
-
SIDEBAR.map(
|
|
32
|
+
SIDEBAR.map(item =>
|
|
33
33
|
item.header ? (
|
|
34
34
|
<h2 class="mt-4 font-semibold text-slate-700">{item.text}</h2>
|
|
35
35
|
) : (
|
|
36
36
|
<li class={getLinkClasses(item)}>
|
|
37
37
|
<a href={item.link}>{item.text}</a>
|
|
38
38
|
</li>
|
|
39
|
-
)
|
|
39
|
+
)
|
|
40
40
|
)
|
|
41
41
|
}
|
|
42
42
|
</ul>
|
|
@@ -44,10 +44,10 @@ const getLinkClasses = (link) => {
|
|
|
44
44
|
</Astronav>
|
|
45
45
|
|
|
46
46
|
<script is:inline>
|
|
47
|
-
window.addEventListener(
|
|
47
|
+
window.addEventListener('DOMContentLoaded', event => {
|
|
48
48
|
var target = document.querySelector('[aria-current="page"]');
|
|
49
49
|
if (target && target.offsetTop > window.innerHeight - 100) {
|
|
50
|
-
document.querySelector(
|
|
50
|
+
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { colors } from
|
|
2
|
+
import { colors } from './../../uno-config/theme/colors';
|
|
3
3
|
|
|
4
4
|
// Get color categories
|
|
5
5
|
const colorCategories = Object.entries(colors);
|
|
@@ -20,4 +20,4 @@ const colorCategories = Object.entries(colors);
|
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
|
-
</template>
|
|
23
|
+
</template>
|
|
@@ -6,10 +6,13 @@ const props = defineProps<{
|
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
8
|
<label class="group text-left w-full max-w-xs flex flex-col">
|
|
9
|
-
<span
|
|
10
|
-
|
|
9
|
+
<span
|
|
10
|
+
class="group-hover:text-blue-medium ml-2 text-slate-600 text-sm group-focus-within:text-blue-medium"
|
|
11
|
+
>{{ label }}</span
|
|
12
|
+
>
|
|
11
13
|
<input
|
|
12
14
|
class="group-hover:border-blue-lightest border px-4 py-2 transition-colors rounded-md w-full focus:ring focus:outline-none focus:border-blue-medium"
|
|
13
|
-
type="text"
|
|
15
|
+
type="text"
|
|
16
|
+
/>
|
|
14
17
|
</label>
|
|
15
18
|
</template>
|
|
@@ -25,9 +25,7 @@ const categoryLabel = lang === 'pl' ? 'Kategoria' : 'Category';
|
|
|
25
25
|
categories && categories.length > 0
|
|
26
26
|
? categories.map((category, index) => (
|
|
27
27
|
<>
|
|
28
|
-
{index > 0 &&
|
|
29
|
-
<span class="w-px h-2.5 bg-gray-300 mx-2.5 inline-block relative" />
|
|
30
|
-
)}
|
|
28
|
+
{index > 0 && <span class="w-px h-2.5 bg-gray-300 mx-2.5 inline-block relative" />}
|
|
31
29
|
<a
|
|
32
30
|
class="term-link text-sm sm:text-base hover:text-light-blue-400"
|
|
33
31
|
data-pagefind-filter={`${categoryLabel}:${category.name}`}
|
|
@@ -39,4 +37,4 @@ const categoryLabel = lang === 'pl' ? 'Kategoria' : 'Category';
|
|
|
39
37
|
))
|
|
40
38
|
: null
|
|
41
39
|
}
|
|
42
|
-
</div>
|
|
40
|
+
</div>
|
|
@@ -13,7 +13,7 @@ interface Props {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
-
active: false
|
|
16
|
+
active: false,
|
|
17
17
|
});
|
|
18
18
|
</script>
|
|
19
19
|
|
|
@@ -28,4 +28,4 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
28
28
|
</a>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
-
<!-- No <style> section - all styles are now UnoCSS shortcuts -->
|
|
31
|
+
<!-- No <style> section - all styles are now UnoCSS shortcuts -->
|
|
@@ -17,13 +17,11 @@ interface Props {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const { image, title, categories, date, author, lang } = Astro.props;
|
|
20
|
-
import PostCategories from
|
|
21
|
-
import Date from
|
|
20
|
+
import PostCategories from './Post/PostCategories.astro';
|
|
21
|
+
import Date from './Date.astro';
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
<header
|
|
25
|
-
class="post-header pt-11 w-full justify-center text-white z-2 bg-blue-darkest"
|
|
26
|
-
>
|
|
24
|
+
<header class="post-header pt-11 w-full justify-center text-white z-2 bg-blue-darkest">
|
|
27
25
|
<div class="heading flex flex-wrap">
|
|
28
26
|
<div
|
|
29
27
|
class="w-full sm:max-w-[640px] md:max-w-3xl lg:max-w-5xl xl:max-w-7xl 2xl:max-w-[1536px] px-4 py-5 flex flex-col flex-wrap"
|
|
@@ -52,7 +50,7 @@ import Date from "./Date.astro";
|
|
|
52
50
|
</div>
|
|
53
51
|
</header>
|
|
54
52
|
|
|
55
|
-
<style
|
|
53
|
+
<style>
|
|
56
54
|
.post-header {
|
|
57
55
|
@apply flex relative items-center;
|
|
58
56
|
min-height: 19vw;
|