spoko-design-system 1.0.0 → 1.1.0

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 (38) hide show
  1. package/.astro/data-store.json +1 -1
  2. package/.astro/settings.json +1 -1
  3. package/.claude/settings.local.json +11 -1
  4. package/.github/workflows/code-quality.yml +51 -0
  5. package/.github/workflows/sonarcloud.yml +51 -0
  6. package/.prettierignore +15 -0
  7. package/.prettierrc +25 -0
  8. package/.vscode/extensions.json +0 -1
  9. package/.vscode/settings.json +0 -4
  10. package/CHANGELOG.md +14 -0
  11. package/README.md +19 -3
  12. package/astro.config.mjs +0 -2
  13. package/eslint.config.js +64 -0
  14. package/icon.config.ts +32 -2
  15. package/package.json +14 -9
  16. package/sonar-project.properties +19 -0
  17. package/src/components/Category/CategoriesCarousel.astro +2 -3
  18. package/src/components/Category/CategoryDetails.astro +4 -5
  19. package/src/components/Faq.astro +1 -2
  20. package/src/components/Header/Header.astro +33 -33
  21. package/src/components/Headline.vue +24 -4
  22. package/src/components/Product/ProductLink.astro +7 -12
  23. package/src/components/ProductTile.astro +1 -2
  24. package/src/layouts/Layout.astro +0 -3
  25. package/src/layouts/MainLayout.astro +0 -3
  26. package/src/pages/components/buttons.mdx +0 -1
  27. package/src/pages/components/hand-drive.mdx +0 -27
  28. package/src/pages/index.astro +170 -39
  29. package/src/utils/category/getMainCategoryList.ts +8 -17
  30. package/src/utils/product/getPriceFormatted.ts +6 -9
  31. package/src/utils/product/getProductChecklist.ts +1 -2
  32. package/src/utils/text/formatLocaleNumber.ts +2 -3
  33. package/uno-config/index.ts +13 -19
  34. package/.astro/icon.d.ts +0 -11909
  35. package/astro-i18next.config.mjs +0 -18
  36. package/astro-i18next.config.ts +0 -11
  37. package/public/locales/en/translation.json +0 -13
  38. package/public/locales/pl/translation.json +0 -13
@@ -1,4 +1,3 @@
1
- import { t } from "i18next";
2
1
 
3
2
  export const getProductCheckList = (productDetails) => {
4
3
  if (!productDetails || !productDetails.length) {
@@ -11,7 +10,7 @@ export const getProductCheckList = (productDetails) => {
11
10
  return null;
12
11
  }
13
12
 
14
- return list.map(detail => t(`detail.value.${detail.value}`));
13
+ return list.map(detail => detail.value || 'Detail');
15
14
  }
16
15
 
17
16
  export default getProductCheckList;
@@ -1,7 +1,6 @@
1
1
  /* Format numbers like details data: liters, measuring etc. */
2
2
 
3
- import i18next from "i18next";
4
-
5
3
  export default function formatLocaleNumber(number: number ) {
6
- return i18next.language === 'en' ? String(number).replace(/,/g, '.') : String(number);
4
+ // For English-only design system, always use dot notation
5
+ return String(number).replace(/,/g, '.');
7
6
  }
@@ -44,6 +44,8 @@ import phIcons from '@iconify-json/ph/icons.json';
44
44
  import simpleIcons from '@iconify-json/simple-icons/icons.json';
45
45
  import systemUiconsIcons from '@iconify-json/system-uicons/icons.json';
46
46
  import uilIcons from '@iconify-json/uil/icons.json';
47
+ import vscodeIcons from '@iconify-json/vscode-icons/icons.json';
48
+ import streamlineFreehandColorIcons from '@iconify-json/streamline-freehand-color/icons.json';
47
49
 
48
50
  // List of peer selectors we want to preserve during build
49
51
  const peerSelectorClasses = [
@@ -164,36 +166,26 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
164
166
  extract({ code, id }) {
165
167
  const result = new Set();
166
168
 
167
- // Enhanced class extraction for Astro components
169
+ // Only extract from class attributes to prevent false positives
168
170
  const classRegex = /class(?:Name)?=["'`]([^"'`]+)["'`]/g;
169
171
  let match;
170
172
  while ((match = classRegex.exec(code)) !== null) {
171
173
  match[1].split(/\s+/).forEach(cls => {
172
- if (cls) result.add(cls);
174
+ // Only add classes that don't look like malformed icon names
175
+ if (cls && !cls.match(/^(lucide|simple-icons)-\w+-[A-Z]/) && !cls.includes('Grouping')) {
176
+ result.add(cls);
177
+ }
173
178
  });
174
179
  }
175
180
 
176
- // Extract peer selectors
177
- const peerRegex = /peer-[a-zA-Z0-9-]+(?::[a-zA-Z0-9-]+)*/g;
178
- const peerMatches = code.match(peerRegex);
179
- if (peerMatches) {
180
- peerMatches.forEach(match => result.add(match));
181
- }
182
-
183
- // Extract shortcut references
184
- const shortcutRegex = /\b(?:input|button|layout|component|product|jumbotron)-[a-zA-Z0-9-]+/g;
185
- const shortcutMatches = code.match(shortcutRegex);
186
- if (shortcutMatches) {
187
- shortcutMatches.forEach(match => result.add(match));
188
- }
189
-
190
- // For .astro files, extract from both template and script sections
181
+ // For .astro files, extract from dynamic class bindings
191
182
  if (id && id.endsWith('.astro')) {
192
- // Extract from dynamic class bindings
193
183
  const dynamicClassRegex = /class:\w+\s*=\s*["'`]([^"'`]+)["'`]/g;
194
184
  while ((match = dynamicClassRegex.exec(code)) !== null) {
195
185
  match[1].split(/\s+/).forEach(cls => {
196
- if (cls) result.add(cls);
186
+ if (cls && !cls.match(/^(lucide|simple-icons)-\w+-[A-Z]/) && !cls.includes('Grouping')) {
187
+ result.add(cls);
188
+ }
197
189
  });
198
190
  }
199
191
  }
@@ -240,6 +232,8 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
240
232
  'simple-icons': simpleIcons,
241
233
  'system-uicons': systemUiconsIcons,
242
234
  'uil': uilIcons,
235
+ 'vscode-icons': vscodeIcons,
236
+ 'streamline-freehand-color': streamlineFreehandColorIcons,
243
237
  }
244
238
  }),
245
239
  presetTypography(),