refactor(toolkit): type source any with proper types

Genuinely type composable any usages (useStepper/useStorage/useForm/
createEventHook/useSorted/etc.) as proper generics/unknown; keep idiomatic
any-function and overload-impl signatures with comments; skipped test -> .todo.
This commit is contained in:
2026-06-15 16:55:07 +07:00
parent 44848bc9e6
commit aa2938cb34
283 changed files with 3505 additions and 3482 deletions
@@ -26,43 +26,43 @@ onUnmounted(stop);
</script>
<template>
<div class="w-full max-w-sm flex flex-col gap-4">
<div class="demo-stack max-w-sm">
<div class="flex items-center justify-between">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">Two-way sync + transform</span>
<span class="demo-label">Two-way sync + transform</span>
<span
class="inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-xs font-medium"
:class="synced
? 'border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400'
: 'border-(--border) bg-(--bg-inset) text-(--fg-muted)'"
: 'border-border bg-bg-inset text-fg-muted'"
>
<span
class="size-1.5 rounded-full"
:class="synced ? 'bg-emerald-500' : 'bg-(--fg-subtle)'"
:class="synced ? 'bg-emerald-500' : 'bg-fg-subtle'"
/>
{{ synced ? 'live' : 'stopped' }}
</span>
</div>
<div class="grid grid-cols-2 gap-3">
<label class="rounded-xl border border-(--border) bg-(--bg-elevated) p-4 flex flex-col gap-2">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">Celsius</span>
<label class="demo-card p-4 flex flex-col gap-2">
<span class="demo-label">Celsius</span>
<input
v-model.number="celsius"
type="number"
class="w-full rounded-lg border border-(--border) bg-(--bg) px-3 py-2 text-lg font-mono tabular-nums text-(--fg) transition focus:border-(--accent) focus:outline-none focus:ring-2 focus:ring-(--ring)"
class="w-full rounded-lg border border-border bg-bg px-3 py-2 text-lg font-mono tabular-nums text-fg transition focus:border-accent focus:outline-none focus:ring-2 focus:ring-ring"
>
</label>
<label class="rounded-xl border border-(--border) bg-(--bg-elevated) p-4 flex flex-col gap-2">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">Fahrenheit</span>
<label class="demo-card p-4 flex flex-col gap-2">
<span class="demo-label">Fahrenheit</span>
<input
v-model.number="fahrenheit"
type="number"
class="w-full rounded-lg border border-(--border) bg-(--bg) px-3 py-2 text-lg font-mono tabular-nums text-(--fg) transition focus:border-(--accent) focus:outline-none focus:ring-2 focus:ring-(--ring)"
class="w-full rounded-lg border border-border bg-bg px-3 py-2 text-lg font-mono tabular-nums text-fg transition focus:border-accent focus:outline-none focus:ring-2 focus:ring-ring"
>
</label>
</div>
<div class="rounded-lg border border-(--border) bg-(--bg-inset) p-3 font-mono text-sm text-(--fg) tabular-nums">
<div class="rounded-lg border border-border bg-bg-inset p-3 font-mono text-sm text-fg tabular-nums">
{{ celsius }}°C {{ fahrenheit }}°F
</div>
@@ -72,19 +72,19 @@ onUnmounted(stop);
min="-20"
max="40"
step="1"
class="w-full accent-(--accent) cursor-pointer"
class="w-full accent-accent cursor-pointer"
aria-label="Celsius slider"
>
<button
type="button"
:disabled="!synced"
class="inline-flex items-center justify-center gap-1.5 rounded-lg border border-(--border) bg-(--bg-elevated) px-3 py-1.5 text-sm font-medium text-(--fg) transition hover:bg-(--bg-inset) hover:border-(--border-strong) active:scale-[0.98] cursor-pointer disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100"
class="demo-btn disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100"
@click="toggleSync"
>
Stop synchronization
</button>
<p v-if="!synced" class="text-xs text-(--fg-subtle) -mt-2">
<p v-if="!synced" class="text-xs text-fg-subtle -mt-2">
Watchers torn down the two refs now drift independently.
</p>
</div>