spoko-design-system 0.8.0 → 0.8.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/package.json CHANGED
@@ -1,124 +1,124 @@
1
- {
2
- "name": "spoko-design-system",
3
- "version": "0.8.0",
4
- "private": false,
5
- "main": "./index.ts",
6
- "module": "./index.ts",
7
- "types": "./index.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./index.ts",
11
- "require": "./index.ts"
12
- },
13
- "./styles/*": "./src/styles/*",
14
- "./icons": "./icon.config.ts",
15
- "./icon-collections": "./icon.collections.ts",
16
- "./uno-config": "./uno-config/index.ts"
17
- },
18
- "scripts": {
19
- "dev": "astro dev",
20
- "start": "astro dev",
21
- "build": "astro build",
22
- "preview": "astro preview"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "https://github.com/polo-blue/sds"
27
- },
28
- "author": {
29
- "name": "spokospace",
30
- "email": "szymon@spoko.space",
31
- "url": "https://spoko.space"
32
- },
33
- "homepage": "https://sds.spoko.space/",
34
- "license": "MIT",
35
- "keywords": [
36
- "astro-starter",
37
- "seo",
38
- "astro",
39
- "sds design system",
40
- "spoko design system"
41
- ],
42
- "dependencies": {
43
- "@algolia/client-search": "^5.27.0",
44
- "@astrojs/mdx": "^4.3.0",
45
- "@astrojs/node": "^9.2.2",
46
- "@astrojs/sitemap": "^3.4.1",
47
- "@astrojs/ts-plugin": "^1.10.4",
48
- "@astrojs/vue": "^5.1.0",
49
- "@docsearch/css": "^3.9.0",
50
- "@iconify-json/ant-design": "^1.2.5",
51
- "@iconify-json/bi": "^1.2.4",
52
- "@iconify-json/bx": "^1.2.2",
53
- "@iconify-json/carbon": "^1.2.9",
54
- "@iconify-json/circle-flags": "^1.2.6",
55
- "@iconify-json/ei": "^1.2.2",
56
- "@iconify-json/el": "^1.2.1",
57
- "@iconify-json/eos-icons": "^1.2.2",
58
- "@iconify-json/et": "^1.2.1",
59
- "@iconify-json/flowbite": "^1.2.5",
60
- "@iconify-json/fluent": "^1.2.23",
61
- "@iconify-json/fluent-emoji": "1.2.3",
62
- "@iconify-json/ic": "^1.2.2",
63
- "@iconify-json/icon-park-outline": "^1.2.2",
64
- "@iconify-json/la": "^1.2.1",
65
- "@iconify-json/material-symbols-light": "^1.2.26",
66
- "@iconify-json/mdi": "^1.2.3",
67
- "@iconify-json/noto-v1": "^1.2.2",
68
- "@iconify-json/octicon": "^1.2.6",
69
- "@iconify-json/ph": "^1.2.2",
70
- "@iconify-json/simple-icons": "^1.2.38",
71
- "@iconify-json/system-uicons": "^1.2.2",
72
- "@iconify-json/uil": "^1.2.3",
73
- "@iconify/json": "^2.2.348",
74
- "@iconify/vue": "^5.0.0",
75
- "@playform/compress": "^0.2.0",
76
- "@playform/inline": "^0.1.2",
77
- "@unocss/astro": "66.2.0",
78
- "@unocss/preset-attributify": "66.2.0",
79
- "@unocss/preset-typography": "66.2.0",
80
- "@unocss/preset-uno": "66.2.0",
81
- "@unocss/preset-web-fonts": "66.2.0",
82
- "@unocss/preset-wind": "66.2.0",
83
- "@unocss/reset": "66.2.0",
84
- "@vite-pwa/astro": "^1.1.0",
85
- "@vueuse/core": "^13.3.0",
86
- "astro-i18next": "1.0.0-beta.21",
87
- "astro-icon": "^1.1.5",
88
- "astro-meta-tags": "^0.3.2",
89
- "astro-navbar": "^2.3.9",
90
- "astro-pagefind": "^1.8.3",
91
- "astro-remote": "^0.3.4",
92
- "dotenv": "^16.5.0",
93
- "i18next": "^25.2.1",
94
- "i18next-browser-languagedetector": "^8.2.0",
95
- "i18next-fs-backend": "^2.6.0",
96
- "i18next-http-backend": "^3.0.2",
97
- "i18next-vue": "^5.3.0",
98
- "swiper": "^11.2.8",
99
- "unocss": "66.2.0",
100
- "vue": "^3.5.16"
101
- },
102
- "devDependencies": {
103
- "@types/gtag.js": "^0.0.20",
104
- "@types/node": "^24.0.1",
105
- "@unocss/transformer-variant-group": "66.2.0",
106
- "@vitejs/plugin-vue": "^5.2.4",
107
- "@vue/compiler-sfc": "^3.5.16",
108
- "astro": "^5.9.2",
109
- "unocss": "^0.65.0",
110
- "vite": "^6.3.5"
111
- },
112
- "packageManager": "pnpm@9.15.3",
113
- "pnpm": {
114
- "default": "9.15.3",
115
- "overrides": {
116
- "file-type@>=17.0.0 <17.1.3": ">=17.1.3",
117
- "sharp@<0.30.5": ">=0.30.5"
118
- }
119
- },
120
- "engines": {
121
- "node": ">=18.14.1",
122
- "pnpm": ">=9.15.3"
123
- }
1
+ {
2
+ "name": "spoko-design-system",
3
+ "version": "0.8.2",
4
+ "private": false,
5
+ "main": "./index.ts",
6
+ "module": "./index.ts",
7
+ "types": "./index.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./index.ts",
11
+ "require": "./index.ts"
12
+ },
13
+ "./styles/*": "./src/styles/*",
14
+ "./icons": "./icon.config.ts",
15
+ "./icon-collections": "./icon.collections.ts",
16
+ "./uno-config": "./uno-config/index.ts"
17
+ },
18
+ "scripts": {
19
+ "dev": "astro dev",
20
+ "start": "astro dev",
21
+ "build": "astro build",
22
+ "preview": "astro preview"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/polo-blue/sds"
27
+ },
28
+ "author": {
29
+ "name": "spokospace",
30
+ "email": "szymon@spoko.space",
31
+ "url": "https://spoko.space"
32
+ },
33
+ "homepage": "https://sds.spoko.space/",
34
+ "license": "MIT",
35
+ "keywords": [
36
+ "astro-starter",
37
+ "seo",
38
+ "astro",
39
+ "sds design system",
40
+ "spoko design system"
41
+ ],
42
+ "dependencies": {
43
+ "@algolia/client-search": "^5.29.0",
44
+ "@astrojs/mdx": "^4.3.0",
45
+ "@astrojs/node": "^9.2.2",
46
+ "@astrojs/sitemap": "^3.4.1",
47
+ "@astrojs/ts-plugin": "^1.10.4",
48
+ "@astrojs/vue": "^5.1.0",
49
+ "@docsearch/css": "^3.9.0",
50
+ "@iconify-json/ant-design": "^1.2.5",
51
+ "@iconify-json/bi": "^1.2.4",
52
+ "@iconify-json/bx": "^1.2.2",
53
+ "@iconify-json/carbon": "^1.2.10",
54
+ "@iconify-json/circle-flags": "^1.2.6",
55
+ "@iconify-json/ei": "^1.2.2",
56
+ "@iconify-json/el": "^1.2.1",
57
+ "@iconify-json/eos-icons": "^1.2.2",
58
+ "@iconify-json/et": "^1.2.1",
59
+ "@iconify-json/flowbite": "^1.2.5",
60
+ "@iconify-json/fluent": "^1.2.25",
61
+ "@iconify-json/fluent-emoji": "1.2.3",
62
+ "@iconify-json/ic": "^1.2.2",
63
+ "@iconify-json/icon-park-outline": "^1.2.2",
64
+ "@iconify-json/la": "^1.2.1",
65
+ "@iconify-json/material-symbols-light": "^1.2.27",
66
+ "@iconify-json/mdi": "^1.2.3",
67
+ "@iconify-json/noto-v1": "^1.2.2",
68
+ "@iconify-json/octicon": "^1.2.6",
69
+ "@iconify-json/ph": "^1.2.2",
70
+ "@iconify-json/simple-icons": "^1.2.39",
71
+ "@iconify-json/system-uicons": "^1.2.2",
72
+ "@iconify-json/uil": "^1.2.3",
73
+ "@iconify/json": "^2.2.351",
74
+ "@iconify/vue": "^5.0.0",
75
+ "@playform/compress": "^0.2.0",
76
+ "@playform/inline": "^0.1.2",
77
+ "@unocss/astro": "66.2.3",
78
+ "@unocss/preset-attributify": "66.2.3",
79
+ "@unocss/preset-typography": "66.2.3",
80
+ "@unocss/preset-uno": "66.2.3",
81
+ "@unocss/preset-web-fonts": "66.2.3",
82
+ "@unocss/preset-wind": "66.2.3",
83
+ "@unocss/reset": "66.2.3",
84
+ "@vite-pwa/astro": "^1.1.0",
85
+ "@vueuse/core": "^13.4.0",
86
+ "astro-i18next": "1.0.0-beta.21",
87
+ "astro-icon": "^1.1.5",
88
+ "astro-meta-tags": "^0.3.2",
89
+ "astro-navbar": "^2.4.0",
90
+ "astro-pagefind": "^1.8.3",
91
+ "astro-remote": "^0.3.4",
92
+ "dotenv": "^16.5.0",
93
+ "i18next": "^25.2.1",
94
+ "i18next-browser-languagedetector": "^8.2.0",
95
+ "i18next-fs-backend": "^2.6.0",
96
+ "i18next-http-backend": "^3.0.2",
97
+ "i18next-vue": "^5.3.0",
98
+ "swiper": "^11.2.8",
99
+ "unocss": "66.2.3",
100
+ "vue": "^3.5.17"
101
+ },
102
+ "devDependencies": {
103
+ "@types/gtag.js": "^0.0.20",
104
+ "@types/node": "^24.0.3",
105
+ "@unocss/transformer-variant-group": "66.2.3",
106
+ "@vitejs/plugin-vue": "^5.2.4",
107
+ "@vue/compiler-sfc": "^3.5.17",
108
+ "astro": "^5.10.1",
109
+ "unocss": "^0.65.0",
110
+ "vite": "^6.3.5"
111
+ },
112
+ "packageManager": "pnpm@9.15.3",
113
+ "pnpm": {
114
+ "default": "9.15.3",
115
+ "overrides": {
116
+ "file-type@>=17.0.0 <17.1.3": ">=17.1.3",
117
+ "sharp@<0.30.5": ">=0.30.5"
118
+ }
119
+ },
120
+ "engines": {
121
+ "node": ">=18.14.1",
122
+ "pnpm": ">=9.15.3"
123
+ }
124
124
  }
@@ -2,12 +2,26 @@
2
2
  import { PropType, computed } from "vue";
3
3
  import ProductDetailName from "./ProductDetailName.vue";
4
4
 
5
+ interface ColorCode {
6
+ code: string;
7
+ name: string;
8
+ }
9
+
10
+ interface PaintMark {
11
+ count: number;
12
+ color: string;
13
+ }
14
+
5
15
  interface TableItem {
6
16
  id: string;
7
17
  name: string;
8
18
  value: unknown;
9
19
  translated?: boolean;
10
20
  icon?: boolean;
21
+ isArrayValue?: boolean;
22
+ isColorArray?: boolean;
23
+ isPaintMarks?: boolean;
24
+ isGenericArray?: boolean;
11
25
  }
12
26
 
13
27
  interface GroupedLink {
@@ -28,11 +42,31 @@ const isLink = (id: string) => {
28
42
  return ['blog', 'youtube', 'vimeo'].includes(id);
29
43
  };
30
44
 
45
+ // Function for checking if it's a color array
46
+ const isColorArray = (item: TableItem) => {
47
+ return item.isColorArray && Array.isArray(item.value);
48
+ };
49
+
50
+ // Function for checking if it's paint marks
51
+ const isPaintMarks = (item: TableItem) => {
52
+ return item.isPaintMarks && Array.isArray(item.value);
53
+ };
54
+
55
+ // Function for checking if it's a generic array
56
+ const isGenericArray = (item: TableItem) => {
57
+ return item.isGenericArray && Array.isArray(item.value);
58
+ };
59
+
60
+ // Function to check if value is HTML string (fallback)
61
+ const isHtmlValue = (value: unknown): boolean => {
62
+ return typeof value === 'string' && (value.includes('<span') || value.includes('<br>'));
63
+ };
64
+
31
65
  // Function for specifying header text
32
66
  const getHeaderText = (row: TableItem | GroupedLink) => {
33
67
  // For the blog, we use id instead of name
34
68
  if (row.id === 'blog') {
35
- return row.id.charAt(0).toUpperCase() + row.id.slice(1); // "Blog" z dużej litery
69
+ return row.id.charAt(0).toUpperCase() + row.id.slice(1);
36
70
  }
37
71
 
38
72
  // For other types, we use name (if it is GroupedLink, there is no name)
@@ -70,7 +104,7 @@ const groupedItems = computed(() => {
70
104
  });
71
105
  }
72
106
 
73
- // Dodajemy link do odpowiedniej grupy
107
+ // Add link to the relevant group
74
108
  linkGroups.get(item.id)?.links.push({
75
109
  name: item.name,
76
110
  value: item.value as string
@@ -120,6 +154,39 @@ const groupedItems = computed(() => {
120
154
  </ul>
121
155
  </td>
122
156
 
157
+ <!-- Special handling for color arrays (already translated) -->
158
+ <td v-else-if="'id' in row && isColorArray(row)" class="details-table-cell">
159
+ <ul>
160
+ <li v-for="(colorItem, colorIndex) in (row.value as ColorCode[])" :key="colorIndex"
161
+ class="flex items-center gap-1 mb-1 last:mb-0">
162
+ <code>
163
+ {{ colorItem.code }}
164
+ </code>
165
+ <span class="text-gray-400">-</span>
166
+ <span class="text-gray-700 dark:text-gray-300">{{ colorItem.name }}</span>
167
+ </li>
168
+ </ul>
169
+ </td>
170
+
171
+ <!-- Special handling for paint marks (already translated) -->
172
+ <td v-else-if="'id' in row && isPaintMarks(row)" class="details-table-cell">
173
+ <span class="text-gray-700 dark:text-gray-300">{{ row.value }}</span>
174
+ </td>
175
+
176
+ <!-- Generic array handling (bullet list) -->
177
+ <td v-else-if="'id' in row && isGenericArray(row)" class="details-table-cell">
178
+ <ul class="list-none p-0 m-0">
179
+ <li v-for="(item, itemIndex) in (row.value as string[])" :key="itemIndex"
180
+ class="flex items-start gap-2 mb-1 last:mb-0 leading-relaxed">
181
+ <span class="text-gray-500 font-bold flex-shrink-0 mt-0.5">·</span>
182
+ <span class="text-gray-700 dark:text-gray-300 text-sm">{{ item }}</span>
183
+ </li>
184
+ </ul>
185
+ </td>
186
+
187
+ <!-- Handling HTML values (fallback for already formatted HTML) -->
188
+ <td v-else-if="'id' in row && isHtmlValue(row.value)" class="details-table-cell" v-html="row.value"></td>
189
+
123
190
  <!-- Support for standard types -->
124
191
  <slot v-else-if="'id' in row" :name="row.id">
125
192
  <td class="details-table-cell">{{ row.value }}</td>
@@ -127,4 +194,4 @@ const groupedItems = computed(() => {
127
194
  </tr>
128
195
  </tbody>
129
196
  </table>
130
- </template>
197
+ </template>