spoko-design-system 1.5.1 → 1.5.2
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,9 @@
|
|
|
1
|
+
## [1.5.2](https://github.com/polo-blue/sds/compare/v1.5.1...v1.5.2) (2025-10-28)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* improve combined PR code display and color handling ([e9bb13d](https://github.com/polo-blue/sds/commit/e9bb13d5500ba5ef0be527bf79b75e14fc49e6fe))
|
|
6
|
+
|
|
1
7
|
## [1.5.1](https://github.com/polo-blue/sds/compare/v1.5.0...v1.5.1) (2025-10-27)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -22,6 +22,37 @@ const props = defineProps({
|
|
|
22
22
|
required: false,
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
+
|
|
26
|
+
// Static mapping of PR codes to variant categories
|
|
27
|
+
// Based on database migration from PR_CODE_REFACTORING_2025_10_27.md
|
|
28
|
+
const variantCategoryMap: Record<string, string> = {
|
|
29
|
+
// GTI
|
|
30
|
+
'2JD': 'GTI',
|
|
31
|
+
'1ZD': 'GTI',
|
|
32
|
+
'1KV': 'GTI',
|
|
33
|
+
'0NH': 'GTI',
|
|
34
|
+
'1ZR': 'GTI',
|
|
35
|
+
// WRC
|
|
36
|
+
'E5M': 'WRC',
|
|
37
|
+
'1KD': 'WRC',
|
|
38
|
+
'1ZP': 'WRC',
|
|
39
|
+
'2JQ': 'WRC',
|
|
40
|
+
'TA2': 'WRC',
|
|
41
|
+
// CROSS
|
|
42
|
+
'2JK': 'CROSS',
|
|
43
|
+
// BLUEGT
|
|
44
|
+
'2JE': 'BLUEGT',
|
|
45
|
+
// BLUEMOTION
|
|
46
|
+
'2JZ': 'BLUEMOTION',
|
|
47
|
+
'7L6': 'BLUEMOTION',
|
|
48
|
+
// R_LINE
|
|
49
|
+
'2JP': 'R_LINE',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Get variant category for a code (check map, fallback to passed value)
|
|
53
|
+
const getVariantCategory = (code: string, fallback?: string): string | undefined => {
|
|
54
|
+
return variantCategoryMap[code] || fallback;
|
|
55
|
+
};
|
|
25
56
|
</script>
|
|
26
57
|
|
|
27
58
|
<template>
|
|
@@ -30,28 +61,29 @@ const props = defineProps({
|
|
|
30
61
|
:key="prcode?.id || index"
|
|
31
62
|
class="not-last:mr-1"
|
|
32
63
|
>
|
|
33
|
-
<!-- Skip invalid entries -->
|
|
34
64
|
<template v-if="prcode?.code">
|
|
35
|
-
<!-- Handle normal PR codes -->
|
|
36
65
|
<PrCode
|
|
37
66
|
v-if="!prcode.code.includes('+')"
|
|
38
67
|
:prcode="prcode"
|
|
39
68
|
:isPdp="isPdp"
|
|
40
69
|
/>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
<span v-else class="inline-flex items-center gap-1">
|
|
71
|
+
<template v-for="(code, idx) in prcode.code.split('+')" :key="idx">
|
|
72
|
+
<span v-if="idx > 0" class="text-sm opacity-75 font-bold">+</span>
|
|
73
|
+
<span class="inline-flex items-center">
|
|
74
|
+
<span class="opacity-75">[</span>
|
|
75
|
+
<PrCode
|
|
76
|
+
:prcode="{
|
|
77
|
+
code: code.trim(),
|
|
78
|
+
group: prcode.group,
|
|
79
|
+
description: null,
|
|
80
|
+
variant_category: getVariantCategory(code.trim(), prcode.variant_category)
|
|
81
|
+
}"
|
|
82
|
+
:isPdp="isPdp"
|
|
83
|
+
/>
|
|
84
|
+
<span class="opacity-75">]</span>
|
|
85
|
+
</span>
|
|
86
|
+
</template>
|
|
55
87
|
</span>
|
|
56
88
|
</template>
|
|
57
89
|
</span>
|
|
@@ -198,12 +198,15 @@ When using data from the API, pass the `pr_codes` array directly:
|
|
|
198
198
|
- ✅ **Dark Mode**: Supports dark mode with appropriate color adjustments
|
|
199
199
|
- ✅ **Accessible**: Uses semantic HTML and proper ARIA attributes
|
|
200
200
|
- ✅ **Search Friendly**: Includes `data-pagefind-filter` for search indexing
|
|
201
|
-
- ✅ **Combination Support**: Handles combined PR codes like "
|
|
201
|
+
- ✅ **Combination Support**: Handles combined PR codes like "1AT+1ZR" with format `[1AT]+[1ZR]`
|
|
202
|
+
- ✅ **Individual Colors**: Each code in a combination gets its own color based on variant category
|
|
202
203
|
- ✅ **Defensive**: Gracefully handles invalid or malformed data
|
|
203
204
|
|
|
204
205
|
## Notes
|
|
205
206
|
|
|
206
207
|
- Hover over any PR code to see its full description
|
|
207
208
|
- Colors are based on semantic variant categories, not hardcoded per code
|
|
209
|
+
- Combined codes are displayed as `[CODE]+[CODE]` with each code colored independently
|
|
210
|
+
- The component uses a static mapping for variant categories to ensure consistent coloring
|
|
208
211
|
- The tooltip design matches the ProductEngine component style
|
|
209
212
|
- All 14,000+ PR codes in the database have English descriptions
|