spoko-design-system 1.20.0 → 1.21.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/.claude/settings.json +48 -48
- package/.github/dependabot.yml +11 -11
- package/.github/todo.yml +3 -3
- package/.github/workflows/claude.yml +37 -37
- package/.github/workflows/code-quality.yml +72 -72
- package/.github/workflows/deploy.yml +43 -43
- package/.husky/README.md +41 -41
- package/.husky/commit-msg +1 -1
- package/.husky/pre-commit +40 -40
- package/.prettierignore +14 -14
- package/.prettierrc +30 -30
- package/.stackblitzrc +5 -5
- package/.vscode/extensions.json +4 -4
- package/.vscode/launch.json +11 -11
- package/.vscode/settings.json +21 -21
- package/CHANGELOG.md +476 -462
- package/CLAUDE.md +268 -268
- package/LICENSE +21 -21
- package/README.md +303 -303
- package/TOOLTIPS.md +236 -236
- package/astro.config.mjs +84 -84
- package/commitlint.config.js +3 -3
- package/dev-dist/sw.js +91 -91
- package/dev-dist/workbox-c676b6d3.js +3391 -3391
- package/eslint.config.js +70 -70
- package/icon.config.ts +348 -348
- package/index.ts +78 -78
- package/package.json +160 -160
- package/public/arrow-bottom.svg +7 -7
- package/public/fonts/lg.svg +53 -53
- package/public/fonts/vwhead-bold-demo.html +549 -549
- package/public/fonts/vwhead-regular-demo.html +549 -549
- package/public/fonts/vwtext-bold-demo.html +549 -549
- package/public/fonts/vwtext-regular-demo.html +549 -549
- package/public/github.svg +3 -3
- package/public/grid_dot.svg +4 -4
- package/public/linkedin.svg +44 -44
- package/public/make-scrollable-code-focusable.js +3 -3
- package/public/pagefind.yml +3 -3
- package/public/polo.blue.svg +29 -29
- package/public/spoko.space.svg +71 -71
- package/public/twitter.svg +46 -46
- package/renovate.json +6 -6
- package/sandbox.config.json +11 -11
- package/sonar-project.properties +26 -26
- package/src/components/Category/CategoriesCarousel.astro +3 -7
- package/src/pages/components/badges.mdx +57 -57
- package/src/pages/components/breadcrumbs.mdx +139 -139
- package/src/pages/components/buttons.mdx +359 -359
- package/src/pages/components/card.mdx +294 -294
- package/src/pages/components/carousel.mdx +62 -62
- package/src/pages/components/copyright.mdx +42 -42
- package/src/pages/components/details-list.mdx +207 -207
- package/src/pages/components/features-list.mdx +37 -37
- package/src/pages/components/flags.mdx +49 -49
- package/src/pages/components/fuck-russia.mdx +39 -39
- package/src/pages/components/hand-drive.mdx +78 -78
- package/src/pages/components/headline.mdx +337 -337
- package/src/pages/components/image.mdx +513 -513
- package/src/pages/components/input.mdx +367 -367
- package/src/pages/components/jumbotron.mdx +530 -530
- package/src/pages/components/modal.mdx +212 -212
- package/src/pages/components/post-header.mdx +64 -64
- package/src/pages/components/pr-code.mdx +213 -213
- package/src/pages/components/product-engine.mdx +418 -418
- package/src/pages/components/product-number.mdx +58 -58
- package/src/pages/components/product-tile.mdx +51 -51
- package/src/pages/components/quote.mdx +33 -33
- package/src/pages/components/slimbanner.mdx +260 -260
- package/src/pages/components/table.mdx +108 -108
- package/src/pages/core/colors.mdx +21 -21
- package/src/pages/core/grid.mdx +193 -193
- package/src/pages/core/introduction.mdx +77 -77
- package/src/pages/core/tooltips.mdx +491 -491
- package/src/pages/patterns/introduction.mdx +60 -60
- package/src/styles/_variables.scss +70 -70
- package/tailwind.config.cjs +8 -8
- package/tsconfig.json +28 -28
- package/uno-config/index.ts +269 -269
- package/uno-config/theme/breakpoints.ts +9 -9
- package/uno-config/theme/colors.ts +65 -65
- package/uno-config/theme/dimensions.ts +17 -17
- package/uno-config/theme/effects.ts +14 -14
- package/uno-config/theme/grid.ts +10 -10
- package/uno-config/theme/index.ts +26 -26
- package/uno-config/theme/shortcuts/buttons.ts +53 -53
- package/uno-config/theme/shortcuts/components.ts +124 -124
- package/uno-config/theme/shortcuts/index.ts +20 -20
- package/uno-config/theme/shortcuts/jumbotron.ts +71 -71
- package/uno-config/theme/shortcuts/layout.ts +75 -75
- package/uno-config/theme/typography.ts +29 -29
- package/uno.config.ts +2 -2
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Carousel"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
import Carousel from '../../components/Carousel.astro'
|
|
6
|
-
import ProductCarousel from '../../components/ProductCarousel.astro'
|
|
7
|
-
|
|
8
|
-
# Carousel
|
|
9
|
-
|
|
10
|
-
Carousel - modern carousel based on Swiper Element (Web Component)
|
|
11
|
-
|
|
12
|
-
<div class="component-preview">
|
|
13
|
-
<Carousel />
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
<swiper-container
|
|
18
|
-
class="max-w-full w-full flex overflow-hidden"
|
|
19
|
-
grid-rows="1"
|
|
20
|
-
mousewheel-force-to-axis="true"
|
|
21
|
-
navigation="true"
|
|
22
|
-
pagination-type="fraction"
|
|
23
|
-
scrollbar="false"
|
|
24
|
-
slides-per-view="auto"
|
|
25
|
-
space-between="0"
|
|
26
|
-
>
|
|
27
|
-
<swiper-slide class="bg-blue-50 p-12 border-1 min-w-full">A</swiper-slide>
|
|
28
|
-
<swiper-slide class="bg-blue-100 p-12 border-1 min-w-full">B</swiper-slide>
|
|
29
|
-
<swiper-slide class="bg-blue-200 p-12 border-1 min-w-full">C</swiper-slide>
|
|
30
|
-
<swiper-slide class="bg-blue-300 p-12 border-1 min-w-full">D</swiper-slide>
|
|
31
|
-
<swiper-slide class="bg-blue-400 p-12 border-1 min-w-full">A</swiper-slide>
|
|
32
|
-
</swiper-container>
|
|
33
|
-
```
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
Find the code for this page in the `src/pages/components/carousel.mdx` file.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## Product Carousel
|
|
40
|
-
<div class="component-preview">
|
|
41
|
-
<ProductCarousel />
|
|
42
|
-
</div>
|
|
43
|
-
```html
|
|
44
|
-
<div class="bg-white rounded-lg p-4 w-full">
|
|
45
|
-
<swiper-container
|
|
46
|
-
class="flex w-full max-w-full"
|
|
47
|
-
grid-rows="1"
|
|
48
|
-
mousewheel-force-to-axis="true"
|
|
49
|
-
navigation="false"
|
|
50
|
-
scrollbar="false"
|
|
51
|
-
slides-per-view="auto"
|
|
52
|
-
space-between="0"
|
|
53
|
-
>
|
|
54
|
-
<swiper-slide
|
|
55
|
-
class="carousel-product-tile"
|
|
56
|
-
>
|
|
57
|
-
<ProductTile productObject={productObject} />
|
|
58
|
-
</swiper-slide>
|
|
59
|
-
...
|
|
60
|
-
</swiper-container>
|
|
61
|
-
</div>
|
|
62
|
-
```
|
|
1
|
+
---
|
|
2
|
+
title: "Carousel"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import Carousel from '../../components/Carousel.astro'
|
|
6
|
+
import ProductCarousel from '../../components/ProductCarousel.astro'
|
|
7
|
+
|
|
8
|
+
# Carousel
|
|
9
|
+
|
|
10
|
+
Carousel - modern carousel based on Swiper Element (Web Component)
|
|
11
|
+
|
|
12
|
+
<div class="component-preview">
|
|
13
|
+
<Carousel />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
<swiper-container
|
|
18
|
+
class="max-w-full w-full flex overflow-hidden"
|
|
19
|
+
grid-rows="1"
|
|
20
|
+
mousewheel-force-to-axis="true"
|
|
21
|
+
navigation="true"
|
|
22
|
+
pagination-type="fraction"
|
|
23
|
+
scrollbar="false"
|
|
24
|
+
slides-per-view="auto"
|
|
25
|
+
space-between="0"
|
|
26
|
+
>
|
|
27
|
+
<swiper-slide class="bg-blue-50 p-12 border-1 min-w-full">A</swiper-slide>
|
|
28
|
+
<swiper-slide class="bg-blue-100 p-12 border-1 min-w-full">B</swiper-slide>
|
|
29
|
+
<swiper-slide class="bg-blue-200 p-12 border-1 min-w-full">C</swiper-slide>
|
|
30
|
+
<swiper-slide class="bg-blue-300 p-12 border-1 min-w-full">D</swiper-slide>
|
|
31
|
+
<swiper-slide class="bg-blue-400 p-12 border-1 min-w-full">A</swiper-slide>
|
|
32
|
+
</swiper-container>
|
|
33
|
+
```
|
|
34
|
+
#
|
|
35
|
+
|
|
36
|
+
Find the code for this page in the `src/pages/components/carousel.mdx` file.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Product Carousel
|
|
40
|
+
<div class="component-preview">
|
|
41
|
+
<ProductCarousel />
|
|
42
|
+
</div>
|
|
43
|
+
```html
|
|
44
|
+
<div class="bg-white rounded-lg p-4 w-full">
|
|
45
|
+
<swiper-container
|
|
46
|
+
class="flex w-full max-w-full"
|
|
47
|
+
grid-rows="1"
|
|
48
|
+
mousewheel-force-to-axis="true"
|
|
49
|
+
navigation="false"
|
|
50
|
+
scrollbar="false"
|
|
51
|
+
slides-per-view="auto"
|
|
52
|
+
space-between="0"
|
|
53
|
+
>
|
|
54
|
+
<swiper-slide
|
|
55
|
+
class="carousel-product-tile"
|
|
56
|
+
>
|
|
57
|
+
<ProductTile productObject={productObject} />
|
|
58
|
+
</swiper-slide>
|
|
59
|
+
...
|
|
60
|
+
</swiper-container>
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Copyright"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
import Copyright from '../../components/Copyright.astro'
|
|
6
|
-
|
|
7
|
-
# Copyright
|
|
8
|
-
|
|
9
|
-
Copyright component
|
|
10
|
-
<div class="component-preview">
|
|
11
|
-
<Copyright class="w-full">
|
|
12
|
-
<div slot="left-item">left item</div>
|
|
13
|
-
<div slot="middle-item">middle item</div>
|
|
14
|
-
<div slot="right-item">right item</div>
|
|
15
|
-
</Copyright>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
<Copyright class="w-full" >
|
|
20
|
-
<div slot="left-item">left item</div>
|
|
21
|
-
<div slot="middle-item">middle item</div>
|
|
22
|
-
<div slot="right-item">right item</div>
|
|
23
|
-
</Copyright>
|
|
24
|
-
```
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
## Copyright with custom classes
|
|
28
|
-
<div class="component-preview">
|
|
29
|
-
<Copyright class="z-0 w-full">
|
|
30
|
-
<div slot="left-item">left item</div>
|
|
31
|
-
<div slot="middle-item">middle item</div>
|
|
32
|
-
<div slot="right-item">right item</div>
|
|
33
|
-
</Copyright>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
<Copyright class="fixed bottom-0 z-0 w-full" >
|
|
38
|
-
<div slot="left-item">left item</div>
|
|
39
|
-
<div slot="middle-item">middle item</div>
|
|
40
|
-
<div slot="right-item">right item</div>
|
|
41
|
-
</Copyright>
|
|
42
|
-
```
|
|
1
|
+
---
|
|
2
|
+
title: "Copyright"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import Copyright from '../../components/Copyright.astro'
|
|
6
|
+
|
|
7
|
+
# Copyright
|
|
8
|
+
|
|
9
|
+
Copyright component
|
|
10
|
+
<div class="component-preview">
|
|
11
|
+
<Copyright class="w-full">
|
|
12
|
+
<div slot="left-item">left item</div>
|
|
13
|
+
<div slot="middle-item">middle item</div>
|
|
14
|
+
<div slot="right-item">right item</div>
|
|
15
|
+
</Copyright>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
<Copyright class="w-full" >
|
|
20
|
+
<div slot="left-item">left item</div>
|
|
21
|
+
<div slot="middle-item">middle item</div>
|
|
22
|
+
<div slot="right-item">right item</div>
|
|
23
|
+
</Copyright>
|
|
24
|
+
```
|
|
25
|
+
#
|
|
26
|
+
|
|
27
|
+
## Copyright with custom classes
|
|
28
|
+
<div class="component-preview">
|
|
29
|
+
<Copyright class="z-0 w-full">
|
|
30
|
+
<div slot="left-item">left item</div>
|
|
31
|
+
<div slot="middle-item">middle item</div>
|
|
32
|
+
<div slot="right-item">right item</div>
|
|
33
|
+
</Copyright>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
<Copyright class="fixed bottom-0 z-0 w-full" >
|
|
38
|
+
<div slot="left-item">left item</div>
|
|
39
|
+
<div slot="middle-item">middle item</div>
|
|
40
|
+
<div slot="right-item">right item</div>
|
|
41
|
+
</Copyright>
|
|
42
|
+
```
|
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "DetailsList"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import ProductDetailsList from '../../components/ProductDetailsList.vue'
|
|
7
|
-
import ProductNumber from "../../components/Product/ProductNumber.astro"
|
|
8
|
-
import ProductCodes from '../../components/ProductCodes.vue'
|
|
9
|
-
|
|
10
|
-
export const prcodesArray = [
|
|
11
|
-
{ code: "PJ4", group: "BAV", description: "Disk brakes example" },
|
|
12
|
-
{ code: "CA2", group: "STF", description: "Standard equipment" },
|
|
13
|
-
{ code: "C4E", group: "AAU", description: "Air conditioning" },
|
|
14
|
-
{ code: "2JZ", group: "STF", description: "Standard bumpers (e.g. Polo 6R Bluemotion)", variant_category: "BLUEMOTION" }
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
export const tableItems = [
|
|
18
|
-
{
|
|
19
|
-
id: "number",
|
|
20
|
-
label: "Part number",
|
|
21
|
-
value: "6R0071609GRU",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "prcodes",
|
|
25
|
-
label: "PR-Codes",
|
|
26
|
-
value: prcodesArray,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "color",
|
|
30
|
-
label: "Color",
|
|
31
|
-
value: "Black",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "position",
|
|
35
|
-
label: "Fitting position",
|
|
36
|
-
value: "Front axle",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "brake-disck-thicnkess",
|
|
40
|
-
label: "Brake disc thicknes",
|
|
41
|
-
value: "22 mm",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "weight",
|
|
45
|
-
label: "Weight",
|
|
46
|
-
value: "5.185 kg"
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
# Product Details Table
|
|
51
|
-
|
|
52
|
-
<div class="component-preview flex-wrap">
|
|
53
|
-
<div class="bg-white rounded-lg p-8">
|
|
54
|
-
<ProductDetailsList items={tableItems}>
|
|
55
|
-
<td slot="number" class="pt-0">
|
|
56
|
-
<ProductNumber class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
57
|
-
</td>
|
|
58
|
-
<td slot="prcodes" class="pt-0">
|
|
59
|
-
<ProductCodes prcodes={prcodesArray} />
|
|
60
|
-
</td>
|
|
61
|
-
</ProductDetailsList>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
const prcodesArray = [
|
|
67
|
-
{ code: "PJ4", group: "BAV", description: "Disk brakes example" },
|
|
68
|
-
{ code: "CA2", group: "STF", description: "Standard equipment" },
|
|
69
|
-
{ code: "C4E", group: "AAU", description: "Air conditioning" }
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
const tableItems = [
|
|
73
|
-
{
|
|
74
|
-
id: "number",
|
|
75
|
-
label: "Part number",
|
|
76
|
-
value: "6R0071609GRU",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: "prcodes",
|
|
80
|
-
label: "PR-Codes",
|
|
81
|
-
value: prcodesArray
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: "color",
|
|
85
|
-
label: "Color",
|
|
86
|
-
value: "Black",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: "position",
|
|
90
|
-
label: "Fitting position",
|
|
91
|
-
value: "Front axle",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "brake-disck-thicnkess",
|
|
95
|
-
label: "Brake disc thicknes",
|
|
96
|
-
value: "22 mm",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
id: "weight",
|
|
100
|
-
label: "Weight",
|
|
101
|
-
value: "5.185 kg"
|
|
102
|
-
}
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
### Astro:
|
|
107
|
-
```js
|
|
108
|
-
<ProductDetailsList items={tableItems}>
|
|
109
|
-
<td slot="number" class="pt-0">
|
|
110
|
-
<ProductNumber class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
111
|
-
</td>
|
|
112
|
-
<td slot="prcodes" class="pt-0">
|
|
113
|
-
<ProductCodes prcodes={prcodesArray} />
|
|
114
|
-
</td>
|
|
115
|
-
</ProductDetailsList>
|
|
116
|
-
```
|
|
117
|
-
### Vue:
|
|
118
|
-
```js
|
|
119
|
-
<ProductDetailsList items={tableItems}>
|
|
120
|
-
<template #number >
|
|
121
|
-
<ProductNumber as="td" class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
122
|
-
</template>
|
|
123
|
-
<template #prcodes >
|
|
124
|
-
<ProductCodes as="td" prcodes={prcodesArray} />
|
|
125
|
-
</template>
|
|
126
|
-
</ProductDetailsList>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Props
|
|
130
|
-
|
|
131
|
-
### items
|
|
132
|
-
Array of table items with the following structure:
|
|
133
|
-
- `id` (string): Unique identifier for the row, also used for slot names
|
|
134
|
-
- `label` (string): Display name for the table header
|
|
135
|
-
- `value` (unknown): The value to display - can be string, number, boolean, string array, or Link array
|
|
136
|
-
- `type` (optional string): Set to `'links'` for link arrays
|
|
137
|
-
- `isGenericArray` (optional boolean): Set to `true` for generic string arrays
|
|
138
|
-
|
|
139
|
-
### caption
|
|
140
|
-
Optional string for the table caption.
|
|
141
|
-
|
|
142
|
-
## Value Types
|
|
143
|
-
|
|
144
|
-
The component supports multiple value types:
|
|
145
|
-
|
|
146
|
-
### Link Arrays
|
|
147
|
-
Use `type: 'links'` to display an array of links with icons:
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
{
|
|
151
|
-
id: "resources",
|
|
152
|
-
label: "Resources",
|
|
153
|
-
type: "links",
|
|
154
|
-
value: [
|
|
155
|
-
{ type: "blog", url: "https://example.com/blog", anchor: "Blog Post" },
|
|
156
|
-
{ type: "youtube", url: "https://youtube.com/watch", anchor: "Video Tutorial" },
|
|
157
|
-
{ type: "vimeo", url: "https://vimeo.com/123", anchor: "Demo Video" }
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Supported link types with icons:
|
|
163
|
-
- `blog` - Book text icon
|
|
164
|
-
- `youtube` - YouTube icon
|
|
165
|
-
- `vimeo` - Vimeo icon
|
|
166
|
-
- Default - Generic link icon
|
|
167
|
-
|
|
168
|
-
### Generic String Arrays
|
|
169
|
-
Use `isGenericArray: true` to display a bulleted list:
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
{
|
|
173
|
-
id: "position",
|
|
174
|
-
label: "Fitting position",
|
|
175
|
-
isGenericArray: true,
|
|
176
|
-
value: ["Front axle", "Rear axle"]
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### HTML Values
|
|
181
|
-
The component automatically detects and renders HTML strings:
|
|
182
|
-
|
|
183
|
-
```ts
|
|
184
|
-
{
|
|
185
|
-
id: "description",
|
|
186
|
-
label: "Description",
|
|
187
|
-
value: "Compatible with <span class='font-bold'>multiple models</span>"
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Simple Values
|
|
192
|
-
Strings, numbers, and booleans are displayed as-is:
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
{
|
|
196
|
-
id: "weight",
|
|
197
|
-
label: "Weight",
|
|
198
|
-
value: "5.185 kg"
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Slots
|
|
203
|
-
|
|
204
|
-
### caption
|
|
205
|
-
Override the default caption with custom content.
|
|
206
|
-
|
|
207
|
-
### Row-specific slots
|
|
1
|
+
---
|
|
2
|
+
title: "DetailsList"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import ProductDetailsList from '../../components/ProductDetailsList.vue'
|
|
7
|
+
import ProductNumber from "../../components/Product/ProductNumber.astro"
|
|
8
|
+
import ProductCodes from '../../components/ProductCodes.vue'
|
|
9
|
+
|
|
10
|
+
export const prcodesArray = [
|
|
11
|
+
{ code: "PJ4", group: "BAV", description: "Disk brakes example" },
|
|
12
|
+
{ code: "CA2", group: "STF", description: "Standard equipment" },
|
|
13
|
+
{ code: "C4E", group: "AAU", description: "Air conditioning" },
|
|
14
|
+
{ code: "2JZ", group: "STF", description: "Standard bumpers (e.g. Polo 6R Bluemotion)", variant_category: "BLUEMOTION" }
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
export const tableItems = [
|
|
18
|
+
{
|
|
19
|
+
id: "number",
|
|
20
|
+
label: "Part number",
|
|
21
|
+
value: "6R0071609GRU",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "prcodes",
|
|
25
|
+
label: "PR-Codes",
|
|
26
|
+
value: prcodesArray,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "color",
|
|
30
|
+
label: "Color",
|
|
31
|
+
value: "Black",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "position",
|
|
35
|
+
label: "Fitting position",
|
|
36
|
+
value: "Front axle",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "brake-disck-thicnkess",
|
|
40
|
+
label: "Brake disc thicknes",
|
|
41
|
+
value: "22 mm",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "weight",
|
|
45
|
+
label: "Weight",
|
|
46
|
+
value: "5.185 kg"
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
# Product Details Table
|
|
51
|
+
|
|
52
|
+
<div class="component-preview flex-wrap">
|
|
53
|
+
<div class="bg-white rounded-lg p-8">
|
|
54
|
+
<ProductDetailsList items={tableItems}>
|
|
55
|
+
<td slot="number" class="pt-0">
|
|
56
|
+
<ProductNumber class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
57
|
+
</td>
|
|
58
|
+
<td slot="prcodes" class="pt-0">
|
|
59
|
+
<ProductCodes prcodes={prcodesArray} />
|
|
60
|
+
</td>
|
|
61
|
+
</ProductDetailsList>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const prcodesArray = [
|
|
67
|
+
{ code: "PJ4", group: "BAV", description: "Disk brakes example" },
|
|
68
|
+
{ code: "CA2", group: "STF", description: "Standard equipment" },
|
|
69
|
+
{ code: "C4E", group: "AAU", description: "Air conditioning" }
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
const tableItems = [
|
|
73
|
+
{
|
|
74
|
+
id: "number",
|
|
75
|
+
label: "Part number",
|
|
76
|
+
value: "6R0071609GRU",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "prcodes",
|
|
80
|
+
label: "PR-Codes",
|
|
81
|
+
value: prcodesArray
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "color",
|
|
85
|
+
label: "Color",
|
|
86
|
+
value: "Black",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "position",
|
|
90
|
+
label: "Fitting position",
|
|
91
|
+
value: "Front axle",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "brake-disck-thicnkess",
|
|
95
|
+
label: "Brake disc thicknes",
|
|
96
|
+
value: "22 mm",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "weight",
|
|
100
|
+
label: "Weight",
|
|
101
|
+
value: "5.185 kg"
|
|
102
|
+
}
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
### Astro:
|
|
107
|
+
```js
|
|
108
|
+
<ProductDetailsList items={tableItems}>
|
|
109
|
+
<td slot="number" class="pt-0">
|
|
110
|
+
<ProductNumber class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
111
|
+
</td>
|
|
112
|
+
<td slot="prcodes" class="pt-0">
|
|
113
|
+
<ProductCodes prcodes={prcodesArray} />
|
|
114
|
+
</td>
|
|
115
|
+
</ProductDetailsList>
|
|
116
|
+
```
|
|
117
|
+
### Vue:
|
|
118
|
+
```js
|
|
119
|
+
<ProductDetailsList items={tableItems}>
|
|
120
|
+
<template #number >
|
|
121
|
+
<ProductNumber as="td" class="py-0" big isPdp productNumber="6R0071609GRU" copyDisabled={false} />
|
|
122
|
+
</template>
|
|
123
|
+
<template #prcodes >
|
|
124
|
+
<ProductCodes as="td" prcodes={prcodesArray} />
|
|
125
|
+
</template>
|
|
126
|
+
</ProductDetailsList>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Props
|
|
130
|
+
|
|
131
|
+
### items
|
|
132
|
+
Array of table items with the following structure:
|
|
133
|
+
- `id` (string): Unique identifier for the row, also used for slot names
|
|
134
|
+
- `label` (string): Display name for the table header
|
|
135
|
+
- `value` (unknown): The value to display - can be string, number, boolean, string array, or Link array
|
|
136
|
+
- `type` (optional string): Set to `'links'` for link arrays
|
|
137
|
+
- `isGenericArray` (optional boolean): Set to `true` for generic string arrays
|
|
138
|
+
|
|
139
|
+
### caption
|
|
140
|
+
Optional string for the table caption.
|
|
141
|
+
|
|
142
|
+
## Value Types
|
|
143
|
+
|
|
144
|
+
The component supports multiple value types:
|
|
145
|
+
|
|
146
|
+
### Link Arrays
|
|
147
|
+
Use `type: 'links'` to display an array of links with icons:
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
{
|
|
151
|
+
id: "resources",
|
|
152
|
+
label: "Resources",
|
|
153
|
+
type: "links",
|
|
154
|
+
value: [
|
|
155
|
+
{ type: "blog", url: "https://example.com/blog", anchor: "Blog Post" },
|
|
156
|
+
{ type: "youtube", url: "https://youtube.com/watch", anchor: "Video Tutorial" },
|
|
157
|
+
{ type: "vimeo", url: "https://vimeo.com/123", anchor: "Demo Video" }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Supported link types with icons:
|
|
163
|
+
- `blog` - Book text icon
|
|
164
|
+
- `youtube` - YouTube icon
|
|
165
|
+
- `vimeo` - Vimeo icon
|
|
166
|
+
- Default - Generic link icon
|
|
167
|
+
|
|
168
|
+
### Generic String Arrays
|
|
169
|
+
Use `isGenericArray: true` to display a bulleted list:
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
{
|
|
173
|
+
id: "position",
|
|
174
|
+
label: "Fitting position",
|
|
175
|
+
isGenericArray: true,
|
|
176
|
+
value: ["Front axle", "Rear axle"]
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### HTML Values
|
|
181
|
+
The component automatically detects and renders HTML strings:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
{
|
|
185
|
+
id: "description",
|
|
186
|
+
label: "Description",
|
|
187
|
+
value: "Compatible with <span class='font-bold'>multiple models</span>"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Simple Values
|
|
192
|
+
Strings, numbers, and booleans are displayed as-is:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
{
|
|
196
|
+
id: "weight",
|
|
197
|
+
label: "Weight",
|
|
198
|
+
value: "5.185 kg"
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Slots
|
|
203
|
+
|
|
204
|
+
### caption
|
|
205
|
+
Override the default caption with custom content.
|
|
206
|
+
|
|
207
|
+
### Row-specific slots
|
|
208
208
|
Use the row's `id` as the slot name to override the default value rendering. The slot receives the entire row as slot props.
|