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.
- package/.astro/data-store.json +1 -1
- package/.astro/settings.json +1 -1
- package/.claude/settings.local.json +11 -1
- package/.github/workflows/code-quality.yml +51 -0
- package/.github/workflows/sonarcloud.yml +51 -0
- package/.prettierignore +15 -0
- package/.prettierrc +25 -0
- package/.vscode/extensions.json +0 -1
- package/.vscode/settings.json +0 -4
- package/CHANGELOG.md +14 -0
- package/README.md +19 -3
- package/astro.config.mjs +0 -2
- package/eslint.config.js +64 -0
- package/icon.config.ts +32 -2
- package/package.json +14 -9
- package/sonar-project.properties +19 -0
- package/src/components/Category/CategoriesCarousel.astro +2 -3
- package/src/components/Category/CategoryDetails.astro +4 -5
- package/src/components/Faq.astro +1 -2
- package/src/components/Header/Header.astro +33 -33
- package/src/components/Headline.vue +24 -4
- package/src/components/Product/ProductLink.astro +7 -12
- package/src/components/ProductTile.astro +1 -2
- package/src/layouts/Layout.astro +0 -3
- package/src/layouts/MainLayout.astro +0 -3
- package/src/pages/components/buttons.mdx +0 -1
- package/src/pages/components/hand-drive.mdx +0 -27
- package/src/pages/index.astro +170 -39
- package/src/utils/category/getMainCategoryList.ts +8 -17
- package/src/utils/product/getPriceFormatted.ts +6 -9
- package/src/utils/product/getProductChecklist.ts +1 -2
- package/src/utils/text/formatLocaleNumber.ts +2 -3
- package/uno-config/index.ts +13 -19
- package/.astro/icon.d.ts +0 -11909
- package/astro-i18next.config.mjs +0 -18
- package/astro-i18next.config.ts +0 -11
- package/public/locales/en/translation.json +0 -13
- 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 =>
|
|
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
|
-
|
|
4
|
+
// For English-only design system, always use dot notation
|
|
5
|
+
return String(number).replace(/,/g, '.');
|
|
7
6
|
}
|
package/uno-config/index.ts
CHANGED
|
@@ -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
|
-
//
|
|
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
|
-
|
|
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
|
-
//
|
|
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)
|
|
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(),
|