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,48 +26,48 @@ async function onShare() {
</script>
<template>
<div class="flex w-full max-w-sm 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)">
<span class="demo-label">
Web Share API
</span>
<span
class="inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-xs font-medium"
:class="isSupported
? '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="isSupported ? 'bg-emerald-500' : 'bg-(--fg-subtle)'"
:class="isSupported ? 'bg-emerald-500' : 'bg-fg-subtle'"
/>
{{ isSupported ? 'Supported' : 'Unsupported' }}
</span>
</div>
<div class="flex flex-col gap-3 rounded-xl border border-(--border) bg-(--bg-elevated) p-4">
<div class="demo-card flex flex-col gap-3 p-4">
<label class="flex flex-col gap-1.5">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">Title</span>
<span class="demo-label">Title</span>
<input
v-model="payload.title"
type="text"
class="w-full rounded-lg border border-(--border) bg-(--bg) px-3 py-2 text-sm text-(--fg) placeholder:text-(--fg-subtle) transition focus:border-(--accent) focus:outline-none focus:ring-2 focus:ring-(--ring)"
class="demo-input"
>
</label>
<label class="flex flex-col gap-1.5">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">Text</span>
<span class="demo-label">Text</span>
<input
v-model="payload.text"
type="text"
class="w-full rounded-lg border border-(--border) bg-(--bg) px-3 py-2 text-sm text-(--fg) placeholder:text-(--fg-subtle) transition focus:border-(--accent) focus:outline-none focus:ring-2 focus:ring-(--ring)"
class="demo-input"
>
</label>
<label class="flex flex-col gap-1.5">
<span class="text-xs font-medium uppercase tracking-wide text-(--fg-subtle)">URL</span>
<span class="demo-label">URL</span>
<input
v-model="payload.url"
type="url"
class="w-full rounded-lg border border-(--border) bg-(--bg) px-3 py-2 text-sm text-(--fg) placeholder:text-(--fg-subtle) transition focus:border-(--accent) focus:outline-none focus:ring-2 focus:ring-(--ring)"
class="demo-input"
>
</label>
</div>
@@ -75,7 +75,7 @@ async function onShare() {
<button
type="button"
:disabled="!isSupported"
class="inline-flex items-center justify-center gap-1.5 rounded-lg border border-transparent bg-(--accent) px-3 py-1.5 text-sm font-medium text-(--accent-fg) transition hover:bg-(--accent-hover) active:scale-[0.98] cursor-pointer disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100"
class="demo-btn-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:active:scale-100"
@click="onShare"
>
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
@@ -88,7 +88,7 @@ async function onShare() {
Share
</button>
<p v-if="!isSupported" class="text-xs leading-relaxed text-(--fg-subtle)">
<p v-if="!isSupported" class="text-xs leading-relaxed text-fg-subtle">
The Web Share API is not available in this browser. It works on most mobile
browsers and Safari.
</p>
@@ -97,7 +97,7 @@ async function onShare() {
class="text-xs font-medium"
:class="lastResult === 'shared'
? 'text-emerald-600 dark:text-emerald-400'
: 'text-(--fg-muted)'"
: 'text-fg-muted'"
>
{{ lastResult === 'shared' ? 'Content shared.' : 'Share sheet dismissed.' }}
</p>