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