spoko-design-system 1.5.1 → 1.5.3

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.5.3](https://github.com/polo-blue/sds/compare/v1.5.2...v1.5.3) (2025-10-28)
2
+
3
+ ### Bug Fixes
4
+
5
+ * remove brackets from combined PR code display ([aabb786](https://github.com/polo-blue/sds/commit/aabb78618f994dadac50605b708455ffbb5f21e5))
6
+
7
+ ## [1.5.2](https://github.com/polo-blue/sds/compare/v1.5.1...v1.5.2) (2025-10-28)
8
+
9
+ ### Bug Fixes
10
+
11
+ * improve combined PR code display and color handling ([e9bb13d](https://github.com/polo-blue/sds/commit/e9bb13d5500ba5ef0be527bf79b75e14fc49e6fe))
12
+
1
13
  ## [1.5.1](https://github.com/polo-blue/sds/compare/v1.5.0...v1.5.1) (2025-10-27)
2
14
 
3
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -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,25 @@ 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
- <!-- Handle combined PR codes like "1KD+2JP" -->
43
- <span v-else>
44
- <PrCode
45
- v-for="(code, idx) in prcode.code.split('+')"
46
- :key="idx"
47
- :prcode="{
48
- code: code.trim(),
49
- group: prcode.group,
50
- description: null,
51
- variant_category: prcode.variant_category
52
- }"
53
- :isPdp="isPdp"
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">+</span>
73
+ <PrCode
74
+ :prcode="{
75
+ code: code.trim(),
76
+ group: prcode.group,
77
+ description: null,
78
+ variant_category: getVariantCategory(code.trim(), prcode.variant_category)
79
+ }"
80
+ :isPdp="isPdp"
81
+ />
82
+ </template>
55
83
  </span>
56
84
  </template>
57
85
  </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 "1KD+2JP"
201
+ - ✅ **Combination Support**: Handles combined PR codes like "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