@spaethtech/svelte-ui 0.21.3-dev.142.aa5d0fa → 0.21.4-dev.145.a66fc9d
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/CLAUDE.md +3 -0
- package/dist/components/Alert.svelte +1 -1
- package/dist/components/Avatar/Avatar.svelte +1 -1
- package/dist/components/Avatar/AvatarGroup.svelte +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte +1 -1
- package/dist/components/Button.svelte +1 -1
- package/dist/components/Calendar.svelte +3 -3
- package/dist/components/CommandPalette/CommandPalette.svelte +1 -1
- package/dist/components/ConfirmDialog.svelte +1 -1
- package/dist/components/DataTable.svelte +2 -2
- package/dist/components/Disclosure.svelte +1 -1
- package/dist/components/Disclosure2.svelte +1 -1
- package/dist/components/EmptyState/EmptyState.svelte +1 -1
- package/dist/components/FieldChrome.svelte +1 -1
- package/dist/components/FieldsetChrome.svelte +1 -1
- package/dist/components/FileList/FileList.svelte +1 -1
- package/dist/components/FileUpload/FileUpload.svelte +1 -1
- package/dist/components/Kbd/Kbd.svelte +1 -1
- package/dist/components/NotesEditor.svelte +1 -1
- package/dist/components/Query.svelte +5 -5
- package/dist/components/Rating.svelte +1 -1
- package/dist/components/SideBarMenu/SideBarMenu.svelte +1 -1
- package/dist/components/Stat/Stat.svelte +2 -2
- package/dist/components/Stepper/Stepper.svelte +2 -2
- package/dist/components/ThemeSelector.svelte +1 -1
- package/dist/components/TimeSpinner.svelte +2 -2
- package/dist/components/Timeline/Timeline.svelte +1 -1
- package/dist/theme.css +11 -0
- package/docs/themes.md +14 -0
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -238,6 +238,9 @@ user-facing literal in a component is a bug (it's invisible to `svelte-check` an
|
|
|
238
238
|
surfaces (hover/section/pressed) use the shared `--ui-color-hover|surface|active` tints, which
|
|
239
239
|
mix from `--ui-accent`. Full model + rules: the **`themes` skill** (`.claude/skills/themes/`).
|
|
240
240
|
- Consistent heights: `--ui-height` (32px); `--ui-height-sm|lg|touch` for the other tiers
|
|
241
|
+
- **Font weights via `var(--ui-font-weight-*)`** — write `[font-weight:var(--ui-font-weight-semibold)]`
|
|
242
|
+
(or `-normal|-medium|-bold`), **never** a raw Tailwind `font-semibold`/`font-medium`/`font-bold`, so a
|
|
243
|
+
consumer can remap weights in one place (defaults 400/500/600/700, so no visual change)
|
|
241
244
|
- Padding/gap is per-component (a `Record<Size,string>` class map), **not** a token
|
|
242
245
|
|
|
243
246
|
### Performance
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
>
|
|
112
112
|
{/if}
|
|
113
113
|
<div class="flex min-w-0 flex-col">
|
|
114
|
-
{#if title}<span class="font-semibold">{title}</span>{/if}
|
|
114
|
+
{#if title}<span class="[font-weight:var(--ui-font-weight-semibold)]">{title}</span>{/if}
|
|
115
115
|
<span class="min-w-0"
|
|
116
116
|
>{#if children}{@render children()}{:else}{text}{/if}</span
|
|
117
117
|
>
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
<span class="relative inline-flex shrink-0 {cls}" {...rest}>
|
|
86
86
|
<span
|
|
87
|
-
class="ui-avatar inline-flex items-center justify-center overflow-hidden font-medium select-none {shapeClass} {responsiveClasses(
|
|
87
|
+
class="ui-avatar inline-flex items-center justify-center overflow-hidden [font-weight:var(--ui-font-weight-medium)] select-none {shapeClass} {responsiveClasses(
|
|
88
88
|
size,
|
|
89
89
|
boxMap,
|
|
90
90
|
)} {responsiveClasses(size, iconBox)}"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
{/each}
|
|
72
72
|
{#if overflow > 0}
|
|
73
73
|
<span
|
|
74
|
-
class="ui-avatar relative inline-flex shrink-0 items-center justify-center overflow-hidden font-medium select-none {shapeClass} {responsiveClasses(
|
|
74
|
+
class="ui-avatar relative inline-flex shrink-0 items-center justify-center overflow-hidden [font-weight:var(--ui-font-weight-medium)] select-none {shapeClass} {responsiveClasses(
|
|
75
75
|
size,
|
|
76
76
|
boxMap,
|
|
77
77
|
)}"
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
{:else if node.last}
|
|
110
110
|
<span
|
|
111
111
|
aria-current="page"
|
|
112
|
-
class="inline-flex items-center gap-1 px-1 font-medium [color:var(--ui-color-text)] {responsiveClasses(
|
|
112
|
+
class="inline-flex items-center gap-1 px-1 [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)] {responsiveClasses(
|
|
113
113
|
size,
|
|
114
114
|
textSize,
|
|
115
115
|
)}"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
// Base classes - height is always h-8 (32px), width is h-8 for icon-only
|
|
82
82
|
const baseClasses =
|
|
83
|
-
"inline-flex shrink-0 items-center justify-center [border-radius:var(--ui-border-radius)] font-medium transition-colors no-underline cursor-pointer border focus-visible:[outline:2px_solid_color-mix(in_srgb,var(--ui-color-text)_70%,transparent)] focus-visible:[outline-offset:0px]";
|
|
83
|
+
"inline-flex shrink-0 items-center justify-center [border-radius:var(--ui-border-radius)] [font-weight:var(--ui-font-weight-medium)] transition-colors no-underline cursor-pointer border focus-visible:[outline:2px_solid_color-mix(in_srgb,var(--ui-color-text)_70%,transparent)] focus-visible:[outline-offset:0px]";
|
|
84
84
|
|
|
85
85
|
// Additional classes for disabled state (only applies to buttons)
|
|
86
86
|
const disabledClasses = href ? "" : "disabled:opacity-50 disabled:cursor-not-allowed";
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
class="grid {sizing.nav} place-items-center rounded-[var(--ui-border-radius)] hover:[background-color:var(--ui-color-hover)] active:[background-color:var(--ui-color-active)]"
|
|
198
198
|
onclick={() => go(-1)}><IconLeft class="size-5" /></button
|
|
199
199
|
>
|
|
200
|
-
<span class="{sizing.label} font-medium">{monthLabel}</span>
|
|
200
|
+
<span class="{sizing.label} [font-weight:var(--ui-font-weight-medium)]">{monthLabel}</span>
|
|
201
201
|
<button
|
|
202
202
|
type="button"
|
|
203
203
|
aria-label={i18n.messages.nextMonth}
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
</div>
|
|
208
208
|
|
|
209
209
|
<div class="grid grid-cols-7 {subtle}">
|
|
210
|
-
{#each weekdays as w (w)}<div class="grid {sizing.cell} place-items-center font-medium">
|
|
210
|
+
{#each weekdays as w (w)}<div class="grid {sizing.cell} place-items-center [font-weight:var(--ui-font-weight-medium)]">
|
|
211
211
|
{w}
|
|
212
212
|
</div>{/each}
|
|
213
213
|
</div>
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
class="grid {sizing.cell} place-items-center rounded-[var(--ui-border-radius)] transition-colors
|
|
245
245
|
{disabled ? 'cursor-not-allowed opacity-30' : 'cursor-pointer'}
|
|
246
246
|
{edge
|
|
247
|
-
? '[background-color:var(--accent)] font-semibold text-white'
|
|
247
|
+
? '[background-color:var(--accent)] [font-weight:var(--ui-font-weight-semibold)] text-white'
|
|
248
248
|
: !disabled && !band
|
|
249
249
|
? 'hover:[background-color:var(--ui-color-hover)] active:[background-color:var(--ui-color-active)]'
|
|
250
250
|
: ''}
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
{:else}
|
|
173
173
|
{#each groups as g (g.name)}
|
|
174
174
|
{#if g.name}
|
|
175
|
-
<li class="px-3 pb-1 pt-3 text-xs font-medium uppercase tracking-wide [color:color-mix(in_srgb,var(--ui-color-text)_45%,transparent)]">
|
|
175
|
+
<li class="px-3 pb-1 pt-3 text-xs [font-weight:var(--ui-font-weight-medium)] uppercase tracking-wide [color:color-mix(in_srgb,var(--ui-color-text)_45%,transparent)]">
|
|
176
176
|
{g.name}
|
|
177
177
|
</li>
|
|
178
178
|
{/if}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
>
|
|
85
85
|
<Card {size} class="w-full shadow-xl">
|
|
86
86
|
<CardHeader {size}>
|
|
87
|
-
<h3 class="text-lg font-medium [color:var(--ui-color-text)]">{title}</h3>
|
|
87
|
+
<h3 class="text-lg [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]">{title}</h3>
|
|
88
88
|
</CardHeader>
|
|
89
89
|
|
|
90
90
|
{#if children}
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
read as bands framing the interactive rows. -->
|
|
301
301
|
<div
|
|
302
302
|
role="row"
|
|
303
|
-
class="flex items-center font-semibold uppercase border
|
|
303
|
+
class="flex items-center [font-weight:var(--ui-font-weight-semibold)] uppercase border
|
|
304
304
|
{cellGap} {cellPad}
|
|
305
305
|
[border-top-left-radius:var(--ui-border-radius)] [border-top-right-radius:var(--ui-border-radius)]
|
|
306
306
|
[color:var(--ui-color-text)]"
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
}
|
|
491
491
|
: undefined}
|
|
492
492
|
>
|
|
493
|
-
<div role="cell" class="flex min-w-0 grow items-center gap-2 font-semibold">
|
|
493
|
+
<div role="cell" class="flex min-w-0 grow items-center gap-2 [font-weight:var(--ui-font-weight-semibold)]">
|
|
494
494
|
{#if groupHeader}
|
|
495
495
|
{@render groupHeader({
|
|
496
496
|
key: item.key,
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
{#if header}
|
|
86
86
|
<span class="flex-1 text-left">{@render header()}</span>
|
|
87
87
|
{:else}
|
|
88
|
-
<span class="flex-1 text-left font-medium {labelText}">{title}</span>
|
|
88
|
+
<span class="flex-1 text-left [font-weight:var(--ui-font-weight-medium)] {labelText}">{title}</span>
|
|
89
89
|
{/if}
|
|
90
90
|
<ChevronDown
|
|
91
91
|
class="shrink-0 motion-safe:transition-transform motion-safe:duration-200 {isOpen
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
// ── Header chrome — mirrors a <Button variant size> (borderless=true, the Disclosure default). ──
|
|
86
86
|
const baseClasses =
|
|
87
|
-
"flex w-full items-center [border-radius:var(--ui-border-radius)] font-medium transition-colors cursor-pointer border focus-visible:[outline:2px_solid_color-mix(in_srgb,var(--ui-color-text)_70%,transparent)] focus-visible:[outline-offset:0px]";
|
|
87
|
+
"flex w-full items-center [border-radius:var(--ui-border-radius)] [font-weight:var(--ui-font-weight-medium)] transition-colors cursor-pointer border focus-visible:[outline:2px_solid_color-mix(in_srgb,var(--ui-color-text)_70%,transparent)] focus-visible:[outline-offset:0px]";
|
|
88
88
|
const padMap: Record<Size, string> = { sm: "h-6 px-2.5", md: "h-8 px-4", lg: "h-10 px-6" };
|
|
89
89
|
const textMap: Record<Size, string> = { sm: "text-xs", md: "text-sm", lg: "text-base" };
|
|
90
90
|
const svgMap: Record<Size, string> = {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</div>
|
|
57
57
|
|
|
58
58
|
{#if title}
|
|
59
|
-
<h3 class="font-semibold [color:var(--ui-color-text)] {responsiveClasses(size, titleSize)}">
|
|
59
|
+
<h3 class="[font-weight:var(--ui-font-weight-semibold)] [color:var(--ui-color-text)] {responsiveClasses(size, titleSize)}">
|
|
60
60
|
{title}
|
|
61
61
|
</h3>
|
|
62
62
|
{/if}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
{#if label}
|
|
76
76
|
<label
|
|
77
77
|
for={controlId}
|
|
78
|
-
class="{labelText} truncate font-medium [color:var(--ui-color-text)]"
|
|
78
|
+
class="{labelText} truncate [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]"
|
|
79
79
|
>
|
|
80
80
|
{label}{#if required}<span aria-hidden="true" class="[color:var(--ui-color-error)]"> *</span
|
|
81
81
|
>{/if}
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<!-- legend stays a direct <fieldset> child (a11y); the row layout lives inside it -->
|
|
65
65
|
<legend class="flex w-full items-center justify-between gap-2 p-0">
|
|
66
66
|
{#if label}
|
|
67
|
-
<span class="{labelText} font-medium [color:var(--ui-color-text)]"
|
|
67
|
+
<span class="{labelText} [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]"
|
|
68
68
|
>{label}{#if required}<span aria-hidden="true" class="[color:var(--ui-color-error)]"> *</span
|
|
69
69
|
>{/if}</span
|
|
70
70
|
>
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
>
|
|
278
278
|
<div
|
|
279
279
|
role="row"
|
|
280
|
-
class="{cols} border-b px-3 py-2 font-medium [border-color:var(--ui-border-color)] {muted}"
|
|
280
|
+
class="{cols} border-b px-3 py-2 [font-weight:var(--ui-font-weight-medium)] [border-color:var(--ui-border-color)] {muted}"
|
|
281
281
|
>
|
|
282
282
|
{@render head("name", i18n.messages.colName)}
|
|
283
283
|
{@render head("modified", i18n.messages.colDateModified, "hidden @lg:block")}
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
>
|
|
157
157
|
<span class="[&_svg]:w-8 [&_svg]:h-8 [color:var(--ui-color-secondary)]"><IconUpload /></span>
|
|
158
158
|
<div>
|
|
159
|
-
<span class="font-medium [color:var(--ui-color-text)]">Drop files here</span>
|
|
159
|
+
<span class="[font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]">Drop files here</span>
|
|
160
160
|
<span class="[color:color-mix(in_srgb,var(--ui-color-text)_60%,transparent)]"> or</span>
|
|
161
161
|
</div>
|
|
162
162
|
<Button text="Browse" {variant} {size} onclick={openPicker} />
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
};
|
|
37
37
|
// Keycap: subtle surface fill, tinted border with a slightly darker bottom edge (a shallow 3D key).
|
|
38
38
|
const cap =
|
|
39
|
-
"inline-flex items-center justify-center rounded border font-medium [font-family:ui-monospace,SFMono-Regular,Menlo,monospace] [background-color:var(--ui-color-surface)] [border-color:var(--ui-border-color)] [box-shadow:inset_0_-1px_0_var(--ui-border-color)] [color:var(--ui-color-text)] select-none";
|
|
39
|
+
"inline-flex items-center justify-center rounded border [font-weight:var(--ui-font-weight-medium)] [font-family:ui-monospace,SFMono-Regular,Menlo,monospace] [background-color:var(--ui-color-surface)] [border-color:var(--ui-border-color)] [box-shadow:inset_0_-1px_0_var(--ui-border-color)] [color:var(--ui-color-text)] select-none";
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
{#if list}
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
<div class={className}>
|
|
111
111
|
<!-- Header: label + save status -->
|
|
112
112
|
<div class="flex items-center justify-between mb-2">
|
|
113
|
-
<span class="block text-sm font-medium [color:var(--ui-color-text)]">Notes</span>
|
|
113
|
+
<span class="block text-sm [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]">Notes</span>
|
|
114
114
|
<span class="text-xs min-h-[16px]" style="color: {status.color}">{status.text}</span>
|
|
115
115
|
</div>
|
|
116
116
|
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
<Dialog bind:isOpen={helpOpen} width="80vw" height="80vh" aria-label={i18n.messages.querySyntax}>
|
|
238
238
|
<Card size="md" class="flex h-full w-full flex-col shadow-xl">
|
|
239
239
|
<CardHeader size="md">
|
|
240
|
-
<h3 class="text-lg font-medium [color:var(--ui-color-text)]">{i18n.messages.querySyntax}</h3>
|
|
240
|
+
<h3 class="text-lg [font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)]">{i18n.messages.querySyntax}</h3>
|
|
241
241
|
</CardHeader>
|
|
242
242
|
<div class="min-h-0 flex-1 space-y-4 overflow-y-auto text-sm [color:var(--ui-color-text)]">
|
|
243
243
|
<p>
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
<code>()</code>.
|
|
247
247
|
</p>
|
|
248
248
|
<div>
|
|
249
|
-
<h4 class="mb-1 font-semibold">{i18n.messages.operators}</h4>
|
|
249
|
+
<h4 class="mb-1 [font-weight:var(--ui-font-weight-semibold)]">{i18n.messages.operators}</h4>
|
|
250
250
|
<table class="w-full text-left">
|
|
251
251
|
<tbody class="[&_td]:py-0.5 [&_td:first-child]:pr-4 [&_td:first-child]:font-mono">
|
|
252
252
|
<tr><td>== !=</td><td>equals / not equals</td></tr>
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
</table>
|
|
260
260
|
</div>
|
|
261
261
|
<div>
|
|
262
|
-
<h4 class="mb-1 font-semibold">{i18n.messages.casts}</h4>
|
|
262
|
+
<h4 class="mb-1 [font-weight:var(--ui-font-weight-semibold)]">{i18n.messages.casts}</h4>
|
|
263
263
|
<p class="mb-1 text-xs [color:color-mix(in_srgb,var(--ui-color-text)_70%,transparent)]">
|
|
264
264
|
A <code class="font-mono">|type</code> after a column or value forces its type for strict comparison
|
|
265
265
|
— one cast per clause; put it on the column and/or the literals.
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
</table>
|
|
278
278
|
</div>
|
|
279
279
|
<div>
|
|
280
|
-
<h4 class="mb-1 font-semibold">Dynamic dates</h4>
|
|
280
|
+
<h4 class="mb-1 [font-weight:var(--ui-font-weight-semibold)]">Dynamic dates</h4>
|
|
281
281
|
<p class="mb-1 text-xs [color:color-mix(in_srgb,var(--ui-color-text)_70%,transparent)]">
|
|
282
282
|
<code class="font-mono">now()</code> is the current time, resolved when the query runs. Add a
|
|
283
283
|
signed offset <code class="font-mono">now()±<n><unit></code> — units
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
</table>
|
|
296
296
|
</div>
|
|
297
297
|
<div>
|
|
298
|
-
<h4 class="mb-1 font-semibold">{i18n.messages.examples}</h4>
|
|
298
|
+
<h4 class="mb-1 [font-weight:var(--ui-font-weight-semibold)]">{i18n.messages.examples}</h4>
|
|
299
299
|
<table class="w-full text-left">
|
|
300
300
|
<tbody
|
|
301
301
|
class="[&_td]:py-0.5 [&_td:first-child]:whitespace-nowrap [&_td:first-child]:pr-4 [&_td:first-child]:font-mono [&_td:last-child]:text-xs [&_td:last-child]:[color:color-mix(in_srgb,var(--ui-color-text)_65%,transparent)]"
|
|
@@ -891,7 +891,7 @@
|
|
|
891
891
|
></span>
|
|
892
892
|
{:else}
|
|
893
893
|
<span
|
|
894
|
-
class="absolute {sz.pillOffset} inline-flex items-center justify-center rounded-full px-1 {sz.pill} {sz.pillText} font-semibold leading-none"
|
|
894
|
+
class="absolute {sz.pillOffset} inline-flex items-center justify-center rounded-full px-1 {sz.pill} {sz.pillText} [font-weight:var(--ui-font-weight-semibold)] leading-none"
|
|
895
895
|
style="background-color: {colorVar}; color: white;"
|
|
896
896
|
aria-hidden="true"
|
|
897
897
|
>
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
<div class="truncate text-sm [color:color-mix(in_srgb,var(--ui-color-text)_60%,transparent)]">
|
|
69
69
|
{label}
|
|
70
70
|
</div>
|
|
71
|
-
<div class="mt-1 font-semibold [color:var(--ui-color-text)] {responsiveClasses(size, valueSize)}">
|
|
71
|
+
<div class="mt-1 [font-weight:var(--ui-font-weight-semibold)] [color:var(--ui-color-text)] {responsiveClasses(size, valueSize)}">
|
|
72
72
|
{value}
|
|
73
73
|
</div>
|
|
74
74
|
{#if delta != null}
|
|
75
75
|
<div class="mt-1 flex items-center gap-1 text-sm" style="color: {deltaColor};">
|
|
76
76
|
{#if up}<IconUp class="w-4 h-4" />{:else if down}<IconDown class="w-4 h-4" />{/if}
|
|
77
|
-
<span class="font-medium tabular-nums">{delta}</span>
|
|
77
|
+
<span class="[font-weight:var(--ui-font-weight-medium)] tabular-nums">{delta}</span>
|
|
78
78
|
{#if deltaLabel}<span class="[color:color-mix(in_srgb,var(--ui-color-text)_50%,transparent)]"
|
|
79
79
|
>{deltaLabel}</span
|
|
80
80
|
>{/if}
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
onclick={onstep ? () => onstep(i) : undefined}
|
|
83
83
|
aria-current={s === "current" ? "step" : undefined}
|
|
84
84
|
aria-label={onstep ? `Step ${i + 1}: ${step.label}` : undefined}
|
|
85
|
-
class="inline-flex shrink-0 items-center justify-center rounded-full border-2 font-semibold {responsiveClasses(
|
|
85
|
+
class="inline-flex shrink-0 items-center justify-center rounded-full border-2 [font-weight:var(--ui-font-weight-semibold)] {responsiveClasses(
|
|
86
86
|
size,
|
|
87
87
|
markerSize,
|
|
88
88
|
)} {onstep
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
<!-- Label + description. -->
|
|
107
107
|
<div class="{isH ? 'mt-2 text-center px-1' : 'pb-4'} min-w-0 {responsiveClasses(size, labelSize)}">
|
|
108
108
|
<div
|
|
109
|
-
class="truncate font-medium {s === 'upcoming'
|
|
109
|
+
class="truncate [font-weight:var(--ui-font-weight-medium)] {s === 'upcoming'
|
|
110
110
|
? '[color:color-mix(in_srgb,var(--ui-color-text)_60%,transparent)]'
|
|
111
111
|
: '[color:var(--ui-color-text)]'}"
|
|
112
112
|
>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<div {...rest} class="flex items-center gap-2">
|
|
45
|
-
<label for="theme-selector" class="{labelClass} font-medium text-[var(--ui-color-text)]"
|
|
45
|
+
<label for="theme-selector" class="{labelClass} [font-weight:var(--ui-font-weight-medium)] text-[var(--ui-color-text)]"
|
|
46
46
|
>Theme:</label
|
|
47
47
|
>
|
|
48
48
|
<Select
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
style="--accent: {accent}"
|
|
158
158
|
>
|
|
159
159
|
{#each cols as c (c.label)}
|
|
160
|
-
{#if c.colon}<span class="{sizing.val} grid place-items-center pb-0 font-semibold opacity-60"
|
|
160
|
+
{#if c.colon}<span class="{sizing.val} grid place-items-center pb-0 [font-weight:var(--ui-font-weight-semibold)] opacity-60"
|
|
161
161
|
>:</span
|
|
162
162
|
>{/if}
|
|
163
163
|
<div class="flex flex-col items-center">
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
aria-label={c.label}
|
|
175
175
|
aria-valuetext={c.display}
|
|
176
176
|
tabindex="0"
|
|
177
|
-
class="{sizing.val} grid cursor-ns-resize place-items-center rounded-[var(--ui-border-radius)] text-center font-semibold tabular-nums select-none focus:outline-none focus-visible:[outline:2px_solid_var(--accent)]"
|
|
177
|
+
class="{sizing.val} grid cursor-ns-resize place-items-center rounded-[var(--ui-border-radius)] text-center [font-weight:var(--ui-font-weight-semibold)] tabular-nums select-none focus:outline-none focus-visible:[outline:2px_solid_var(--accent)]"
|
|
178
178
|
onwheel={(e) => {
|
|
179
179
|
e.preventDefault();
|
|
180
180
|
apply(e.deltaY > 0 ? c.down : c.up);
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<!-- Content. -->
|
|
80
80
|
<div class="min-w-0 flex-1 pb-6">
|
|
81
81
|
<div class="flex flex-wrap items-baseline gap-x-2">
|
|
82
|
-
<span class="font-medium [color:var(--ui-color-text)] {responsiveClasses(size, titleSize)}">
|
|
82
|
+
<span class="[font-weight:var(--ui-font-weight-medium)] [color:var(--ui-color-text)] {responsiveClasses(size, titleSize)}">
|
|
83
83
|
{item.title}
|
|
84
84
|
</span>
|
|
85
85
|
{#if item.time}
|
package/dist/theme.css
CHANGED
|
@@ -128,6 +128,17 @@
|
|
|
128
128
|
--ui-tint-border: 50%;
|
|
129
129
|
--ui-tint-border-hover: 80%;
|
|
130
130
|
--ui-tint-strong: 80%;
|
|
131
|
+
|
|
132
|
+
/* Font weights — the scale components render "normal / medium / semibold / bold" through, instead of
|
|
133
|
+
* hard-coded Tailwind weights, so a project whose font ships only some weights can remap them in ONE
|
|
134
|
+
* place and every component follows. Defaults match the Tailwind values the components used before, so
|
|
135
|
+
* output is byte-identical unless overridden. A font with only 400/700, for example, sets
|
|
136
|
+
* `--ui-font-weight-medium: 400; --ui-font-weight-semibold: 700;` (bold already 700). Theme-independent
|
|
137
|
+
* constants (no colour → no per-theme scope needed). */
|
|
138
|
+
--ui-font-weight-normal: 400;
|
|
139
|
+
--ui-font-weight-medium: 500;
|
|
140
|
+
--ui-font-weight-semibold: 600;
|
|
141
|
+
--ui-font-weight-bold: 700;
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
/* Accent scoping — opt-in. Set --ui-accent on an element with this class (components do this from a
|
package/docs/themes.md
CHANGED
|
@@ -82,6 +82,20 @@ theme-independent** (identical in light and dark) — only the accent color flip
|
|
|
82
82
|
|
|
83
83
|
- `--ui-icon-sm` — `0.875rem` / 14px · `--ui-icon` — `1rem` / 16px (default) · `--ui-icon-lg` — `1.25rem` / 20px
|
|
84
84
|
|
|
85
|
+
### Font weights
|
|
86
|
+
|
|
87
|
+
Components render their type weights through these (not hard-coded Tailwind `font-medium`/`font-semibold`),
|
|
88
|
+
so a project whose font ships only some weights can remap them in **one** place and every component follows:
|
|
89
|
+
|
|
90
|
+
- `--ui-font-weight-normal` — `400`
|
|
91
|
+
- `--ui-font-weight-medium` — `500`
|
|
92
|
+
- `--ui-font-weight-semibold` — `600`
|
|
93
|
+
- `--ui-font-weight-bold` — `700`
|
|
94
|
+
|
|
95
|
+
Defaults match the former Tailwind weights, so there's **no visual change** unless you override. A font
|
|
96
|
+
with only 400/700 remaps the in-between tiers — e.g. `--ui-font-weight-medium: 400; --ui-font-weight-semibold: 700;`
|
|
97
|
+
(bold is already 700). Theme-independent (same in light and dark).
|
|
98
|
+
|
|
85
99
|
> Per-component **padding / gap** is NOT a token — each component maps the `size` prop to Tailwind
|
|
86
100
|
> class maps (`Record<Size, string>`) internally. (The old `--ui-padding*` and `--ui-border` width
|
|
87
101
|
> tokens were removed.)
|