@zeyolabs/ui 2026.11.40 → 2026.11.42
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/faq/FAQList.svelte +1 -1
- package/filter/FilterChipGroup.svelte +1 -1
- package/filter/FilterOptionList.svelte +1 -1
- package/form/primitives/IconInputWrapper.svelte +1 -1
- package/form/primitives/Input.svelte +1 -1
- package/form/primitives/TextArea.svelte +1 -1
- package/head/Head.svelte +59 -0
- package/head/context.ts +27 -0
- package/menu/MenuButton.svelte +1 -1
- package/package.json +5 -3
- package/status-row/StatusRow.svelte +4 -4
package/faq/FAQList.svelte
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
tabindex="0"
|
|
89
89
|
>
|
|
90
90
|
{#each visible as option, i (option.value)}
|
|
91
|
-
{
|
|
91
|
+
{const on = $derived(selected.includes(option.value))}
|
|
92
92
|
{#if option.group && option.group !== visible[i - 1]?.group}
|
|
93
93
|
<div class="group">{option.group}</div>
|
|
94
94
|
{/if}
|
package/head/Head.svelte
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/state';
|
|
3
|
+
|
|
4
|
+
import { headContext } from './context';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A page's `<head>` tags: title, description, canonical link and link-preview tags. The site's
|
|
8
|
+
* name, URL and share picture come from `setHeadContext` in the root layout. Renders nothing
|
|
9
|
+
* visible: the page's heading is its own `Title`.
|
|
10
|
+
*/
|
|
11
|
+
let {
|
|
12
|
+
canonical,
|
|
13
|
+
description,
|
|
14
|
+
image,
|
|
15
|
+
title,
|
|
16
|
+
}: {
|
|
17
|
+
/** Path (or absolute URL) search engines should treat as this page. Default: the path, no query. */
|
|
18
|
+
canonical?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
/** This page's link-preview picture, instead of the site's. */
|
|
21
|
+
image?: string;
|
|
22
|
+
/** The page's own title; omitted, the tab shows the site name alone. */
|
|
23
|
+
title?: string;
|
|
24
|
+
} = $props();
|
|
25
|
+
|
|
26
|
+
const site = headContext();
|
|
27
|
+
const fullTitle = $derived(
|
|
28
|
+
title ? `${title}${site.separator ?? ' · '}${site.siteName}` : site.siteName
|
|
29
|
+
);
|
|
30
|
+
const url = $derived.by(() => {
|
|
31
|
+
if (!site.siteUrl) return null;
|
|
32
|
+
const path = canonical ?? page.url.pathname;
|
|
33
|
+
return /^https?:\/\//.test(path) ? path : `${site.siteUrl}${path}`;
|
|
34
|
+
});
|
|
35
|
+
const picture = $derived(image ?? site.shareImage);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<svelte:head>
|
|
39
|
+
<title>{fullTitle}</title>
|
|
40
|
+
{#if description}
|
|
41
|
+
<meta name="description" content={description} />
|
|
42
|
+
{/if}
|
|
43
|
+
{#if site.noindex}
|
|
44
|
+
<meta name="robots" content="noindex" />
|
|
45
|
+
{/if}
|
|
46
|
+
{#if url}
|
|
47
|
+
<link href={url} rel="canonical" />
|
|
48
|
+
<meta content={site.siteName} property="og:site_name" />
|
|
49
|
+
<meta content={title ?? site.siteName} property="og:title" />
|
|
50
|
+
{#if description}
|
|
51
|
+
<meta content={description} property="og:description" />
|
|
52
|
+
{/if}
|
|
53
|
+
<meta content={url} property="og:url" />
|
|
54
|
+
<meta content="website" property="og:type" />
|
|
55
|
+
{#if picture}
|
|
56
|
+
<meta content={picture} property="og:image" />
|
|
57
|
+
{/if}
|
|
58
|
+
{/if}
|
|
59
|
+
</svelte:head>
|
package/head/context.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
|
|
3
|
+
/** What every page's `<Head>` shares: set once in the app's root layout. */
|
|
4
|
+
export type HeadSite = {
|
|
5
|
+
/** True for apps that must stay out of search results (admins, private tools). */
|
|
6
|
+
noindex?: boolean;
|
|
7
|
+
/** Goes between the page title and the site name. Default `' · '`. */
|
|
8
|
+
separator?: string;
|
|
9
|
+
/** Absolute URL of the picture link previews show, unless a page passes its own. */
|
|
10
|
+
shareImage?: string;
|
|
11
|
+
siteName: string;
|
|
12
|
+
/** The public origin, e.g. `https://www.keycrox.co.uk`. Without it, no canonical or share tags. */
|
|
13
|
+
siteUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const KEY = Symbol.for('@zeyolabs/ui/head');
|
|
17
|
+
|
|
18
|
+
/** The site's `<Head>` settings, for every page below this layout. */
|
|
19
|
+
export function setHeadContext(site: HeadSite): void {
|
|
20
|
+
setContext(KEY, site);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function headContext(): HeadSite {
|
|
24
|
+
const site = getContext<HeadSite | undefined>(KEY);
|
|
25
|
+
if (!site) throw new Error('@zeyolabs/ui/head: call setHeadContext() in the root layout');
|
|
26
|
+
return site;
|
|
27
|
+
}
|
package/menu/MenuButton.svelte
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeyolabs/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.42",
|
|
4
4
|
"description": "Shared Svelte 5 components, form fields and design tokens for SvelteKit 3 apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"form",
|
|
47
47
|
"gallery",
|
|
48
48
|
"grouped-grid",
|
|
49
|
+
"head",
|
|
49
50
|
"layout",
|
|
50
51
|
"list-row",
|
|
51
52
|
"menu",
|
|
@@ -129,7 +130,8 @@
|
|
|
129
130
|
"./gallery/*": "./gallery/*",
|
|
130
131
|
"./theme/theme.svelte": "./theme/theme.svelte.ts",
|
|
131
132
|
"./theme/*": "./theme/*",
|
|
132
|
-
"./turnstile/*": "./turnstile/*"
|
|
133
|
+
"./turnstile/*": "./turnstile/*",
|
|
134
|
+
"./head/*": "./head/*"
|
|
133
135
|
},
|
|
134
136
|
"peerDependencies": {
|
|
135
137
|
"@zeyolabs/kit": ">=2026.11.6",
|
|
@@ -153,7 +155,7 @@
|
|
|
153
155
|
"devDependencies": {
|
|
154
156
|
"@eslint/compat": "2.1.1",
|
|
155
157
|
"@eslint/js": "10.0.1",
|
|
156
|
-
"@zeyolabs/kit": "2026.11.
|
|
158
|
+
"@zeyolabs/kit": "2026.11.42",
|
|
157
159
|
"@sveltejs/kit": "3.2.0",
|
|
158
160
|
"@types/flickity": "2.2.12",
|
|
159
161
|
"eslint": "10.15.0",
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
<div>
|
|
122
122
|
<div class="flex {heightClass[height]} items-stretch gap-px">
|
|
123
123
|
{#each range(maxSlots) as index (index)}
|
|
124
|
-
{
|
|
124
|
+
{const slot = $derived(paddedSlots[index])}
|
|
125
125
|
{#if slot}
|
|
126
|
-
{
|
|
127
|
-
{
|
|
128
|
-
{
|
|
126
|
+
{const [key, value] = $derived(slot)}
|
|
127
|
+
{const isDeselected = $derived(selected !== undefined && selected !== key)}
|
|
128
|
+
{const slotColor = $derived(backgroundClass[value.color])}
|
|
129
129
|
{#if onSelect}
|
|
130
130
|
<button
|
|
131
131
|
class="{baseSlotClass} cursor-pointer {slotColor} transition-opacity hover:opacity-80"
|