@zeyolabs/ui 2026.11.5 → 2026.11.6
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/README.md +2 -2
- package/package.json +3 -1
- package/sidebar/Sidebar.svelte +73 -0
- package/sidebar/SidebarBrand.svelte +32 -0
- package/sidebar/SidebarButton.svelte +31 -0
- package/sidebar/SidebarGroup.svelte +39 -0
- package/sidebar/SidebarItem.svelte +48 -0
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ The app must enable async Svelte and remote functions in its `vite.config.ts`
|
|
|
25
25
|
|
|
26
26
|
## Showcase
|
|
27
27
|
|
|
28
|
-
`showcase/` is a SvelteKit app rendering every component live (ui.
|
|
28
|
+
`showcase/` is a SvelteKit app rendering every component live (ui.zeyo.dev).
|
|
29
29
|
`pnpm showcase:dev`, `pnpm showcase:build`. It deploys on push to main
|
|
30
|
-
(`deploy-showcase.yaml`,
|
|
30
|
+
(`deploy-showcase.yaml`, with `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` from the `production` environment, which only `main` can use).
|
|
31
31
|
|
|
32
32
|
## Versions
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeyolabs/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.6",
|
|
4
4
|
"description": "Shared Svelte 5 components, form fields and design tokens for SvelteKit 3 apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"popover",
|
|
57
57
|
"query-state",
|
|
58
58
|
"schema.ts",
|
|
59
|
+
"sidebar",
|
|
59
60
|
"skeleton",
|
|
60
61
|
"spacing.css",
|
|
61
62
|
"stat",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"./form/*": "./form/*",
|
|
98
99
|
"./menu/*": "./menu/*",
|
|
99
100
|
"./popover/*": "./popover/*",
|
|
101
|
+
"./sidebar/*": "./sidebar/*",
|
|
100
102
|
"./skeleton/*": "./skeleton/*",
|
|
101
103
|
"./error/*": "./error/*",
|
|
102
104
|
"./card/*": "./card/*",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/** App sidebar column: brand on top, fixed primary links, a scrolling body of groups, and a
|
|
5
|
+
* footer row (user, theme toggle, sign out). Fills its parent's height; pair with SplitShell. */
|
|
6
|
+
let {
|
|
7
|
+
brand,
|
|
8
|
+
children,
|
|
9
|
+
foot,
|
|
10
|
+
label = 'Main',
|
|
11
|
+
links,
|
|
12
|
+
}: {
|
|
13
|
+
brand?: Snippet;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
foot?: Snippet;
|
|
16
|
+
label?: string;
|
|
17
|
+
links?: Snippet;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<nav class="sidebar" aria-label={label}>
|
|
22
|
+
{@render brand?.()}
|
|
23
|
+
|
|
24
|
+
{#if links}
|
|
25
|
+
<ul class="sidebar-links">{@render links()}</ul>
|
|
26
|
+
{/if}
|
|
27
|
+
|
|
28
|
+
{#if children}
|
|
29
|
+
<div class="sidebar-body" class:sidebar-body--ruled={!!links}>{@render children()}</div>
|
|
30
|
+
{/if}
|
|
31
|
+
|
|
32
|
+
{#if foot}
|
|
33
|
+
<div class="sidebar-foot">{@render foot()}</div>
|
|
34
|
+
{/if}
|
|
35
|
+
</nav>
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
.sidebar {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 10px;
|
|
42
|
+
height: 100%;
|
|
43
|
+
padding: 10px 8px;
|
|
44
|
+
background: var(--sf);
|
|
45
|
+
}
|
|
46
|
+
.sidebar-links {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 1px;
|
|
50
|
+
list-style: none;
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
}
|
|
54
|
+
.sidebar-body {
|
|
55
|
+
flex: 1;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
overflow-y: auto;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 10px;
|
|
61
|
+
}
|
|
62
|
+
.sidebar-body--ruled {
|
|
63
|
+
padding-top: 6px;
|
|
64
|
+
border-top: 1px solid var(--bds);
|
|
65
|
+
}
|
|
66
|
+
.sidebar-foot {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 4px;
|
|
70
|
+
padding-top: 8px;
|
|
71
|
+
border-top: 1px solid var(--bds);
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/** Sidebar header: a small filled mark (one letter) beside the product name. */
|
|
3
|
+
let { href, label, mark }: { href: string; label: string; mark?: string } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<a class="sidebar-brand" {href}>
|
|
7
|
+
<span class="sidebar-mark" aria-hidden="true">{mark ?? label.charAt(0).toLowerCase()}</span>
|
|
8
|
+
<span>{label}</span>
|
|
9
|
+
</a>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
.sidebar-brand {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
padding: 2px 6px;
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
font-size: 15px;
|
|
19
|
+
color: var(--tx);
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
.sidebar-mark {
|
|
23
|
+
display: grid;
|
|
24
|
+
place-items: center;
|
|
25
|
+
width: 22px;
|
|
26
|
+
height: 22px;
|
|
27
|
+
border-radius: var(--radius-sm);
|
|
28
|
+
background: var(--primary-strong);
|
|
29
|
+
color: var(--primary-soft);
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
/** Square 26px icon button for the sidebar footer (theme toggle, sign out). Pass `aria-label`. */
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
type = 'button',
|
|
9
|
+
...rest
|
|
10
|
+
}: HTMLButtonAttributes & { children: Snippet } = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<button class="sidebar-btn" {type} {...rest}>{@render children()}</button>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.sidebar-btn {
|
|
17
|
+
display: grid;
|
|
18
|
+
place-items: center;
|
|
19
|
+
width: 26px;
|
|
20
|
+
height: 26px;
|
|
21
|
+
border-radius: var(--radius-sm);
|
|
22
|
+
border: none;
|
|
23
|
+
background: none;
|
|
24
|
+
color: var(--txs);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
.sidebar-btn:hover {
|
|
28
|
+
background: var(--sfh);
|
|
29
|
+
color: var(--tx);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/** A titled list of SidebarItems. `href` makes the uppercase title a link (e.g. a project). */
|
|
5
|
+
let { children, href, label }: { children: Snippet; href?: string; label: string } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<section>
|
|
9
|
+
{#if href}
|
|
10
|
+
<a class="sidebar-group-label sidebar-group-label--link" {href}>{label}</a>
|
|
11
|
+
{:else}
|
|
12
|
+
<span class="sidebar-group-label">{label}</span>
|
|
13
|
+
{/if}
|
|
14
|
+
<ul>{@render children()}</ul>
|
|
15
|
+
</section>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
ul {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 1px;
|
|
22
|
+
list-style: none;
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
26
|
+
.sidebar-group-label {
|
|
27
|
+
display: block;
|
|
28
|
+
padding: 2px 8px;
|
|
29
|
+
font-size: 11px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
letter-spacing: 0.04em;
|
|
32
|
+
text-transform: uppercase;
|
|
33
|
+
color: var(--txt);
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
.sidebar-group-label--link:hover {
|
|
37
|
+
color: var(--tx);
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component, Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/** One 26px sidebar row (renders its own `<li>`). `current` tints it and sets
|
|
5
|
+
* aria-current="page"; the caller decides what counts as current. */
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
current = false,
|
|
9
|
+
href,
|
|
10
|
+
icon: Icon,
|
|
11
|
+
iconSize = 14,
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
current?: boolean;
|
|
15
|
+
href: string;
|
|
16
|
+
icon?: Component<{ size?: number }>;
|
|
17
|
+
iconSize?: number;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<li>
|
|
22
|
+
<a class="sidebar-item" aria-current={current ? 'page' : undefined} {href}>
|
|
23
|
+
{#if Icon}<Icon size={iconSize} />{/if}
|
|
24
|
+
{@render children()}
|
|
25
|
+
</a>
|
|
26
|
+
</li>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.sidebar-item {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 6px;
|
|
33
|
+
height: 26px;
|
|
34
|
+
padding: 0 8px;
|
|
35
|
+
border-radius: var(--radius-sm);
|
|
36
|
+
color: var(--txs);
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
}
|
|
39
|
+
.sidebar-item:hover {
|
|
40
|
+
background: var(--sfh);
|
|
41
|
+
color: var(--tx);
|
|
42
|
+
}
|
|
43
|
+
.sidebar-item[aria-current='page'] {
|
|
44
|
+
background: color-mix(in srgb, var(--primary) 16%, transparent);
|
|
45
|
+
color: var(--primary);
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
}
|
|
48
|
+
</style>
|