@zeyolabs/ui 2026.11.8 → 2026.11.10
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/package.json +2 -2
- package/text/Title.svelte +20 -3
- package/typography.css +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeyolabs/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.10",
|
|
4
4
|
"description": "Shared Svelte 5 components, form fields and design tokens for SvelteKit 3 apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"devDependencies": {
|
|
153
153
|
"@eslint/compat": "2.1.1",
|
|
154
154
|
"@eslint/js": "9.39.4",
|
|
155
|
-
"@zeyolabs/kit": "2026.11.
|
|
155
|
+
"@zeyolabs/kit": "2026.11.13",
|
|
156
156
|
"@sveltejs/kit": "3.1.1",
|
|
157
157
|
"@types/flickity": "2.2.12",
|
|
158
158
|
"eslint": "9.39.4",
|
package/text/Title.svelte
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
import { BG_CLASS, type Color, COLOR_CLASS } from './color';
|
|
5
5
|
|
|
6
6
|
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
type Size = 'lg' | 'md' | 'sm' | 'xl';
|
|
8
|
+
|
|
9
|
+
const DEFAULT_SIZE: Record<Level, Size> = {
|
|
10
|
+
1: 'xl',
|
|
11
|
+
2: 'lg',
|
|
12
|
+
3: 'md',
|
|
13
|
+
4: 'md',
|
|
14
|
+
5: 'sm',
|
|
15
|
+
6: 'sm',
|
|
16
|
+
};
|
|
7
17
|
|
|
8
18
|
let {
|
|
9
19
|
bg,
|
|
@@ -16,6 +26,7 @@
|
|
|
16
26
|
color,
|
|
17
27
|
level,
|
|
18
28
|
maxWidth,
|
|
29
|
+
size,
|
|
19
30
|
truncate = false,
|
|
20
31
|
}: {
|
|
21
32
|
/** Tinted chip background behind the text (e.g. flagging one invalid cell/value without
|
|
@@ -31,8 +42,13 @@
|
|
|
31
42
|
clamp?: number;
|
|
32
43
|
class?: string;
|
|
33
44
|
color?: Color;
|
|
45
|
+
/** The tag only: renders `h{level}` for the document outline. It sets the look only through the
|
|
46
|
+
* default `size` below. */
|
|
34
47
|
level: Level;
|
|
35
48
|
maxWidth?: string;
|
|
49
|
+
/** The look: `xl` | `lg` | `md` | `sm`. Omit it and it follows `level` (1 xl, 2 lg, 3-4 md,
|
|
50
|
+
* 5-6 sm), so pass it only when the look and the tag differ. */
|
|
51
|
+
size?: Size;
|
|
36
52
|
/** Single-line ellipsis. Needs a bounded width from context (a flex child needs its own
|
|
37
53
|
* `min-width: 0`/`flex: 1` via `class`, or pass `maxWidth`). Clips only the inline axis —
|
|
38
54
|
* unlike Tailwind's `truncate`, the vertical axis stays `visible` so descenders (the font's
|
|
@@ -41,6 +57,7 @@
|
|
|
41
57
|
} = $props();
|
|
42
58
|
|
|
43
59
|
const tag = $derived(`h${level}` as const);
|
|
60
|
+
const look = $derived(size ?? DEFAULT_SIZE[level]);
|
|
44
61
|
const inlineStyle = $derived(
|
|
45
62
|
`${maxWidth ? `max-width:${maxWidth};` : ''}${clamp ? `display:-webkit-box;-webkit-line-clamp:${clamp};line-clamp:${clamp};-webkit-box-orient:vertical;overflow:hidden;` : ''}`
|
|
46
63
|
);
|
|
@@ -49,9 +66,9 @@
|
|
|
49
66
|
<svelte:element
|
|
50
67
|
this={tag}
|
|
51
68
|
style={inlineStyle}
|
|
52
|
-
class="{bold ? 'bold' : ''} {centered ? 'text-center' : ''} {color
|
|
53
|
-
?
|
|
54
|
-
: ''} {className}"
|
|
69
|
+
class="title-{look} {bold ? 'bold' : ''} {centered ? 'text-center' : ''} {color
|
|
70
|
+
? COLOR_CLASS[color]
|
|
71
|
+
: ''} {bg ? BG_CLASS[bg] : ''} {className}"
|
|
55
72
|
class:center-below={centerBelow}
|
|
56
73
|
class:truncate-title={truncate}
|
|
57
74
|
>
|
package/typography.css
CHANGED
|
@@ -87,6 +87,36 @@
|
|
|
87
87
|
line-height: 1.5;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/* `Title` sizes: the look, independent of the h1-h6 tag it renders. Classes beat the bare
|
|
91
|
+
element selectors above, so an h1 at `md` looks like `md`. Bare headings are unchanged. */
|
|
92
|
+
.title-xl {
|
|
93
|
+
font-size: clamp(2.25rem, 6vw, 56px);
|
|
94
|
+
font-weight: 400;
|
|
95
|
+
line-height: 1.08;
|
|
96
|
+
letter-spacing: -2px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.title-lg {
|
|
100
|
+
font-size: clamp(1.85rem, 5vw, 48px);
|
|
101
|
+
font-weight: 400;
|
|
102
|
+
line-height: 1.08;
|
|
103
|
+
letter-spacing: -2px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.title-md {
|
|
107
|
+
font-size: 22px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
line-height: 1.3;
|
|
110
|
+
letter-spacing: -0.01em;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.title-sm {
|
|
114
|
+
font-size: 16px;
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
line-height: 1.5;
|
|
117
|
+
letter-spacing: -0.01em;
|
|
118
|
+
}
|
|
119
|
+
|
|
90
120
|
.xs {
|
|
91
121
|
font-size: 11px;
|
|
92
122
|
letter-spacing: 0.01em;
|