spoko-design-system 0.2.85 → 0.2.87
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/astro.config.mjs +4 -66
- package/icon.config.ts +225 -0
- package/package.json +8 -3
- package/src/components/Badges.vue +1 -1
- package/src/components/Category/CategoriesCarousel.astro +1 -1
- package/src/components/Category/CategoryDetails.astro +12 -12
- package/src/components/Category/CategoryViewToggler.astro +16 -8
- package/src/components/Header/Header.astro +1 -1
- package/src/components/Modal.astro +1 -1
- package/src/components/Product/ProductDetails.vue +1 -1
- package/src/components/Product/ProductLink.astro +1 -1
- package/src/components/Product/ProductLink.vue +1 -1
- package/src/design.config.ts +76 -58
- package/src/pages/components/card.mdx +6 -6
- package/src/pages/components/icons.astro +126 -38
- package/src/pages/components/input.mdx +4 -4
- package/src/styles/_variables.scss +2 -2
- package/src/styles/content.css +1 -1
- package/src/uno-config/index.ts +59 -0
- package/src/uno-config/theme/breakpoints.ts +10 -0
- package/src/uno-config/theme/colors.ts +67 -0
- package/src/uno-config/theme/dimensions.ts +18 -0
- package/src/uno-config/theme/effects.ts +15 -0
- package/src/uno-config/theme/grid.ts +11 -0
- package/src/uno-config/theme/index.ts +26 -0
- package/src/uno-config/theme/shortcuts/buttons.ts +36 -0
- package/src/uno-config/theme/shortcuts/components.ts +62 -0
- package/src/uno-config/theme/shortcuts/index.ts +15 -0
- package/src/uno-config/theme/shortcuts/layout.ts +55 -0
- package/src/uno-config/theme/typography.ts +30 -0
- package/uno.config.ts +3 -250
package/astro.config.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineConfig, sharpImageService } from "astro/config";
|
|
2
|
+
import { iconConfig } from './icon.config';
|
|
2
3
|
import vue from "@astrojs/vue";
|
|
3
4
|
import mdx from '@astrojs/mdx';
|
|
4
5
|
import UnoCSS from '@unocss/astro';
|
|
5
|
-
// import Compress from "astro-compress";
|
|
6
|
-
// https://github.com/yassinedoghri/astro-i18next#readme
|
|
7
6
|
import astroI18next from "astro-i18next";
|
|
8
7
|
import icon from "astro-icon";
|
|
9
8
|
import sitemap from "@astrojs/sitemap";
|
|
10
9
|
import pagefind from "astro-pagefind";
|
|
11
10
|
import AstroPWA from '@vite-pwa/astro';
|
|
12
11
|
import metaTags from "astro-meta-tags";
|
|
12
|
+
import playformInline from "@playform/inline";
|
|
13
13
|
|
|
14
14
|
// https://astro.build/config
|
|
15
15
|
export default defineConfig({
|
|
@@ -74,70 +74,8 @@ export default defineConfig({
|
|
|
74
74
|
}
|
|
75
75
|
}), UnoCSS({
|
|
76
76
|
injectReset: true
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
// mdi: ["*"], // (Default) Loads entire Material Design Icon set
|
|
80
|
-
mdi: ["npm", "github", "facebook", "instagram", "post-it-note-edit-outline", "car-hatchback", "car-door", "car-side", "car-windshield-outline", "car-light-alert", "car-tire-alert", "car-light-dimmed", "car-light-fog", "car-light-high", "car-parking-lights", "car-esp", "car-brake-abs", "car-horn", "engine-outline", "fan", "fan-off", "air-conditioner", "coolant-temperature", "car-brake-alert", "car-traction-control", "card-text-outline", "fuel", "oil", "hazard-lights", "credit-card-outline"],
|
|
81
|
-
"ant-design": ["menu-fold-outlined", "menu-unfold-outlined", "menu-outlined", "cluster-outlined", "audit-outlined", "build-twotone", "home-outlined", "close-outlined"],
|
|
82
|
-
bi: ["envelope-open", "credit-card", "qr-code", "list-check", "list-task", "text-indent-left", "text-indent-right", "tag", "tags", "x"],
|
|
83
|
-
bx: ["arrow-back", "check", "detail", "file", "car", "credit-card", "barcode", "qr"],
|
|
84
|
-
carbon: ["language", "checkmark", "home", "dicom-overlay"],
|
|
85
|
-
el: ["star-empty", "star", "heart-empty", "heart", "map-marker", "fire", "quote-right", "qrcode", "car", "indent-left", "indent-right", "ok"],
|
|
86
|
-
'eos-icons': ["three-dots-loading", "bubble-loading", "loading", "installing"],
|
|
87
|
-
fluent: ["share-android-24-regular", "checkmark-24-filled", "tag-24-regular", "tag-multiple-24-regular"],
|
|
88
|
-
"fluent-emoji": ["cookie", "construction", "warning", "wrench"],
|
|
89
|
-
la: ["arrow-right", "arrow-left", "car", "car-side"],
|
|
90
|
-
octicon: ["chevron-left-24", "x-24", "alert-24", "graph-24", "comment-24", "comment-discussion-24", "clock-24", "star-24", "star-fill-24", "file-media-24", "heart-24", "heart-fill-24", "project-roadmap-24", "location-24", "info-24", "mark-github-16"],
|
|
91
|
-
uil: ["map-marker", "envelope", "phone", "tag-alt"],
|
|
92
|
-
"simple-icons": ["ebay", "allegro", "volkswagen", "audi", "skoda", "seat", "whatsapp", "x", "facebook", "messenger", "instagram", "telegram"],
|
|
93
|
-
"icon-park-outline": ["shopping-bag", "comment", "comments", "tag-one"],
|
|
94
|
-
flowbite: ["arrow-left-outline", "arrow-right-outline", "angle-left-outline", "angle-right-outline", "chevron-left-outline", "chevron-right-outline", "map-location-outline", "map-pin-alt-solid", "x-outline", "messages-outline", "arrow-down-to-bracket-outline", "check-outline"]
|
|
95
|
-
}
|
|
96
|
-
}), // CSS: true,
|
|
97
|
-
// HTML: {
|
|
98
|
-
// caseSensitive: true,
|
|
99
|
-
// collapseBooleanAttributes: true,
|
|
100
|
-
// collapseInlineTagWhitespace: false,
|
|
101
|
-
// collapseWhitespace: true,
|
|
102
|
-
// conservativeCollapse: false,
|
|
103
|
-
// continueOnParseError: false,
|
|
104
|
-
// customAttrAssign: [],
|
|
105
|
-
// customAttrCollapse: "",
|
|
106
|
-
// customAttrSurround: [],
|
|
107
|
-
// customEventAttributes: [/^on[a-z]{3,}$/],
|
|
108
|
-
// decodeEntities: false,
|
|
109
|
-
// html5: true,
|
|
110
|
-
// ignoreCustomComments: [],
|
|
111
|
-
// ignoreCustomFragments: [],
|
|
112
|
-
// includeAutoGeneratedTags: true,
|
|
113
|
-
// keepClosingSlash: true,
|
|
114
|
-
// maxLineLength: null,
|
|
115
|
-
// minifyCSS: true,
|
|
116
|
-
// minifyJS: true,
|
|
117
|
-
// minifyURLs: false,
|
|
118
|
-
// preserveLineBreaks: false,
|
|
119
|
-
// preventAttributesEscaping: false,
|
|
120
|
-
// processConditionalComments: true,
|
|
121
|
-
// processScripts: ["module"],
|
|
122
|
-
// quoteCharacter: "",
|
|
123
|
-
// removeAttributeQuotes: true,
|
|
124
|
-
// removeComments: false,
|
|
125
|
-
// removeEmptyAttributes: false,
|
|
126
|
-
// removeEmptyElements: false,
|
|
127
|
-
// removeOptionalTags: false,
|
|
128
|
-
// removeRedundantAttributes: true,
|
|
129
|
-
// removeScriptTypeAttributes: true,
|
|
130
|
-
// removeStyleLinkTypeAttributes: true,
|
|
131
|
-
// removeTagWhitespace: true,
|
|
132
|
-
// sortAttributes: true,
|
|
133
|
-
// sortClassName: true,
|
|
134
|
-
// trimCustomFragments: false,
|
|
135
|
-
// useShortDoctype: false
|
|
136
|
-
// },
|
|
137
|
-
// Image: false,
|
|
138
|
-
// JavaScript: true,
|
|
139
|
-
// SVG: true
|
|
140
|
-
// }),
|
|
77
|
+
}),
|
|
78
|
+
icon(iconConfig),
|
|
141
79
|
metaTags(),
|
|
142
80
|
(await import("@playform/inline")).default(),
|
|
143
81
|
pagefind(),
|
package/icon.config.ts
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
interface IconConfig {
|
|
2
|
+
include: {
|
|
3
|
+
[key: string]: string[];
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const iconConfig: IconConfig = {
|
|
8
|
+
include: {
|
|
9
|
+
mdi: [
|
|
10
|
+
// Social
|
|
11
|
+
"npm",
|
|
12
|
+
"github",
|
|
13
|
+
"facebook",
|
|
14
|
+
"instagram",
|
|
15
|
+
|
|
16
|
+
// Notes & Content
|
|
17
|
+
"post-it-note-edit-outline",
|
|
18
|
+
|
|
19
|
+
// Car related
|
|
20
|
+
"car-hatchback",
|
|
21
|
+
"car-door",
|
|
22
|
+
"car-side",
|
|
23
|
+
"car-windshield-outline",
|
|
24
|
+
"car-light-alert",
|
|
25
|
+
"car-tire-alert",
|
|
26
|
+
"car-light-dimmed",
|
|
27
|
+
"car-light-fog",
|
|
28
|
+
"car-light-high",
|
|
29
|
+
"car-parking-lights",
|
|
30
|
+
"car-esp",
|
|
31
|
+
"car-brake-abs",
|
|
32
|
+
"car-horn",
|
|
33
|
+
"engine-outline",
|
|
34
|
+
|
|
35
|
+
// Climate & Temperature
|
|
36
|
+
"fan",
|
|
37
|
+
"fan-off",
|
|
38
|
+
"air-conditioner",
|
|
39
|
+
"coolant-temperature",
|
|
40
|
+
|
|
41
|
+
// Alerts & Warnings
|
|
42
|
+
"car-brake-alert",
|
|
43
|
+
"car-traction-control",
|
|
44
|
+
|
|
45
|
+
// Other
|
|
46
|
+
"card-text-outline",
|
|
47
|
+
"fuel",
|
|
48
|
+
"oil",
|
|
49
|
+
"hazard-lights",
|
|
50
|
+
"credit-card-outline"
|
|
51
|
+
],
|
|
52
|
+
|
|
53
|
+
"ant-design": [
|
|
54
|
+
"menu-fold-outlined",
|
|
55
|
+
"menu-unfold-outlined",
|
|
56
|
+
"menu-outlined",
|
|
57
|
+
"bars-outlined",
|
|
58
|
+
"appstore-outlined",
|
|
59
|
+
"cluster-outlined",
|
|
60
|
+
"audit-outlined",
|
|
61
|
+
"build-twotone",
|
|
62
|
+
"home-outlined",
|
|
63
|
+
"close-outlined"
|
|
64
|
+
],
|
|
65
|
+
|
|
66
|
+
bi: [
|
|
67
|
+
"envelope-open",
|
|
68
|
+
"credit-card",
|
|
69
|
+
"qr-code",
|
|
70
|
+
"list-check",
|
|
71
|
+
"list-task",
|
|
72
|
+
"text-indent-left",
|
|
73
|
+
"text-indent-right",
|
|
74
|
+
"tag",
|
|
75
|
+
"tags",
|
|
76
|
+
"x",
|
|
77
|
+
"graph-up"
|
|
78
|
+
],
|
|
79
|
+
|
|
80
|
+
bx: [
|
|
81
|
+
"arrow-back",
|
|
82
|
+
"check",
|
|
83
|
+
"detail",
|
|
84
|
+
"file",
|
|
85
|
+
"car",
|
|
86
|
+
"credit-card",
|
|
87
|
+
"barcode",
|
|
88
|
+
"qr"
|
|
89
|
+
],
|
|
90
|
+
|
|
91
|
+
carbon: [
|
|
92
|
+
"language",
|
|
93
|
+
"checkmark",
|
|
94
|
+
"home",
|
|
95
|
+
"dicom-overlay"
|
|
96
|
+
],
|
|
97
|
+
|
|
98
|
+
el: [
|
|
99
|
+
"star-empty",
|
|
100
|
+
"star",
|
|
101
|
+
"heart-empty",
|
|
102
|
+
"heart",
|
|
103
|
+
"map-marker",
|
|
104
|
+
"fire",
|
|
105
|
+
"quote-right",
|
|
106
|
+
"qrcode",
|
|
107
|
+
"car",
|
|
108
|
+
"indent-left",
|
|
109
|
+
"indent-right",
|
|
110
|
+
"ok"
|
|
111
|
+
],
|
|
112
|
+
|
|
113
|
+
'eos-icons': [
|
|
114
|
+
"three-dots-loading",
|
|
115
|
+
"bubble-loading",
|
|
116
|
+
"loading",
|
|
117
|
+
"installing"
|
|
118
|
+
],
|
|
119
|
+
|
|
120
|
+
fluent: [
|
|
121
|
+
"share-android-24-regular",
|
|
122
|
+
"checkmark-24-filled",
|
|
123
|
+
"tag-24-regular",
|
|
124
|
+
"tag-multiple-24-regular"
|
|
125
|
+
],
|
|
126
|
+
|
|
127
|
+
"fluent-emoji": [
|
|
128
|
+
"cookie",
|
|
129
|
+
"construction",
|
|
130
|
+
"warning",
|
|
131
|
+
"wrench"
|
|
132
|
+
],
|
|
133
|
+
|
|
134
|
+
la: [
|
|
135
|
+
"arrow-right",
|
|
136
|
+
"arrow-left",
|
|
137
|
+
"car",
|
|
138
|
+
"car-side"
|
|
139
|
+
],
|
|
140
|
+
|
|
141
|
+
octicon: [
|
|
142
|
+
"chevron-left-24",
|
|
143
|
+
"x-24",
|
|
144
|
+
"alert-24",
|
|
145
|
+
"graph-24",
|
|
146
|
+
"comment-24",
|
|
147
|
+
"comment-discussion-24",
|
|
148
|
+
"clock-24",
|
|
149
|
+
"star-24",
|
|
150
|
+
"star-fill-24",
|
|
151
|
+
"file-media-24",
|
|
152
|
+
"heart-24",
|
|
153
|
+
"heart-fill-24",
|
|
154
|
+
"project-roadmap-24",
|
|
155
|
+
"location-24",
|
|
156
|
+
"info-24",
|
|
157
|
+
"mark-github-16"
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
uil: [
|
|
161
|
+
"map-marker",
|
|
162
|
+
"envelope",
|
|
163
|
+
"phone",
|
|
164
|
+
"tag-alt"
|
|
165
|
+
],
|
|
166
|
+
|
|
167
|
+
"simple-icons": [
|
|
168
|
+
"ebay",
|
|
169
|
+
"allegro",
|
|
170
|
+
"volkswagen",
|
|
171
|
+
"audi",
|
|
172
|
+
"skoda",
|
|
173
|
+
"seat",
|
|
174
|
+
"whatsapp",
|
|
175
|
+
"x",
|
|
176
|
+
"facebook",
|
|
177
|
+
"messenger",
|
|
178
|
+
"instagram",
|
|
179
|
+
"telegram",
|
|
180
|
+
"carrd"
|
|
181
|
+
],
|
|
182
|
+
|
|
183
|
+
"icon-park-outline": [
|
|
184
|
+
"shopping-bag",
|
|
185
|
+
"comment",
|
|
186
|
+
"comments",
|
|
187
|
+
"tag-one"
|
|
188
|
+
],
|
|
189
|
+
|
|
190
|
+
flowbite: [
|
|
191
|
+
"arrow-left-outline",
|
|
192
|
+
"arrow-right-outline",
|
|
193
|
+
"angle-left-outline",
|
|
194
|
+
"angle-right-outline",
|
|
195
|
+
"chevron-left-outline",
|
|
196
|
+
"chevron-right-outline",
|
|
197
|
+
"map-location-outline",
|
|
198
|
+
"map-pin-alt-solid",
|
|
199
|
+
"x-outline",
|
|
200
|
+
"messages-outline",
|
|
201
|
+
"arrow-down-to-bracket-outline",
|
|
202
|
+
"check-outline"
|
|
203
|
+
],
|
|
204
|
+
|
|
205
|
+
// Nowe kolekcje
|
|
206
|
+
ph: [
|
|
207
|
+
'images-light',
|
|
208
|
+
'image-square-thin',
|
|
209
|
+
'cat-thin',
|
|
210
|
+
'copy-simple-light'
|
|
211
|
+
],
|
|
212
|
+
|
|
213
|
+
ic: [
|
|
214
|
+
'sharp-photo-library'
|
|
215
|
+
],
|
|
216
|
+
|
|
217
|
+
'material-symbols-light': [
|
|
218
|
+
'broken-image-outline'
|
|
219
|
+
],
|
|
220
|
+
|
|
221
|
+
et: [
|
|
222
|
+
'documents'
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.87",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"import": "./index.ts",
|
|
11
11
|
"require": "./index.ts"
|
|
12
12
|
},
|
|
13
|
-
"./styles/*": "./src/styles/*"
|
|
13
|
+
"./styles/*": "./src/styles/*",
|
|
14
|
+
"./icons": "./icon.config.ts",
|
|
15
|
+
"./uno-config": "./src/uno-config/index.ts"
|
|
14
16
|
},
|
|
15
17
|
"scripts": {
|
|
16
18
|
"dev": "astro dev",
|
|
@@ -51,11 +53,14 @@
|
|
|
51
53
|
"@iconify-json/circle-flags": "^1.2.6",
|
|
52
54
|
"@iconify-json/el": "^1.2.1",
|
|
53
55
|
"@iconify-json/eos-icons": "^1.2.2",
|
|
56
|
+
"@iconify-json/et": "^1.2.1",
|
|
54
57
|
"@iconify-json/flowbite": "^1.2.4",
|
|
55
58
|
"@iconify-json/fluent": "^1.2.13",
|
|
56
59
|
"@iconify-json/fluent-emoji": "1.2.3",
|
|
60
|
+
"@iconify-json/ic": "^1.2.2",
|
|
57
61
|
"@iconify-json/icon-park-outline": "^1.2.2",
|
|
58
62
|
"@iconify-json/la": "^1.2.1",
|
|
63
|
+
"@iconify-json/material-symbols-light": "^1.2.14",
|
|
59
64
|
"@iconify-json/mdi": "^1.2.3",
|
|
60
65
|
"@iconify-json/noto-v1": "^1.2.1",
|
|
61
66
|
"@iconify-json/octicon": "^1.2.4",
|
|
@@ -65,7 +70,7 @@
|
|
|
65
70
|
"@iconify/json": "^2.2.304",
|
|
66
71
|
"@iconify/vue": "^4.3.0",
|
|
67
72
|
"@playform/compress": "^0.1.7",
|
|
68
|
-
"@playform/inline": "
|
|
73
|
+
"@playform/inline": "^0.1.1",
|
|
69
74
|
"@types/node": "^22.13.1",
|
|
70
75
|
"@unocss/astro": "^65.4.3",
|
|
71
76
|
"@unocss/preset-attributify": "^65.4.3",
|
|
@@ -16,6 +16,6 @@ const props = defineProps({
|
|
|
16
16
|
<template>
|
|
17
17
|
<div v-if="(props.badges && props.badges.length > 0)" class="absolute z-2">
|
|
18
18
|
<Badge v-for="(badge, index) in props.badges" :key="index" :badge="badge"
|
|
19
|
-
:class="(badge.toLocaleLowerCase().includes('gti') ? 'bg-red-600' : badge.toLocaleLowerCase().includes('motorsport') ? 'bg-blue-
|
|
19
|
+
:class="(badge.toLocaleLowerCase().includes('gti') ? 'bg-red-600' : badge.toLocaleLowerCase().includes('motorsport') ? 'bg-blue-wrc' : 'bg-black')" />
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|
|
@@ -75,7 +75,7 @@ const activeIndex = activeCategorySlug && categories ? categories.map(a => a.slu
|
|
|
75
75
|
|
|
76
76
|
<style >
|
|
77
77
|
.active {
|
|
78
|
-
@apply bg-blue-
|
|
78
|
+
@apply bg-blue-darker text-white bg-opacity-100;
|
|
79
79
|
|
|
80
80
|
&:not(:hover) .cats-img {
|
|
81
81
|
filter: invert(100%);
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import CategorySidebarToggler from './CategorySidebarToggler.vue';
|
|
3
3
|
import CategoryViewToggler from './CategoryViewToggler.astro';
|
|
4
4
|
import { Icon } from 'astro-icon/components';
|
|
5
|
-
const { category, subcategory, subtitle, subsubtitle, titleSmall, locale } = Astro.props;
|
|
5
|
+
const { category, subcategory, subtitle, subsubtitle, titleSmall, locale, showViewToggler, viewerLabels } = Astro.props;
|
|
6
6
|
import { t } from "i18next";
|
|
7
7
|
|
|
8
8
|
// Compute base URL for localization
|
|
9
9
|
const baseURL = locale === 'en' ? '' : `/${locale}`;
|
|
10
10
|
|
|
11
11
|
// View toggler translations
|
|
12
|
-
const viewerLabels = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
12
|
+
// const viewerLabels = {
|
|
13
|
+
// showText: t('category.view.show'),
|
|
14
|
+
// listText: t('category.view.list'),
|
|
15
|
+
// gridText: t('category.view.grid'),
|
|
16
|
+
// listAriaLabel: t('category.view.listAriaLabel'),
|
|
17
|
+
// gridAriaLabel: t('category.view.gridAriaLabel')
|
|
18
|
+
// };
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
<div
|
|
22
22
|
ref="el"
|
|
23
|
-
class="flex flex-nowrap items-center pr-3 sm:pb-3 sm:pt-4 md:pl-4 relative z-10-off bg-
|
|
23
|
+
class="flex flex-nowrap items-center pr-3 sm:pb-3 sm:pt-4 md:pl-4 relative z-10-off bg-neutral-lightest md:bg-white"
|
|
24
24
|
transition:name="category-details"
|
|
25
25
|
transition:animate="fade"
|
|
26
26
|
>
|
|
@@ -37,7 +37,7 @@ const viewerLabels = {
|
|
|
37
37
|
{category.name}
|
|
38
38
|
{titleSmall && <small>{titleSmall}</small>}
|
|
39
39
|
</a>
|
|
40
|
-
<span class="text-
|
|
40
|
+
<span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
|
|
41
41
|
{!subsubtitle ? (
|
|
42
42
|
<h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap underline underline-offset-6 decoration-blue-300 decoration-0.5">
|
|
43
43
|
{subtitle} <span class="sr-only"> {t('catalog.extra-short')}</span>
|
|
@@ -49,7 +49,7 @@ const viewerLabels = {
|
|
|
49
49
|
{subtitle}
|
|
50
50
|
</a>
|
|
51
51
|
</div>
|
|
52
|
-
<span class="text-
|
|
52
|
+
<span class="text-neutral-lighter text-lg inline-block px-1 font-headlight">/</span>
|
|
53
53
|
<h1 class="text-lg py-2.5 sm:py-0 whitespace-nowrap underline underline-offset-6 decoration-blue-300 decoration-0.5">
|
|
54
54
|
{subsubtitle} <span class="sr-only"> {t('catalog.extra-short')}</span>
|
|
55
55
|
</h1>
|
|
@@ -65,7 +65,7 @@ const viewerLabels = {
|
|
|
65
65
|
)}
|
|
66
66
|
</div>
|
|
67
67
|
|
|
68
|
-
<CategoryViewToggler {...viewerLabels} />
|
|
68
|
+
<CategoryViewToggler {...viewerLabels} showViewToggler={showViewToggler} />
|
|
69
69
|
</div>
|
|
70
70
|
|
|
71
71
|
<script is:inline>
|
|
@@ -7,6 +7,7 @@ interface Props {
|
|
|
7
7
|
gridText: string; // "Grid"
|
|
8
8
|
listAriaLabel: string; // "List view"
|
|
9
9
|
gridAriaLabel: string; // "Grid view"
|
|
10
|
+
showViewToggler: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const {
|
|
@@ -14,12 +15,15 @@ const {
|
|
|
14
15
|
listText,
|
|
15
16
|
gridText,
|
|
16
17
|
listAriaLabel,
|
|
17
|
-
gridAriaLabel
|
|
18
|
+
gridAriaLabel,
|
|
19
|
+
showViewToggler
|
|
18
20
|
} = Astro.props;
|
|
19
21
|
---
|
|
20
22
|
|
|
23
|
+
{
|
|
24
|
+
showViewToggler &&
|
|
21
25
|
<div class="flex items-center gap-2 ml-auto">
|
|
22
|
-
<span class="text-
|
|
26
|
+
<span class="text-slate-default text-sm">{showText}</span>
|
|
23
27
|
<div class="flex border rounded">
|
|
24
28
|
<button
|
|
25
29
|
data-view="list"
|
|
@@ -39,8 +43,10 @@ const {
|
|
|
39
43
|
</button>
|
|
40
44
|
</div>
|
|
41
45
|
</div>
|
|
46
|
+
}
|
|
42
47
|
|
|
43
|
-
<script>
|
|
48
|
+
<script define:vars={{ showViewToggler }}>
|
|
49
|
+
|
|
44
50
|
// Initialize view state
|
|
45
51
|
function initializeView() {
|
|
46
52
|
const savedView = localStorage.getItem('categoryView') || 'list';
|
|
@@ -51,7 +57,7 @@ const {
|
|
|
51
57
|
buttons.forEach(button => {
|
|
52
58
|
if (button instanceof HTMLElement) {
|
|
53
59
|
const isActive = button.dataset.view === savedView;
|
|
54
|
-
button.classList.toggle('bg-
|
|
60
|
+
button.classList.toggle('bg-neutral-lightest', isActive);
|
|
55
61
|
}
|
|
56
62
|
});
|
|
57
63
|
|
|
@@ -78,8 +84,8 @@ const {
|
|
|
78
84
|
localStorage.setItem('categoryView', view);
|
|
79
85
|
|
|
80
86
|
// Update button states
|
|
81
|
-
buttons.forEach(btn => btn.classList.remove('bg-
|
|
82
|
-
clickedButton.classList.add('bg-
|
|
87
|
+
buttons.forEach(btn => btn.classList.remove('bg-neutral-lightest'));
|
|
88
|
+
clickedButton.classList.add('bg-neutral-lightest');
|
|
83
89
|
|
|
84
90
|
// Update products container
|
|
85
91
|
const productsContainer = document.querySelector('.products-container');
|
|
@@ -93,7 +99,9 @@ const {
|
|
|
93
99
|
|
|
94
100
|
// Setup on page load
|
|
95
101
|
document.addEventListener('astro:page-load', () => {
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
if (showViewToggler) {
|
|
103
|
+
initializeView();
|
|
104
|
+
setupViewToggle();
|
|
105
|
+
}
|
|
98
106
|
});
|
|
99
107
|
</script>
|
|
@@ -6,7 +6,7 @@ import Search from "astro-pagefind/components/Search";
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
<header
|
|
9
|
-
class="p-3 bg-blue-
|
|
9
|
+
class="p-3 bg-blue-medium bg-opacity-10 backdrop-blur-md border-b text-slate-900"
|
|
10
10
|
>
|
|
11
11
|
<SkipToContent />
|
|
12
12
|
<nav
|
|
@@ -33,7 +33,7 @@ const props = defineProps({
|
|
|
33
33
|
<template v-for="(detail, index) in details" :key="index" class="" v-if="details && details.length">
|
|
34
34
|
<!-- PDP PAGE - PRODUCT ROW -->
|
|
35
35
|
<!-- <pre>{{ JSON.stringify(details) }}</pre> -->
|
|
36
|
-
<li v-if="props.small" class="text-xs md:text-sm text-
|
|
36
|
+
<li v-if="props.small" class="text-xs md:text-sm text-slate-darkest dark:text-neutral-light leading-tight font-textlight md:font-textregular">
|
|
37
37
|
|
|
38
38
|
<span v-if="detail.id" class="inline-block mr-1 items--0">
|
|
39
39
|
{{ getTranslation(`detail.${detail.id}`) }}:
|