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,156 +1,143 @@
1
- ---
2
- import type { Author, Category } from './types';
3
- import DefaultVariant from './variants/Default.astro';
4
- import HeroVariant from './variants/Hero.astro';
5
- import PostVariant from './variants/Post.astro';
6
- import PostSplitVariant from './variants/PostSplit.astro';
7
-
8
- interface Props {
9
- variant?: "default" | "hero" | "post" | "post-split";
10
- title?: string;
11
- image?: string;
12
- small?: boolean;
13
- description?: string;
14
- info?: string;
15
- date?: string;
16
- author?: Author;
17
- categories?: Category[];
18
- backgroundClass?: string;
19
- lang?: string;
20
- }
21
-
22
- const {
23
- variant = "default",
24
- title = "",
25
- image,
26
- small = false,
27
- description,
28
- info,
29
- date,
30
- author,
31
- categories = [],
32
- backgroundClass = 'bg-blue-darker',
33
- lang = 'en'
34
- } = Astro.props;
35
-
36
- // Helper (function to check if a slot has content)
37
- const hasSlotContent = async (slotName) => {
38
- const slot = await Astro.slots.render(slotName);
39
- return slot?.trim().length > 0;
40
- };
41
-
42
- // Get content status
43
- const hasIntroContent = await hasSlotContent('intro');
44
- const hasSubtitleContent = await hasSlotContent('subtitle');
45
- const hasCtaContent = await hasSlotContent('cta-content');
46
-
47
- // Content helpers
48
- const hasMetadata = author || date;
49
- const hasCategories = categories.length > 0;
50
-
51
- // Props to pass to variants
52
- const commonProps = {
53
- title,
54
- image,
55
- hasIntroContent,
56
- hasSubtitleContent,
57
- hasCtaContent,
58
- hasMetadata,
59
- hasCategories,
60
- backgroundClass,
61
- lang,
62
- };
63
- ---
64
-
65
- {variant === "default" && (
66
- <DefaultVariant
67
- {...commonProps}
68
- small={small}
69
- >
70
- <slot name="intro" slot="intro" />
71
- <slot name="subtitle" slot="subtitle" />
72
- <slot name="cta-content" slot="cta-content" />
73
- </DefaultVariant>
74
- )}
75
-
76
- {variant === "hero" && (
77
- <HeroVariant
78
- {...commonProps}
79
- description={description}
80
- info={info}
81
- />
82
- )}
83
-
84
- {variant === "post" && (
85
- <PostVariant
86
- {...commonProps}
87
- author={author}
88
- date={date}
89
- categories={categories}
90
- />
91
- )}
92
-
93
- {variant === "post-split" && (
94
- <PostSplitVariant
95
- {...commonProps}
96
- author={author}
97
- date={date}
98
- categories={categories}
99
- />
100
- )}
101
-
102
- <style>
103
- .bg-vw {
104
- background: radial-gradient(circle at 50% 85%, #00437a 0%, #001e50 100%);
105
- }
106
-
107
- .featured-image-overlay {
108
- @apply absolute top-0 bottom-0 left-0 right-0 overflow-hidden w-full bg-gray-100 z-1;
109
-
110
- &:before,
111
- &:after {
112
- @apply content-empty top-0 bottom-0 left-0 right-0 absolute;
113
- }
114
-
115
- &:before {
116
- z-index: 5;
117
- background: linear-gradient(
118
- 0deg,
119
- rgba(0, 0, 0, 0.95),
120
- transparent 30%,
121
- transparent 70%,
122
- rgba(0, 0, 0, 0.95)
123
- );
124
- opacity: 0.5;
125
- }
126
-
127
- &:after {
128
- background: radial-gradient(circle at 50% 85%, #00437a 0, #001e50 100%);
129
- opacity: 0.8;
130
- }
131
- }
132
-
133
- .featured-image {
134
- width: 100%;
135
- @apply bg-blue-900;
136
-
137
- img {
138
- width: 100%;
139
- object-fit: cover;
140
- max-width: 100%;
141
- display: block;
142
- }
143
- }
144
-
145
- h1 {
146
- b {
147
- @apply font-headregular whitespace-nowrap;
148
- }
149
- small {
150
- @apply text-6 whitespace-nowrap;
151
- }
152
- span {
153
- @apply text-accent-light;
154
- }
155
- }
156
- </style>
1
+ ---
2
+ import type { Author, Category } from './types';
3
+ import DefaultVariant from './variants/Default.astro';
4
+ import HeroVariant from './variants/Hero.astro';
5
+ import PostVariant from './variants/Post.astro';
6
+ import PostSplitVariant from './variants/PostSplit.astro';
7
+
8
+ interface Props {
9
+ variant?: 'default' | 'hero' | 'post' | 'post-split';
10
+ title?: string;
11
+ image?: string;
12
+ small?: boolean;
13
+ description?: string;
14
+ info?: string;
15
+ date?: string;
16
+ author?: Author;
17
+ categories?: Category[];
18
+ backgroundClass?: string;
19
+ lang?: string;
20
+ }
21
+
22
+ const {
23
+ variant = 'default',
24
+ title = '',
25
+ image,
26
+ small = false,
27
+ description,
28
+ info,
29
+ date,
30
+ author,
31
+ categories = [],
32
+ backgroundClass = 'bg-blue-darker',
33
+ lang = 'en',
34
+ } = Astro.props;
35
+
36
+ // Helper (function to check if a slot has content)
37
+ const hasSlotContent = async slotName => {
38
+ const slot = await Astro.slots.render(slotName);
39
+ return slot?.trim().length > 0;
40
+ };
41
+
42
+ // Get content status
43
+ const hasIntroContent = await hasSlotContent('intro');
44
+ const hasSubtitleContent = await hasSlotContent('subtitle');
45
+ const hasCtaContent = await hasSlotContent('cta-content');
46
+
47
+ // Content helpers
48
+ const hasMetadata = author || date;
49
+ const hasCategories = categories.length > 0;
50
+
51
+ // Props to pass to variants
52
+ const commonProps = {
53
+ title,
54
+ image,
55
+ hasIntroContent,
56
+ hasSubtitleContent,
57
+ hasCtaContent,
58
+ hasMetadata,
59
+ hasCategories,
60
+ backgroundClass,
61
+ lang,
62
+ };
63
+ ---
64
+
65
+ {
66
+ variant === 'default' && (
67
+ <DefaultVariant {...commonProps} small={small}>
68
+ <slot name="intro" slot="intro" />
69
+ <slot name="subtitle" slot="subtitle" />
70
+ <slot name="cta-content" slot="cta-content" />
71
+ </DefaultVariant>
72
+ )
73
+ }
74
+
75
+ {variant === 'hero' && <HeroVariant {...commonProps} description={description} info={info} />}
76
+
77
+ {
78
+ variant === 'post' && (
79
+ <PostVariant {...commonProps} author={author} date={date} categories={categories} />
80
+ )
81
+ }
82
+
83
+ {
84
+ variant === 'post-split' && (
85
+ <PostSplitVariant {...commonProps} author={author} date={date} categories={categories} />
86
+ )
87
+ }
88
+
89
+ <style>
90
+ .bg-vw {
91
+ background: radial-gradient(circle at 50% 85%, #00437a 0%, #001e50 100%);
92
+ }
93
+
94
+ .featured-image-overlay {
95
+ @apply absolute top-0 bottom-0 left-0 right-0 overflow-hidden w-full bg-gray-100 z-1;
96
+
97
+ &:before,
98
+ &:after {
99
+ @apply content-empty top-0 bottom-0 left-0 right-0 absolute;
100
+ }
101
+
102
+ &:before {
103
+ z-index: 5;
104
+ background: linear-gradient(
105
+ 0deg,
106
+ rgba(0, 0, 0, 0.95),
107
+ transparent 30%,
108
+ transparent 70%,
109
+ rgba(0, 0, 0, 0.95)
110
+ );
111
+ opacity: 0.5;
112
+ }
113
+
114
+ &:after {
115
+ background: radial-gradient(circle at 50% 85%, #00437a 0, #001e50 100%);
116
+ opacity: 0.8;
117
+ }
118
+ }
119
+
120
+ .featured-image {
121
+ width: 100%;
122
+ @apply bg-blue-900;
123
+
124
+ img {
125
+ width: 100%;
126
+ object-fit: cover;
127
+ max-width: 100%;
128
+ display: block;
129
+ }
130
+ }
131
+
132
+ h1 {
133
+ b {
134
+ @apply font-headregular whitespace-nowrap;
135
+ }
136
+ small {
137
+ @apply text-6 whitespace-nowrap;
138
+ }
139
+ span {
140
+ @apply text-accent-light;
141
+ }
142
+ }
143
+ </style>
@@ -1,29 +1,28 @@
1
- // types.ts
2
- export interface Author {
3
- firstName?: string;
4
- name: string;
5
- }
6
-
7
- export interface Category {
8
- name: string;
9
- uri: string;
10
- }
11
-
12
- export interface Props {
13
- // Common props
14
- variant?: "default" | "hero" | "post" | "post-split";
15
- title?: string;
16
- image?: string;
17
- backgroundClass?: string;
18
-
19
-
20
- // Default & Hero variant props
21
- small?: boolean;
22
- description?: string;
23
- info?: string;
24
-
25
- // Post variants props
26
- date?: string;
27
- author?: Author;
28
- categories?: Category[];
29
- }
1
+ // types.ts
2
+ export interface Author {
3
+ firstName?: string;
4
+ name: string;
5
+ }
6
+
7
+ export interface Category {
8
+ name: string;
9
+ uri: string;
10
+ }
11
+
12
+ export interface Props {
13
+ // Common props
14
+ variant?: 'default' | 'hero' | 'post' | 'post-split';
15
+ title?: string;
16
+ image?: string;
17
+ backgroundClass?: string;
18
+
19
+ // Default & Hero variant props
20
+ small?: boolean;
21
+ description?: string;
22
+ info?: string;
23
+
24
+ // Post variants props
25
+ date?: string;
26
+ author?: Author;
27
+ categories?: Category[];
28
+ }
@@ -1,40 +1,44 @@
1
- ---
2
- // variants/Default.astro
3
- interface Props {
4
- title?: string;
5
- small?: boolean;
6
- hasIntroContent: boolean;
7
- hasSubtitleContent: boolean;
8
- hasCtaContent: boolean;
9
- }
10
-
11
- const {
12
- title = "",
13
- small = false,
14
- hasIntroContent,
15
- hasSubtitleContent,
16
- hasCtaContent,
17
- } = Astro.props;
18
- ---
19
-
20
- <header
21
- class:list={[
22
- "flow content-grid", // globalne klasy
23
- "jumbotron-header-base bg-vw", // klasy bazowe i tło
24
- small ? "jumbotron-container-small" : "jumbotron-container-large" // wariant rozmiaru
25
- ]}
26
- >
27
- {hasIntroContent ? (
28
- <slot name="intro" />
29
- ) : (
30
- <h1 class="jumbotron-title-default" set:html={title} />
31
- )}
32
-
33
- {hasSubtitleContent && <slot name="subtitle" />}
34
-
35
- {hasCtaContent && (
36
- <div class="jumbotron-cta-wrapper">
37
- <slot name="cta-content" />
38
- </div>
39
- )}
40
- </header>
1
+ ---
2
+ // variants/Default.astro
3
+ interface Props {
4
+ title?: string;
5
+ small?: boolean;
6
+ hasIntroContent: boolean;
7
+ hasSubtitleContent: boolean;
8
+ hasCtaContent: boolean;
9
+ }
10
+
11
+ const {
12
+ title = '',
13
+ small = false,
14
+ hasIntroContent,
15
+ hasSubtitleContent,
16
+ hasCtaContent,
17
+ } = Astro.props;
18
+ ---
19
+
20
+ <header
21
+ class:list={[
22
+ 'flow content-grid', // globalne klasy
23
+ 'jumbotron-header-base bg-vw', // klasy bazowe i tło
24
+ small ? 'jumbotron-container-small' : 'jumbotron-container-large', // wariant rozmiaru
25
+ ]}
26
+ >
27
+ {
28
+ hasIntroContent ? (
29
+ <slot name="intro" />
30
+ ) : (
31
+ <h1 class="jumbotron-title-default" set:html={title} />
32
+ )
33
+ }
34
+
35
+ {hasSubtitleContent && <slot name="subtitle" />}
36
+
37
+ {
38
+ hasCtaContent && (
39
+ <div class="jumbotron-cta-wrapper">
40
+ <slot name="cta-content" />
41
+ </div>
42
+ )
43
+ }
44
+ </header>
@@ -1,53 +1,45 @@
1
- ---
2
- // variants/Hero.astro
3
- interface Props {
4
- title?: string;
5
- image?: string;
6
- description?: string;
7
- info?: string;
8
- backgroundClass?: string;
9
- }
10
-
11
- const {
12
- title = "",
13
- image,
14
- description,
15
- info,
16
- backgroundClass
17
- } = Astro.props;
18
-
19
- ---
20
-
21
- <div class={`relative w-full ${backgroundClass}`}>
22
- {image && (
23
- <div class="absolute inset-0 w-full h-full">
24
- <div class="absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1" />
25
- <img
26
- class="w-full h-full object-cover"
27
- src={image}
28
- alt={title}
29
- />
30
- </div>
31
- )}
32
-
33
- <div class="xl:container mx-auto px-3.5 md:px-8 py-8 h-56 sm:h-72 md:max-h-72 items-center flex">
34
- <header class="relative z-10 text-white">
35
- <h1
36
- class="font-headlight text-3xl sm:text-4xl md:text-5xl xl:text-6xl mt-1 line-clamp-3 leading-tight"
37
- set:html={title}
38
- />
39
- {description && (
40
- <div
41
- class="mb-1 line-clamp-3 text-base sm:text-lg leading-none mt-4"
42
- set:html={description}
43
- />
44
- )}
45
- {info && (
46
- <div
47
- class="font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2"
48
- set:html={info}
49
- />
50
- )}
51
- </header>
52
- </div>
53
- </div>
1
+ ---
2
+ // variants/Hero.astro
3
+ interface Props {
4
+ title?: string;
5
+ image?: string;
6
+ description?: string;
7
+ info?: string;
8
+ backgroundClass?: string;
9
+ }
10
+
11
+ const { title = '', image, description, info, backgroundClass } = Astro.props;
12
+ ---
13
+
14
+ <div class={`relative w-full ${backgroundClass}`}>
15
+ {
16
+ image && (
17
+ <div class="absolute inset-0 w-full h-full">
18
+ <div class="absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1" />
19
+ <img class="w-full h-full object-cover" src={image} alt={title} />
20
+ </div>
21
+ )
22
+ }
23
+
24
+ <div class="xl:container mx-auto px-3.5 md:px-8 py-8 h-56 sm:h-72 md:max-h-72 items-center flex">
25
+ <header class="relative z-10 text-white">
26
+ <h1
27
+ class="font-headlight text-3xl sm:text-4xl md:text-5xl xl:text-6xl mt-1 line-clamp-3 leading-tight"
28
+ set:html={title}
29
+ />
30
+ {
31
+ description && (
32
+ <div
33
+ class="mb-1 line-clamp-3 text-base sm:text-lg leading-none mt-4"
34
+ set:html={description}
35
+ />
36
+ )
37
+ }
38
+ {
39
+ info && (
40
+ <div class="font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2" set:html={info} />
41
+ )
42
+ }
43
+ </header>
44
+ </div>
45
+ </div>