spoko-design-system 1.24.0 → 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 +6 -0
- package/package.json +1 -1
- package/uno-config/index.ts +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
1
7
|
## [1.24.0](https://github.com/polo-blue/sds/compare/v1.23.2...v1.24.0) (2025-12-16)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/package.json
CHANGED
package/uno-config/index.ts
CHANGED
|
@@ -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
|
},
|