spoko-design-system 1.23.2 → 1.24.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [1.24.1](https://github.com/polo-blue/sds/compare/v1.24.0...v1.24.1) (2025-12-22)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **uno-config:** add circle-flags to safelist and Vue :class extractor ([672086a](https://github.com/polo-blue/sds/commit/672086a55b021eaa1ef30807068f7e1f645d39f2))
6
+
7
+ ## [1.24.0](https://github.com/polo-blue/sds/compare/v1.23.2...v1.24.0) (2025-12-16)
8
+
9
+ ### Features
10
+
11
+ * export useFormatProductNumber utility ([4e585e4](https://github.com/polo-blue/sds/commit/4e585e4bf500049f1ab8e325ae7a0daa6dd2ade6))
12
+
1
13
  ## [1.23.2](https://github.com/polo-blue/sds/compare/v1.23.1...v1.23.2) (2025-12-16)
2
14
 
3
15
  ### Bug Fixes
package/index.ts CHANGED
@@ -61,6 +61,7 @@ export { default as getPriceFormatted } from './src/utils/product/getPriceFormat
61
61
  export { default as getProductChecklist } from './src/utils/product/getProductChecklist';
62
62
  export { getEngineTooltipContent } from './src/utils/product/getEngineTooltipContent';
63
63
  export type { Engine, EngineTranslations } from './src/utils/product/getEngineTooltipContent';
64
+ export { default as useFormatProductNumber } from './src/utils/product/useFormatProductNumber';
64
65
 
65
66
  // Utils: SEO
66
67
  export { default as getShorterDescription } from './src/utils/seo/getShorterDescription';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "1.23.2",
3
+ "version": "1.24.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./index.ts",
@@ -18,19 +18,21 @@ const { CategoryObject } = Astro.props;
18
18
  const { height = 70, width = 70, path } = CategoryObject;
19
19
  ---
20
20
 
21
- <a href={path} class="carousel-item" data-astro-prefetch itemprop="url">
22
- <Image
23
- src={CategoryObject.photo}
24
- alt={CategoryObject.alt}
25
- height={height}
26
- width={width}
27
- format="avif"
28
- loading="eager"
29
- onerror="this.style.display='none';"
30
- class="cats-img"
31
- />
32
- <div class="swiper-lazy-preloader"></div>
33
- <div class="cat-name" itemprop="name">
34
- {CategoryObject.name}
35
- </div>
36
- </a>
21
+ <span itemprop="name">
22
+ <a itemprop="url" href={path} class="carousel-item" data-astro-prefetch>
23
+ <Image
24
+ src={CategoryObject.photo}
25
+ alt={CategoryObject.alt}
26
+ height={height}
27
+ width={width}
28
+ format="avif"
29
+ loading="eager"
30
+ onerror="this.style.display='none';"
31
+ class="cats-img"
32
+ />
33
+ <div class="swiper-lazy-preloader"></div>
34
+ <div class="cat-name">
35
+ {CategoryObject.name}
36
+ </div>
37
+ </a>
38
+ </span>
@@ -162,8 +162,15 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
162
162
  'i-simple-icons-youtube',
163
163
  'i-simple-icons-vimeo',
164
164
 
165
+ // Language flags for Translations component (dynamic Vue classes)
166
+ 'i-circle-flags:en',
167
+ 'i-circle-flags:pl',
168
+
165
169
  // All peer selectors from the list (needed for floating labels)
166
170
  ...peerSelectorClasses,
171
+
172
+ // Custom safelist from consumer config
173
+ ...(customConfig.safelist || []),
167
174
  ],
168
175
  // Optimized extractors for static Astro builds
169
176
  extractors: [
@@ -197,6 +204,31 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
197
204
  }
198
205
  }
199
206
 
207
+ // For .vue files, extract from :class bindings (dynamic classes)
208
+ if (id && id.endsWith('.vue')) {
209
+ // Match :class="[...]" or :class="{...}" or :class="'...'"
210
+ const vueClassRegex = /:class=["'`]([^"'`]+)["'`]/g;
211
+ while ((match = vueClassRegex.exec(code)) !== null) {
212
+ // Extract class names from ternary expressions and string literals
213
+ const classContent = match[1];
214
+ // Match quoted strings inside the expression (e.g., 'i-circle-flags:en')
215
+ const quotedStrings = classContent.match(/['"]([^'"]+)['"]/g);
216
+ if (quotedStrings) {
217
+ quotedStrings.forEach(quoted => {
218
+ const cls = quoted.replace(/['"]/g, '').trim();
219
+ if (cls && !cls.includes('?') && !cls.includes(':') || cls.startsWith('i-')) {
220
+ // Split by spaces in case multiple classes
221
+ cls.split(/\s+/).forEach(c => {
222
+ if (c && c.length > 1) {
223
+ result.add(c);
224
+ }
225
+ });
226
+ }
227
+ });
228
+ }
229
+ }
230
+ }
231
+
200
232
  return result;
201
233
  },
202
234
  },