Bumps all 47 packages, the root manifest and the VS Code extension to 0.8.6, and rebuilds the editor compiler, language server and extension bundles that embed the version. The release carries the output delivery fix: camelCase outputs now reach parent bindings, and 18 components emit through output.* instead of hand-built CustomEvents. See the 0.8.6 migration entry for what changes for consumers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
86 lines
3.4 KiB
Plaintext
86 lines
3.4 KiB
Plaintext
component SearchBox {
|
|
outputs {
|
|
search(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
clear(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
}
|
|
|
|
props {
|
|
size: string = "default"
|
|
color: string = "primary"
|
|
label: string = "Search Box"
|
|
name: string = ""
|
|
value: string = ""
|
|
placeholder: string = ""
|
|
type: string = "search"
|
|
min: string = ""
|
|
max: string = ""
|
|
step: string = ""
|
|
disabled: boolean = false
|
|
required: boolean = false
|
|
class: string = ""
|
|
}
|
|
|
|
state query = value
|
|
|
|
view {
|
|
<form
|
|
data-ui-component="SearchBox"
|
|
role="search"
|
|
class='w-full {class}'
|
|
@submit='event.preventDefault(); output.search({ value: query, name: name })'
|
|
>
|
|
<label
|
|
class="mb-2 block text-sm font-semibold text-[var(--wire-color-text)]"
|
|
class:sr-only='label === ""'
|
|
>
|
|
{label}
|
|
</label>
|
|
|
|
<div class="relative flex items-center">
|
|
<span
|
|
class="icon-[lucide--search] pointer-events-none absolute left-4 size-5 text-[var(--wire-color-input-placeholder)]"
|
|
aria-hidden="true"
|
|
></span>
|
|
|
|
<input
|
|
name='{name}'
|
|
type='{type}'
|
|
value='{query}'
|
|
placeholder='{placeholder}'
|
|
min='{min}'
|
|
max='{max}'
|
|
step='{step}'
|
|
disabled='{disabled}'
|
|
required='{required}'
|
|
autocomplete="off"
|
|
class="w-full rounded-xl border border-[var(--wire-color-input-border)] bg-[var(--wire-color-input-background)] pl-12 pr-24 text-[var(--wire-color-input-text)] outline-none transition placeholder:text-[var(--wire-color-input-placeholder)] hover:border-[var(--wire-color-input-border-hover)] focus:border-[var(--wire-color-input-border-focus)] focus:ring-2 focus:ring-[var(--wire-color-focus)] disabled:cursor-not-allowed disabled:opacity-60"
|
|
class:h-10='size === "sm"'
|
|
class:h-12='size === "default" || size === "md"'
|
|
class:h-14='size === "lg"'
|
|
@input='query = event.target.value'
|
|
@change='query = event.target.value'
|
|
/>
|
|
|
|
<button
|
|
type="button"
|
|
aria-label="Clear search"
|
|
data-show='query.length > 0 && !disabled'
|
|
class="absolute right-12 inline-flex size-8 items-center justify-center rounded-lg text-[var(--wire-color-text-muted)] transition hover:bg-[var(--wire-color-surface-soft)] hover:text-[var(--wire-color-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--wire-color-focus)]"
|
|
@click='query = ""; event.currentTarget.parentElement.querySelector("input")?.focus(); output.clear({ value: "", name: name })'
|
|
>
|
|
<span class="icon-[lucide--x] size-4" aria-hidden="true"></span>
|
|
</button>
|
|
|
|
<button
|
|
type="submit"
|
|
aria-label='{label || "Search"}'
|
|
disabled='{disabled}'
|
|
class="absolute right-2 inline-flex size-9 items-center justify-center rounded-lg bg-[var(--wire-color-primary)] text-[var(--wire-color-on-primary)] transition hover:bg-[var(--wire-color-primary-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--wire-color-focus)] disabled:cursor-not-allowed disabled:opacity-60"
|
|
>
|
|
<span class="icon-[lucide--arrow-right] size-4" aria-hidden="true"></span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
}
|
|
}
|