@venix-sistemas/jade 1.4.1 → 1.4.2-alpha.0
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/LICENSE +21 -21
- package/README.md +994 -969
- package/dist/module.d.mts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +29 -8
- package/dist/runtime/components/VenixIcon.vue +20 -20
- package/dist/runtime/components/VenixThemeSwitcher.vue +336 -336
- package/dist/runtime/composables/useVenixTheme.d.ts +4 -4
- package/dist/runtime/composables/useVenixTheme.js +22 -0
- package/dist/runtime/nitro/theme-init.js +1 -1
- package/dist/runtime/scripts/theme-init.d.ts +4 -2
- package/dist/runtime/scripts/theme-init.js +14 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/shared/css/colors.d.ts +1 -1
- package/dist/shared/css/colors.js +11 -3
- package/dist/shared/css/index.js +1 -1
- package/dist/shared/css/tokens.d.ts +7 -0
- package/dist/shared/css/tokens.js +32 -5
- package/dist/shared/theme.json +314 -320
- package/dist/shared/token-names.d.ts +14 -5
- package/dist/shared/token-names.js +1 -1
- package/dist/shared/types/color-options.d.ts +24 -1
- package/dist/shared/types/colors.d.ts +2 -0
- package/dist/shared/types/index.d.ts +3 -1
- package/dist/shared/types/runtime-config.d.ts +2 -0
- package/dist/shared/types/theme-names.d.ts +23 -0
- package/dist/shared/types/theme-names.js +0 -0
- package/dist/shared/utils/base-url.d.ts +15 -0
- package/dist/shared/utils/base-url.js +32 -0
- package/dist/shared/utils/derive-seeds.d.ts +24 -0
- package/dist/shared/utils/derive-seeds.js +30 -0
- package/dist/shared/utils/oklab.d.ts +8 -0
- package/dist/shared/utils/oklab.js +15 -2
- package/dist/shared/utils/scale.d.ts +7 -2
- package/dist/shared/utils/scale.js +4 -3
- package/dist/shared/utils/theme-color.d.ts +9 -0
- package/dist/shared/utils/theme-color.js +10 -0
- package/dist/shared/utils/theme-types.d.ts +8 -0
- package/dist/shared/utils/theme-types.js +16 -0
- package/dist/types.d.mts +2 -0
- package/package.json +15 -13
|
@@ -1,340 +1,340 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="rootRef"
|
|
4
|
-
class="venix-theme-switcher"
|
|
5
|
-
@focusout="handleFocusOut"
|
|
6
|
-
>
|
|
7
|
-
<span
|
|
8
|
-
class="venix-theme-switcher__sr-only"
|
|
9
|
-
role="status"
|
|
10
|
-
aria-live="polite"
|
|
11
|
-
>{{ announcement }}</span>
|
|
12
|
-
|
|
13
|
-
<button
|
|
14
|
-
ref="triggerRef"
|
|
15
|
-
type="button"
|
|
16
|
-
class="venix-theme-switcher__trigger"
|
|
17
|
-
:class="{ 'venix-theme-switcher__trigger--visible': visible }"
|
|
18
|
-
:aria-label="resolvedLabel"
|
|
19
|
-
:aria-expanded="open"
|
|
20
|
-
aria-haspopup="menu"
|
|
21
|
-
@click="toggleOpen"
|
|
22
|
-
>
|
|
23
|
-
<template v-if="activeIcon">
|
|
24
|
-
<span
|
|
25
|
-
v-if="activeIcon.format === 'emote'"
|
|
26
|
-
:key="activeIconKey"
|
|
27
|
-
class="venix-icon venix-icon--emoji"
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
>{{ activeIcon.value }}</span>
|
|
30
|
-
<VenixIcon
|
|
31
|
-
v-else
|
|
32
|
-
:key="activeIconKey"
|
|
33
|
-
:icon="activeIcon.value"
|
|
34
|
-
:mode="activeIcon.format"
|
|
35
|
-
aria-hidden="true"
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
<span
|
|
39
|
-
v-if="showLabel"
|
|
40
|
-
class="venix-theme-switcher__trigger-label"
|
|
41
|
-
>{{ triggerLabel }}</span>
|
|
42
|
-
</button>
|
|
43
|
-
|
|
44
|
-
<Transition name="venix-theme-switcher-menu">
|
|
45
|
-
<div
|
|
46
|
-
v-show="open"
|
|
47
|
-
ref="menuRef"
|
|
48
|
-
class="venix-theme-switcher__menu"
|
|
49
|
-
:class="{ 'venix-theme-switcher__menu--above': placeAbove }"
|
|
50
|
-
:style="menuStyle"
|
|
51
|
-
role="menu"
|
|
52
|
-
tabindex="-1"
|
|
53
|
-
:aria-label="resolvedLabel"
|
|
54
|
-
@keydown="handleMenuKeydown"
|
|
55
|
-
>
|
|
56
|
-
<div
|
|
57
|
-
v-if="view === 'settings'"
|
|
58
|
-
key="settings"
|
|
59
|
-
class="venix-theme-switcher__view venix-theme-switcher__view--settings"
|
|
60
|
-
>
|
|
61
|
-
<div class="venix-theme-switcher__header">
|
|
62
|
-
<button
|
|
63
|
-
type="button"
|
|
64
|
-
role="menuitem"
|
|
65
|
-
class="venix-theme-switcher__icon-button"
|
|
66
|
-
:aria-label="backLabel"
|
|
67
|
-
:title="backLabel"
|
|
68
|
-
@click="showView('main')"
|
|
69
|
-
>
|
|
70
|
-
<span
|
|
71
|
-
v-if="icons.back?.format === 'emote'"
|
|
72
|
-
class="venix-icon venix-icon--emoji"
|
|
73
|
-
aria-hidden="true"
|
|
74
|
-
>{{ icons.back.value }}</span>
|
|
75
|
-
<VenixIcon
|
|
76
|
-
v-else-if="icons.back"
|
|
77
|
-
:icon="icons.back.value"
|
|
78
|
-
:mode="icons.back.format"
|
|
79
|
-
aria-hidden="true"
|
|
80
|
-
/>
|
|
81
|
-
</button>
|
|
82
|
-
<div
|
|
83
|
-
class="venix-theme-switcher__heading"
|
|
84
|
-
aria-hidden="true"
|
|
85
|
-
>
|
|
86
|
-
{{ settingsHeading }}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<div
|
|
91
|
-
class="venix-theme-switcher__separator"
|
|
92
|
-
role="separator"
|
|
93
|
-
/>
|
|
94
|
-
|
|
95
|
-
<div
|
|
96
|
-
class="venix-theme-switcher__group"
|
|
97
|
-
role="group"
|
|
98
|
-
:aria-label="settingsHeading"
|
|
99
|
-
>
|
|
100
|
-
<button
|
|
101
|
-
v-for="option in settingsOptions"
|
|
102
|
-
:key="option.key"
|
|
103
|
-
type="button"
|
|
104
|
-
role="menuitemcheckbox"
|
|
105
|
-
class="venix-theme-switcher__item venix-theme-switcher__item--toggle"
|
|
106
|
-
:class="{ 'venix-theme-switcher__item--on': option.enabled }"
|
|
107
|
-
:aria-checked="option.enabled"
|
|
108
|
-
@click="toggleOption(option)"
|
|
109
|
-
>
|
|
110
|
-
<span
|
|
111
|
-
v-if="option.icon?.format === 'emote'"
|
|
112
|
-
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
113
|
-
aria-hidden="true"
|
|
114
|
-
>{{ option.icon.value }}</span>
|
|
115
|
-
<VenixIcon
|
|
116
|
-
v-else-if="option.icon"
|
|
117
|
-
class="venix-theme-switcher__item-icon"
|
|
118
|
-
:icon="option.icon.value"
|
|
119
|
-
:mode="option.icon.format"
|
|
120
|
-
aria-hidden="true"
|
|
121
|
-
/>
|
|
122
|
-
<span class="venix-theme-switcher__item-text">
|
|
123
|
-
<span class="venix-theme-switcher__item-title">{{ option.title }}</span>
|
|
124
|
-
<span
|
|
125
|
-
v-if="option.description"
|
|
126
|
-
class="venix-theme-switcher__item-description"
|
|
127
|
-
>{{ option.description }}</span>
|
|
128
|
-
</span>
|
|
129
|
-
<span
|
|
130
|
-
class="venix-theme-switcher__switch"
|
|
131
|
-
aria-hidden="true"
|
|
132
|
-
/>
|
|
133
|
-
</button>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<a
|
|
137
|
-
class="venix-theme-switcher__credit"
|
|
138
|
-
role="menuitem"
|
|
139
|
-
tabindex="-1"
|
|
140
|
-
:href="SWITCHER_CREDIT.url"
|
|
141
|
-
target="_blank"
|
|
142
|
-
rel="noopener"
|
|
143
|
-
>{{ SWITCHER_CREDIT.name }}</a>
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
<div
|
|
147
|
-
v-else
|
|
148
|
-
key="main"
|
|
149
|
-
class="venix-theme-switcher__view"
|
|
150
|
-
>
|
|
151
|
-
<div class="venix-theme-switcher__header">
|
|
152
|
-
<div
|
|
153
|
-
class="venix-theme-switcher__heading"
|
|
154
|
-
aria-hidden="true"
|
|
155
|
-
>
|
|
156
|
-
{{ resolvedLabel }}
|
|
157
|
-
</div>
|
|
158
|
-
<button
|
|
159
|
-
v-if="settingsOptions.length > 0"
|
|
160
|
-
type="button"
|
|
161
|
-
role="menuitem"
|
|
162
|
-
class="venix-theme-switcher__icon-button"
|
|
163
|
-
:aria-label="settingsHeading"
|
|
164
|
-
:title="settingsHeading"
|
|
165
|
-
@click="showView('settings')"
|
|
166
|
-
>
|
|
167
|
-
<span
|
|
168
|
-
v-if="icons.settings?.format === 'emote'"
|
|
169
|
-
class="venix-icon venix-icon--emoji"
|
|
170
|
-
aria-hidden="true"
|
|
171
|
-
>{{ icons.settings.value }}</span>
|
|
172
|
-
<VenixIcon
|
|
173
|
-
v-else-if="icons.settings"
|
|
174
|
-
:icon="icons.settings.value"
|
|
175
|
-
:mode="icons.settings.format"
|
|
176
|
-
aria-hidden="true"
|
|
177
|
-
/>
|
|
178
|
-
</button>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div
|
|
182
|
-
class="venix-theme-switcher__separator"
|
|
183
|
-
role="separator"
|
|
184
|
-
/>
|
|
185
|
-
|
|
186
|
-
<div
|
|
187
|
-
class="venix-theme-switcher__group"
|
|
188
|
-
role="group"
|
|
189
|
-
:aria-label="modeHeading"
|
|
190
|
-
>
|
|
191
|
-
<div
|
|
192
|
-
class="venix-theme-switcher__subheading"
|
|
193
|
-
aria-hidden="true"
|
|
194
|
-
>
|
|
195
|
-
{{ modeHeading }}
|
|
196
|
-
</div>
|
|
197
|
-
<div class="venix-theme-switcher__modes">
|
|
198
|
-
<button
|
|
199
|
-
v-for="item in modes"
|
|
200
|
-
:key="item.value"
|
|
201
|
-
type="button"
|
|
202
|
-
role="menuitemradio"
|
|
203
|
-
class="venix-theme-switcher__item venix-theme-switcher__item--mode"
|
|
204
|
-
:class="{ 'venix-theme-switcher__item--active': item.value === mode.preference.value }"
|
|
205
|
-
:aria-checked="item.value === mode.preference.value"
|
|
206
|
-
@click="selectMode(item.value)"
|
|
207
|
-
>
|
|
208
|
-
<span
|
|
209
|
-
v-if="item.icon?.format === 'emote'"
|
|
210
|
-
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
211
|
-
aria-hidden="true"
|
|
212
|
-
>{{ item.icon.value }}</span>
|
|
213
|
-
<VenixIcon
|
|
214
|
-
v-else-if="item.icon"
|
|
215
|
-
class="venix-theme-switcher__item-icon"
|
|
216
|
-
:icon="item.icon.value"
|
|
217
|
-
:mode="item.icon.format"
|
|
218
|
-
aria-hidden="true"
|
|
219
|
-
/>
|
|
220
|
-
<span>{{ item.name }}</span>
|
|
221
|
-
</button>
|
|
222
|
-
</div>
|
|
223
|
-
</div>
|
|
224
|
-
|
|
225
|
-
<template
|
|
226
|
-
v-for="section in themeSections"
|
|
227
|
-
:key="section.key"
|
|
228
|
-
>
|
|
229
|
-
<div
|
|
230
|
-
class="venix-theme-switcher__separator"
|
|
231
|
-
role="separator"
|
|
232
|
-
/>
|
|
233
|
-
|
|
234
|
-
<div
|
|
235
|
-
class="venix-theme-switcher__group"
|
|
236
|
-
role="group"
|
|
237
|
-
:aria-label="section.heading"
|
|
238
|
-
>
|
|
239
|
-
<div
|
|
240
|
-
class="venix-theme-switcher__subheading"
|
|
241
|
-
aria-hidden="true"
|
|
242
|
-
>
|
|
243
|
-
{{ section.heading }}
|
|
244
|
-
</div>
|
|
245
|
-
<button
|
|
246
|
-
v-for="item in section.items"
|
|
247
|
-
:key="item.value"
|
|
248
|
-
type="button"
|
|
249
|
-
role="menuitemradio"
|
|
250
|
-
class="venix-theme-switcher__item"
|
|
251
|
-
:class="{ 'venix-theme-switcher__item--active': item.value === theme.preference.value }"
|
|
252
|
-
:aria-checked="item.value === theme.preference.value"
|
|
253
|
-
@click="selectTheme(item.value)"
|
|
254
|
-
>
|
|
255
|
-
<span
|
|
256
|
-
v-if="item.icon?.format === 'emote'"
|
|
257
|
-
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
258
|
-
aria-hidden="true"
|
|
259
|
-
>{{ item.icon.value }}</span>
|
|
260
|
-
<VenixIcon
|
|
261
|
-
v-else-if="item.icon"
|
|
262
|
-
class="venix-theme-switcher__item-icon"
|
|
263
|
-
:icon="item.icon.value"
|
|
264
|
-
:mode="item.icon.format"
|
|
265
|
-
aria-hidden="true"
|
|
266
|
-
/>
|
|
267
|
-
<span>{{ item.name }}</span>
|
|
268
|
-
<span
|
|
269
|
-
v-if="seasonLabels[item.value]"
|
|
270
|
-
class="venix-theme-switcher__item-season"
|
|
271
|
-
>{{ seasonLabels[item.value] }}</span>
|
|
272
|
-
</button>
|
|
273
|
-
</div>
|
|
274
|
-
</template>
|
|
275
|
-
|
|
276
|
-
<!-- After a change that won't be remembered (no consent yet): a
|
|
277
|
-
reminder at the bottom that saves right here, so the visitor
|
|
278
|
-
doesn't have to find "Save changes" in the settings. -->
|
|
279
|
-
<Transition
|
|
280
|
-
name="venix-theme-switcher-prompt"
|
|
281
|
-
@after-enter="revealPrompt"
|
|
282
|
-
@after-leave="updatePlacement"
|
|
283
|
-
>
|
|
284
|
-
<div
|
|
285
|
-
v-if="showSavePrompt || justSaved"
|
|
286
|
-
class="venix-theme-switcher__prompt"
|
|
287
|
-
>
|
|
288
|
-
<div class="venix-theme-switcher__prompt-inner">
|
|
289
|
-
<div
|
|
290
|
-
class="venix-theme-switcher__separator"
|
|
291
|
-
role="separator"
|
|
292
|
-
/>
|
|
293
|
-
<div
|
|
294
|
-
v-if="justSaved"
|
|
295
|
-
class="venix-theme-switcher__prompt-row venix-theme-switcher__prompt-row--saved"
|
|
296
|
-
>
|
|
297
|
-
<span aria-hidden="true">✓</span>
|
|
298
|
-
<span>{{ promptSavedLabel }}</span>
|
|
299
|
-
</div>
|
|
300
|
-
<div
|
|
301
|
-
v-else
|
|
302
|
-
class="venix-theme-switcher__prompt-row"
|
|
303
|
-
>
|
|
304
|
-
<span
|
|
305
|
-
:id="promptTextId"
|
|
306
|
-
class="venix-theme-switcher__item-text"
|
|
307
|
-
>
|
|
308
|
-
<span class="venix-theme-switcher__prompt-title">{{ promptTitle }}</span>
|
|
309
|
-
<span class="venix-theme-switcher__item-description">{{ promptDescription }}</span>
|
|
310
|
-
</span>
|
|
311
|
-
<button
|
|
312
|
-
type="button"
|
|
313
|
-
role="menuitem"
|
|
314
|
-
class="venix-theme-switcher__prompt-button venix-theme-switcher__prompt-button--save"
|
|
315
|
-
:aria-describedby="promptTextId"
|
|
316
|
-
@click="saveFromPrompt"
|
|
317
|
-
>
|
|
318
|
-
{{ promptSaveLabel }}
|
|
319
|
-
</button>
|
|
320
|
-
<button
|
|
321
|
-
type="button"
|
|
322
|
-
role="menuitem"
|
|
323
|
-
class="venix-theme-switcher__prompt-button venix-theme-switcher__prompt-button--dismiss"
|
|
324
|
-
:aria-label="promptDismissLabel"
|
|
325
|
-
:title="promptDismissLabel"
|
|
326
|
-
@click="dismissPrompt"
|
|
327
|
-
>
|
|
328
|
-
<span aria-hidden="true">×</span>
|
|
329
|
-
</button>
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
</Transition>
|
|
334
|
-
</div>
|
|
335
|
-
</div>
|
|
336
|
-
</Transition>
|
|
337
|
-
</div>
|
|
2
|
+
<div
|
|
3
|
+
ref="rootRef"
|
|
4
|
+
class="venix-theme-switcher"
|
|
5
|
+
@focusout="handleFocusOut"
|
|
6
|
+
>
|
|
7
|
+
<span
|
|
8
|
+
class="venix-theme-switcher__sr-only"
|
|
9
|
+
role="status"
|
|
10
|
+
aria-live="polite"
|
|
11
|
+
>{{ announcement }}</span>
|
|
12
|
+
|
|
13
|
+
<button
|
|
14
|
+
ref="triggerRef"
|
|
15
|
+
type="button"
|
|
16
|
+
class="venix-theme-switcher__trigger"
|
|
17
|
+
:class="{ 'venix-theme-switcher__trigger--visible': visible }"
|
|
18
|
+
:aria-label="resolvedLabel"
|
|
19
|
+
:aria-expanded="open"
|
|
20
|
+
aria-haspopup="menu"
|
|
21
|
+
@click="toggleOpen"
|
|
22
|
+
>
|
|
23
|
+
<template v-if="activeIcon">
|
|
24
|
+
<span
|
|
25
|
+
v-if="activeIcon.format === 'emote'"
|
|
26
|
+
:key="activeIconKey"
|
|
27
|
+
class="venix-icon venix-icon--emoji"
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
>{{ activeIcon.value }}</span>
|
|
30
|
+
<VenixIcon
|
|
31
|
+
v-else
|
|
32
|
+
:key="activeIconKey"
|
|
33
|
+
:icon="activeIcon.value"
|
|
34
|
+
:mode="activeIcon.format"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
<span
|
|
39
|
+
v-if="showLabel"
|
|
40
|
+
class="venix-theme-switcher__trigger-label"
|
|
41
|
+
>{{ triggerLabel }}</span>
|
|
42
|
+
</button>
|
|
43
|
+
|
|
44
|
+
<Transition name="venix-theme-switcher-menu">
|
|
45
|
+
<div
|
|
46
|
+
v-show="open"
|
|
47
|
+
ref="menuRef"
|
|
48
|
+
class="venix-theme-switcher__menu"
|
|
49
|
+
:class="{ 'venix-theme-switcher__menu--above': placeAbove }"
|
|
50
|
+
:style="menuStyle"
|
|
51
|
+
role="menu"
|
|
52
|
+
tabindex="-1"
|
|
53
|
+
:aria-label="resolvedLabel"
|
|
54
|
+
@keydown="handleMenuKeydown"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
v-if="view === 'settings'"
|
|
58
|
+
key="settings"
|
|
59
|
+
class="venix-theme-switcher__view venix-theme-switcher__view--settings"
|
|
60
|
+
>
|
|
61
|
+
<div class="venix-theme-switcher__header">
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
role="menuitem"
|
|
65
|
+
class="venix-theme-switcher__icon-button"
|
|
66
|
+
:aria-label="backLabel"
|
|
67
|
+
:title="backLabel"
|
|
68
|
+
@click="showView('main')"
|
|
69
|
+
>
|
|
70
|
+
<span
|
|
71
|
+
v-if="icons.back?.format === 'emote'"
|
|
72
|
+
class="venix-icon venix-icon--emoji"
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
>{{ icons.back.value }}</span>
|
|
75
|
+
<VenixIcon
|
|
76
|
+
v-else-if="icons.back"
|
|
77
|
+
:icon="icons.back.value"
|
|
78
|
+
:mode="icons.back.format"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
/>
|
|
81
|
+
</button>
|
|
82
|
+
<div
|
|
83
|
+
class="venix-theme-switcher__heading"
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
>
|
|
86
|
+
{{ settingsHeading }}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div
|
|
91
|
+
class="venix-theme-switcher__separator"
|
|
92
|
+
role="separator"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<div
|
|
96
|
+
class="venix-theme-switcher__group"
|
|
97
|
+
role="group"
|
|
98
|
+
:aria-label="settingsHeading"
|
|
99
|
+
>
|
|
100
|
+
<button
|
|
101
|
+
v-for="option in settingsOptions"
|
|
102
|
+
:key="option.key"
|
|
103
|
+
type="button"
|
|
104
|
+
role="menuitemcheckbox"
|
|
105
|
+
class="venix-theme-switcher__item venix-theme-switcher__item--toggle"
|
|
106
|
+
:class="{ 'venix-theme-switcher__item--on': option.enabled }"
|
|
107
|
+
:aria-checked="option.enabled"
|
|
108
|
+
@click="toggleOption(option)"
|
|
109
|
+
>
|
|
110
|
+
<span
|
|
111
|
+
v-if="option.icon?.format === 'emote'"
|
|
112
|
+
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
113
|
+
aria-hidden="true"
|
|
114
|
+
>{{ option.icon.value }}</span>
|
|
115
|
+
<VenixIcon
|
|
116
|
+
v-else-if="option.icon"
|
|
117
|
+
class="venix-theme-switcher__item-icon"
|
|
118
|
+
:icon="option.icon.value"
|
|
119
|
+
:mode="option.icon.format"
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
/>
|
|
122
|
+
<span class="venix-theme-switcher__item-text">
|
|
123
|
+
<span class="venix-theme-switcher__item-title">{{ option.title }}</span>
|
|
124
|
+
<span
|
|
125
|
+
v-if="option.description"
|
|
126
|
+
class="venix-theme-switcher__item-description"
|
|
127
|
+
>{{ option.description }}</span>
|
|
128
|
+
</span>
|
|
129
|
+
<span
|
|
130
|
+
class="venix-theme-switcher__switch"
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
/>
|
|
133
|
+
</button>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<a
|
|
137
|
+
class="venix-theme-switcher__credit"
|
|
138
|
+
role="menuitem"
|
|
139
|
+
tabindex="-1"
|
|
140
|
+
:href="SWITCHER_CREDIT.url"
|
|
141
|
+
target="_blank"
|
|
142
|
+
rel="noopener"
|
|
143
|
+
>{{ SWITCHER_CREDIT.name }}</a>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div
|
|
147
|
+
v-else
|
|
148
|
+
key="main"
|
|
149
|
+
class="venix-theme-switcher__view"
|
|
150
|
+
>
|
|
151
|
+
<div class="venix-theme-switcher__header">
|
|
152
|
+
<div
|
|
153
|
+
class="venix-theme-switcher__heading"
|
|
154
|
+
aria-hidden="true"
|
|
155
|
+
>
|
|
156
|
+
{{ resolvedLabel }}
|
|
157
|
+
</div>
|
|
158
|
+
<button
|
|
159
|
+
v-if="settingsOptions.length > 0"
|
|
160
|
+
type="button"
|
|
161
|
+
role="menuitem"
|
|
162
|
+
class="venix-theme-switcher__icon-button"
|
|
163
|
+
:aria-label="settingsHeading"
|
|
164
|
+
:title="settingsHeading"
|
|
165
|
+
@click="showView('settings')"
|
|
166
|
+
>
|
|
167
|
+
<span
|
|
168
|
+
v-if="icons.settings?.format === 'emote'"
|
|
169
|
+
class="venix-icon venix-icon--emoji"
|
|
170
|
+
aria-hidden="true"
|
|
171
|
+
>{{ icons.settings.value }}</span>
|
|
172
|
+
<VenixIcon
|
|
173
|
+
v-else-if="icons.settings"
|
|
174
|
+
:icon="icons.settings.value"
|
|
175
|
+
:mode="icons.settings.format"
|
|
176
|
+
aria-hidden="true"
|
|
177
|
+
/>
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div
|
|
182
|
+
class="venix-theme-switcher__separator"
|
|
183
|
+
role="separator"
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<div
|
|
187
|
+
class="venix-theme-switcher__group"
|
|
188
|
+
role="group"
|
|
189
|
+
:aria-label="modeHeading"
|
|
190
|
+
>
|
|
191
|
+
<div
|
|
192
|
+
class="venix-theme-switcher__subheading"
|
|
193
|
+
aria-hidden="true"
|
|
194
|
+
>
|
|
195
|
+
{{ modeHeading }}
|
|
196
|
+
</div>
|
|
197
|
+
<div class="venix-theme-switcher__modes">
|
|
198
|
+
<button
|
|
199
|
+
v-for="item in modes"
|
|
200
|
+
:key="item.value"
|
|
201
|
+
type="button"
|
|
202
|
+
role="menuitemradio"
|
|
203
|
+
class="venix-theme-switcher__item venix-theme-switcher__item--mode"
|
|
204
|
+
:class="{ 'venix-theme-switcher__item--active': item.value === mode.preference.value }"
|
|
205
|
+
:aria-checked="item.value === mode.preference.value"
|
|
206
|
+
@click="selectMode(item.value)"
|
|
207
|
+
>
|
|
208
|
+
<span
|
|
209
|
+
v-if="item.icon?.format === 'emote'"
|
|
210
|
+
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
>{{ item.icon.value }}</span>
|
|
213
|
+
<VenixIcon
|
|
214
|
+
v-else-if="item.icon"
|
|
215
|
+
class="venix-theme-switcher__item-icon"
|
|
216
|
+
:icon="item.icon.value"
|
|
217
|
+
:mode="item.icon.format"
|
|
218
|
+
aria-hidden="true"
|
|
219
|
+
/>
|
|
220
|
+
<span>{{ item.name }}</span>
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<template
|
|
226
|
+
v-for="section in themeSections"
|
|
227
|
+
:key="section.key"
|
|
228
|
+
>
|
|
229
|
+
<div
|
|
230
|
+
class="venix-theme-switcher__separator"
|
|
231
|
+
role="separator"
|
|
232
|
+
/>
|
|
233
|
+
|
|
234
|
+
<div
|
|
235
|
+
class="venix-theme-switcher__group"
|
|
236
|
+
role="group"
|
|
237
|
+
:aria-label="section.heading"
|
|
238
|
+
>
|
|
239
|
+
<div
|
|
240
|
+
class="venix-theme-switcher__subheading"
|
|
241
|
+
aria-hidden="true"
|
|
242
|
+
>
|
|
243
|
+
{{ section.heading }}
|
|
244
|
+
</div>
|
|
245
|
+
<button
|
|
246
|
+
v-for="item in section.items"
|
|
247
|
+
:key="item.value"
|
|
248
|
+
type="button"
|
|
249
|
+
role="menuitemradio"
|
|
250
|
+
class="venix-theme-switcher__item"
|
|
251
|
+
:class="{ 'venix-theme-switcher__item--active': item.value === theme.preference.value }"
|
|
252
|
+
:aria-checked="item.value === theme.preference.value"
|
|
253
|
+
@click="selectTheme(item.value)"
|
|
254
|
+
>
|
|
255
|
+
<span
|
|
256
|
+
v-if="item.icon?.format === 'emote'"
|
|
257
|
+
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
258
|
+
aria-hidden="true"
|
|
259
|
+
>{{ item.icon.value }}</span>
|
|
260
|
+
<VenixIcon
|
|
261
|
+
v-else-if="item.icon"
|
|
262
|
+
class="venix-theme-switcher__item-icon"
|
|
263
|
+
:icon="item.icon.value"
|
|
264
|
+
:mode="item.icon.format"
|
|
265
|
+
aria-hidden="true"
|
|
266
|
+
/>
|
|
267
|
+
<span>{{ item.name }}</span>
|
|
268
|
+
<span
|
|
269
|
+
v-if="seasonLabels[item.value]"
|
|
270
|
+
class="venix-theme-switcher__item-season"
|
|
271
|
+
>{{ seasonLabels[item.value] }}</span>
|
|
272
|
+
</button>
|
|
273
|
+
</div>
|
|
274
|
+
</template>
|
|
275
|
+
|
|
276
|
+
<!-- After a change that won't be remembered (no consent yet): a
|
|
277
|
+
reminder at the bottom that saves right here, so the visitor
|
|
278
|
+
doesn't have to find "Save changes" in the settings. -->
|
|
279
|
+
<Transition
|
|
280
|
+
name="venix-theme-switcher-prompt"
|
|
281
|
+
@after-enter="revealPrompt"
|
|
282
|
+
@after-leave="updatePlacement"
|
|
283
|
+
>
|
|
284
|
+
<div
|
|
285
|
+
v-if="showSavePrompt || justSaved"
|
|
286
|
+
class="venix-theme-switcher__prompt"
|
|
287
|
+
>
|
|
288
|
+
<div class="venix-theme-switcher__prompt-inner">
|
|
289
|
+
<div
|
|
290
|
+
class="venix-theme-switcher__separator"
|
|
291
|
+
role="separator"
|
|
292
|
+
/>
|
|
293
|
+
<div
|
|
294
|
+
v-if="justSaved"
|
|
295
|
+
class="venix-theme-switcher__prompt-row venix-theme-switcher__prompt-row--saved"
|
|
296
|
+
>
|
|
297
|
+
<span aria-hidden="true">✓</span>
|
|
298
|
+
<span>{{ promptSavedLabel }}</span>
|
|
299
|
+
</div>
|
|
300
|
+
<div
|
|
301
|
+
v-else
|
|
302
|
+
class="venix-theme-switcher__prompt-row"
|
|
303
|
+
>
|
|
304
|
+
<span
|
|
305
|
+
:id="promptTextId"
|
|
306
|
+
class="venix-theme-switcher__item-text"
|
|
307
|
+
>
|
|
308
|
+
<span class="venix-theme-switcher__prompt-title">{{ promptTitle }}</span>
|
|
309
|
+
<span class="venix-theme-switcher__item-description">{{ promptDescription }}</span>
|
|
310
|
+
</span>
|
|
311
|
+
<button
|
|
312
|
+
type="button"
|
|
313
|
+
role="menuitem"
|
|
314
|
+
class="venix-theme-switcher__prompt-button venix-theme-switcher__prompt-button--save"
|
|
315
|
+
:aria-describedby="promptTextId"
|
|
316
|
+
@click="saveFromPrompt"
|
|
317
|
+
>
|
|
318
|
+
{{ promptSaveLabel }}
|
|
319
|
+
</button>
|
|
320
|
+
<button
|
|
321
|
+
type="button"
|
|
322
|
+
role="menuitem"
|
|
323
|
+
class="venix-theme-switcher__prompt-button venix-theme-switcher__prompt-button--dismiss"
|
|
324
|
+
:aria-label="promptDismissLabel"
|
|
325
|
+
:title="promptDismissLabel"
|
|
326
|
+
@click="dismissPrompt"
|
|
327
|
+
>
|
|
328
|
+
<span aria-hidden="true">×</span>
|
|
329
|
+
</button>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</Transition>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</Transition>
|
|
337
|
+
</div>
|
|
338
338
|
</template>
|
|
339
339
|
|
|
340
340
|
<script setup>
|