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,136 +1,145 @@
|
|
|
1
1
|
---
|
|
2
|
-
import MainLayout from
|
|
3
|
-
import { Icon } from
|
|
2
|
+
import MainLayout from '../../layouts/MainLayout.astro';
|
|
3
|
+
import { Icon } from 'astro-icon/components';
|
|
4
4
|
import { iconConfig } from '../../../icon.config';
|
|
5
5
|
|
|
6
|
-
const iconifyUrl =
|
|
6
|
+
const iconifyUrl = 'https://icon-sets.iconify.design/';
|
|
7
7
|
const ICONS = iconConfig.include;
|
|
8
8
|
|
|
9
9
|
type IconGroup = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
name: string;
|
|
11
|
+
icons: string[];
|
|
12
|
+
url: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const sortedIconCollections = Object.entries(ICONS)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
17
|
+
.map(([name, icons]) => ({
|
|
18
|
+
name,
|
|
19
|
+
icons,
|
|
20
|
+
url: `${iconifyUrl}${name}/`,
|
|
21
|
+
}));
|
|
22
22
|
---
|
|
23
23
|
|
|
24
24
|
<MainLayout>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
<div class="max-w-7xl mx-auto px-4 py-8">
|
|
26
|
+
<h1 class="text-2xl font-bold mb-4">Icons</h1>
|
|
27
|
+
<p class="mb-4">Astro Icon is a straightforward icon system for the Astro framework.</p>
|
|
28
|
+
|
|
29
|
+
<a
|
|
30
|
+
href="https://www.astroicon.dev/"
|
|
31
|
+
class="text-blue-medium hover:text-accent-darker underline"
|
|
32
|
+
target="_blank"
|
|
33
|
+
rel="noopener noreferrer"
|
|
34
|
+
>
|
|
35
|
+
https://www.astroicon.dev/
|
|
36
|
+
</a>
|
|
37
|
+
|
|
38
|
+
<pre
|
|
39
|
+
class="mt-6 p-4 rounded bg-slate-800 text-white overflow-x-auto">
|
|
37
40
|
import { Icon } from 'astro-icon/components';
|
|
38
41
|
</pre>
|
|
39
42
|
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
43
|
+
<div class="mt-8 space-y-12">
|
|
44
|
+
{
|
|
45
|
+
sortedIconCollections.map(({ name, icons, url }) => (
|
|
46
|
+
<div>
|
|
47
|
+
<h2 class="text-xl font-semibold mb-4">
|
|
48
|
+
<a
|
|
49
|
+
href={url}
|
|
50
|
+
class="text-blue-medium hover:text-accent-darker inline-flex items-center gap-2"
|
|
51
|
+
target="_blank"
|
|
52
|
+
rel="noopener noreferrer"
|
|
53
|
+
>
|
|
54
|
+
{name}
|
|
55
|
+
<span class="text-sm text-gray-500">({icons.length} icons)</span>
|
|
56
|
+
</a>
|
|
57
|
+
</h2>
|
|
58
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
|
59
|
+
{icons.map(iconName => (
|
|
60
|
+
<div
|
|
61
|
+
class="group relative p-4 border rounded-lg hover:shadow-md transition-shadow cursor-pointer icon-card"
|
|
62
|
+
data-icon-name={`${name}:${iconName}`}
|
|
63
|
+
>
|
|
64
|
+
<div class="flex flex-col items-center">
|
|
65
|
+
<div class="p-4 bg-gray-50 rounded-lg mb-2 w-full flex justify-center items-center min-h-[64px]">
|
|
66
|
+
<Icon name={`${name}:${iconName}`} class="text-3xl text-blue-medium" />
|
|
67
|
+
</div>
|
|
68
|
+
<code class="text-sm text-gray-600 text-center break-all">
|
|
69
|
+
{name}:{iconName}
|
|
70
|
+
</code>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="tooltip opacity-0 invisible absolute left-1/2 -translate-x-1/2 -top-10 bg-gray-800 text-white px-3 py-1.5 rounded text-sm whitespace-nowrap transition-all z-10">
|
|
73
|
+
Copied!
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
))}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div
|
|
84
|
+
class="fixed bottom-4 right-4 bg-gray-800 text-white px-4 py-2 rounded-lg opacity-0 invisible transition-all duration-300"
|
|
85
|
+
id="globalNotification"
|
|
86
|
+
>
|
|
87
|
+
Icon code copied to clipboard!
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<script>
|
|
92
|
+
document.addEventListener('astro:page-load', () => {
|
|
93
|
+
const cards = document.querySelectorAll('.icon-card');
|
|
94
|
+
const globalNotification = document.getElementById('globalNotification');
|
|
95
|
+
|
|
96
|
+
cards.forEach(card => {
|
|
97
|
+
card.addEventListener('click', async () => {
|
|
98
|
+
const iconName = card.getAttribute('data-icon-name');
|
|
99
|
+
if (!iconName) return;
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
await navigator.clipboard.writeText(`<Icon name="${iconName}" />`);
|
|
103
|
+
|
|
104
|
+
// Show tooltip
|
|
105
|
+
const tooltip = card.querySelector('.tooltip');
|
|
106
|
+
if (tooltip) {
|
|
107
|
+
tooltip.classList.remove('opacity-0', 'invisible');
|
|
108
|
+
tooltip.classList.add('opacity-100', 'visible');
|
|
109
|
+
|
|
110
|
+
// Hide tooltip after 2 seconds
|
|
111
|
+
setTimeout(() => {
|
|
112
|
+
tooltip.classList.add('opacity-0', 'invisible');
|
|
113
|
+
tooltip.classList.remove('opacity-100', 'visible');
|
|
114
|
+
}, 2000);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Show global notification
|
|
118
|
+
if (globalNotification) {
|
|
119
|
+
globalNotification.classList.remove('opacity-0', 'invisible');
|
|
120
|
+
globalNotification.classList.add('opacity-100', 'visible');
|
|
121
|
+
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
globalNotification.classList.add('opacity-0', 'invisible');
|
|
124
|
+
globalNotification.classList.remove('opacity-100', 'visible');
|
|
125
|
+
}, 2000);
|
|
126
|
+
}
|
|
127
|
+
} catch (err) {
|
|
128
|
+
console.error('Failed to copy:', err);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<style>
|
|
136
|
+
.tooltip {
|
|
137
|
+
transition: all 0.2s ease-in-out;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#globalNotification {
|
|
141
|
+
transition: all 0.3s ease-in-out;
|
|
142
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
145
|
+
</MainLayout>
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
import MainLayout from '../../layouts/MainLayout.astro';
|
|
3
|
-
import { SHADOWS } from '../../design.config'
|
|
4
|
-
|
|
3
|
+
import { SHADOWS } from '../../design.config';
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
<MainLayout>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
<h1>Shadows</h1>
|
|
8
|
+
<div class="component-preview">
|
|
9
|
+
<div class="inline-grid grid-cols-2 gap-16">
|
|
10
|
+
{
|
|
11
|
+
SHADOWS.types.map(({ name, value }) => (
|
|
12
|
+
<div
|
|
13
|
+
class="p-2 bg-white rounded-md text-slate-500 text-right pt-16 pl-24 font-mono"
|
|
14
|
+
style={'box-shadow: ' + value}
|
|
15
|
+
>
|
|
16
|
+
{name}
|
|
17
|
+
</div>
|
|
18
|
+
))
|
|
19
|
+
}
|
|
15
20
|
</div>
|
|
16
|
-
|
|
21
|
+
</div>
|
|
22
|
+
<pre
|
|
23
|
+
class="astro-code bg-slate-800 text-white">
|
|
17
24
|
{SHADOWS.types.map(({name, value}) => (
|
|
18
25
|
<div class="my-2">{`${name}: ${value}`}</div>
|
|
19
26
|
))}
|
|
20
27
|
</pre>
|
|
21
|
-
</MainLayout>
|
|
28
|
+
</MainLayout>
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
---
|
|
2
|
-
import MainLayout from '../../layouts/MainLayout.astro'
|
|
3
|
-
import { typography } from '../../../uno-config/theme/typography'
|
|
2
|
+
import MainLayout from '../../layouts/MainLayout.astro';
|
|
3
|
+
import { typography } from '../../../uno-config/theme/typography';
|
|
4
4
|
|
|
5
|
-
const fonts = Object.entries(typography.fontFamily)
|
|
6
|
-
const loremText =
|
|
5
|
+
const fonts = Object.entries(typography.fontFamily);
|
|
6
|
+
const loremText = 'Lorem ipsum dolor sit amet, consectetur adipiscing';
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<MainLayout>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<!-- Font Preview Cards -->
|
|
14
|
-
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12">
|
|
15
|
-
{fonts.map(([name, family]) => (
|
|
16
|
-
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6 hover:shadow-md transition-shadow">
|
|
17
|
-
<!-- Font Sample -->
|
|
18
|
-
<div class={`font-${name} text-3xl mb-4 min-h-[120px] flex items-center`}>
|
|
19
|
-
{loremText}
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<!-- Font Info -->
|
|
23
|
-
<div class="border-t pt-4">
|
|
24
|
-
<div class="flex items-center justify-between mb-2">
|
|
25
|
-
<span class="text-lg font-medium text-gray-900">{name}</span>
|
|
26
|
-
<span class="px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-600">font-{name}</span>
|
|
27
|
-
</div>
|
|
28
|
-
<code class="text-sm text-gray-500 block overflow-x-auto whitespace-nowrap">
|
|
29
|
-
{family.join(', ')}
|
|
30
|
-
</code>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
))}
|
|
34
|
-
</div>
|
|
10
|
+
<div class="max-w-7xl mx-auto px-4 py-8 sm:px-6 lg:px-8">
|
|
11
|
+
<h1 class="text-4xl font-bold text-gray-900 mb-8">Font Family Preview</h1>
|
|
35
12
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
<!-- Font Preview Cards -->
|
|
14
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12">
|
|
15
|
+
{
|
|
16
|
+
fonts.map(([name, family]) => (
|
|
17
|
+
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6 hover:shadow-md transition-shadow">
|
|
18
|
+
<div class={`font-${name} text-3xl mb-4 min-h-[120px] flex items-center`}>
|
|
19
|
+
{loremText}
|
|
40
20
|
</div>
|
|
41
|
-
|
|
21
|
+
|
|
22
|
+
<div class="border-t pt-4">
|
|
23
|
+
<div class="flex items-center justify-between mb-2">
|
|
24
|
+
<span class="text-lg font-medium text-gray-900">{name}</span>
|
|
25
|
+
<span class="px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-600">
|
|
26
|
+
font-{name}
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
<code class="text-sm text-gray-500 block overflow-x-auto whitespace-nowrap">
|
|
30
|
+
{family.join(', ')}
|
|
31
|
+
</code>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Font Configuration Code -->
|
|
39
|
+
<div class="bg-gray-900 rounded-lg overflow-hidden">
|
|
40
|
+
<div class="bg-gray-800 px-4 py-2 text-gray-400">Font Configuration</div>
|
|
41
|
+
<pre
|
|
42
|
+
class="p-4 overflow-x-auto">
|
|
42
43
|
<code class="text-gray-200 text-sm">
|
|
43
44
|
{fonts.map(([name, family]) => `font-${name}:\n${family.join(', ')}
|
|
44
45
|
`).join('\n')}</code>
|
|
45
46
|
</pre>
|
|
46
|
-
</div>
|
|
47
47
|
</div>
|
|
48
|
+
</div>
|
|
48
49
|
</MainLayout>
|
|
49
|
-
|