export type MultiselectTreeInstance = { open: () => void; close: () => void; focus: () => void; }; import type { IconProp } from '../icon'; import { type SelectCreateOptions, type SelectItem, type SelectOption } from './types'; import type { Snippet } from 'svelte'; import type { HTMLInputAttributes } from 'svelte/elements'; declare function $$render(): { props: { /** * Option list. Groups are `SelectOptionGroup` items (one level of nesting). Tree's * cascade and tri-state behavior kick in only for items that are groups; flat options at * the top level work as in a regular Multiselect. */ options: SelectItem[]; /** Current selection — array of values. Parents added via `selectionMode='children-include-parent'` show up here too. */ value: T[]; /** Trigger height preset. @default 'md' */ size?: "sm" | "md" | "lg"; /** Placeholder shown only when nothing is selected and the user is not typing. @default '' */ placeholder?: string; /** Fully disabled — no focus, no interaction, dimmed styling. @default false */ disabled?: boolean; /** Read-only — value visible, but selection cannot change. @default false */ readonly?: boolean; /** Inert subtree — non-interactive but unstyled. @default false */ inert?: boolean; /** Visual error state (accent border + aria-invalid). @default false */ error?: boolean; /** Removes the field border. @default false */ borderless?: boolean; /** When true, typing filters the tree; when false, it is a click/keyboard-only picker. @default false */ searchable?: boolean; /** * Group-header behavior: * - `'static'` — non-interactive label. * - `'value'` — clicking the header picks the group's own `value` and nothing else; the header is an ordinary * binary checkbox, independent of its children. Requires a `value` on the group, otherwise the header stays * inert. Pair with `selectionMode='children-only'` for a fully independent parent. * - `'toggle-all'` (default) — clicking the header toggles every child option at once; tri-state checkbox when `selectionMode='children-include-parent'`. * @default 'toggle-all' */ groupHeader?: "static" | "value" | "toggle-all"; /** * Cascade between group.value and children: * - `'children-only'` (default) — picking a child adds only the child; group's own `value` stays independent. * - `'children-include-parent'` — picking any child auto-adds the group's `value` to the selection; unpicking the last child removes it. Tri-state group headers light up in this mode. * * Combining `'children-include-parent'` with `groupHeader='value'` is coherent but unusual: the cascade and the independent header both write the * group's own `value`, so a child pick can re-add a parent the user just cleared from the header. Pair `groupHeader='value'` with `'children-only'`. * @default 'children-only' */ selectionMode?: "children-only" | "children-include-parent"; /** * How rows render selected state inside the listbox: * - `'checkbox'` (default) — explicit checkbox on the left of every row; group headers show tri-state when applicable. * - `'checkmark'` — ✓ on the right of selected rows. * - `'highlight'` — selected rows get the active background only. * @default 'checkbox' */ selectedDisplay?: "checkmark" | "checkbox" | "highlight"; /** Equality comparator for `T`. Required when `T` is an object. @default (a, b) => a === b */ compare?: (a: T, b: T) => boolean; /** Enables creatable mode. When at least one top-level root has a `value`, the "Create …" UI expands into a section whose parent picker offers those roots (group or flat); otherwise a plain "Create …" row is shown. `createOptions.prefix` applies only to the plain row — the create-with-parent section keeps its own localization. See {@link SelectCreateOptions}. */ createOptions?: SelectCreateOptions; /** Leading icon — string SVG source, `{ src, color?, size? }` object, or custom snippet. */ icon?: IconProp; /** Trailing chevron icon override. Same shape as `icon`. */ chevronIcon?: IconProp; /** Custom row renderer. Replaces the option's label cell — receives `{ option }`. */ optionSnippet?: Snippet<[{ option: SelectOption; }]>; /** Replaces the trigger's chip row. Pass an empty snippet to hide chips entirely, or render a count badge / any summary. */ selectionSnippet?: Snippet<[{ options: SelectOption[]; }]>; id?: string; name?: string; autocomplete?: HTMLInputAttributes["autocomplete"]; 'aria-label'?: string; 'aria-describedby'?: string; 'aria-required'?: boolean; on?: { /** Fires when the user picks/unpicks (and on group toggle-all). Emits the full new selection (array of values). */ change?: (value: T[]) => void; /** Fires when the user confirms the create-with-parent section. `query` is trimmed. `parentValue` is the chosen parent root's `value` from the parent dropdown — undefined when no parent was selected. Return a Promise to keep the spinner up. */ create?: (payload: { query: string; parentValue?: T; }) => void | Promise; }; }; exports: { open: () => void | undefined; close: () => void | undefined; focus: () => void | undefined; }; bindings: ""; slots: {}; events: {}; }; declare class __sveltets_Render { props(): ReturnType>['props']; events(): ReturnType>['events']; slots(): ReturnType>['slots']; bindings(): ""; exports(): { open: () => void | undefined; close: () => void | undefined; focus: () => void | undefined; }; } interface $$IsomorphicComponent { new (options: import('svelte').ComponentConstructorOptions['props']>>): import('svelte').SvelteComponent['props']>, ReturnType<__sveltets_Render['events']>, ReturnType<__sveltets_Render['slots']>> & { $$bindings?: ReturnType<__sveltets_Render['bindings']>; } & ReturnType<__sveltets_Render['exports']>; (internal: unknown, props: ReturnType<__sveltets_Render['props']> & {}): ReturnType<__sveltets_Render['exports']>; z_$$bindings?: ReturnType<__sveltets_Render['bindings']>; } /** * MultiselectTree — sync, grouped multi-value picker with cascade + tri-state behavior and an * optional create-with-parent section. Tree of one level: parent groups (each a * `SelectOptionGroup`) with child options; cascade-aware toggle on group headers; tri-state * checkbox visual when `selectionMode='children-include-parent'`. * * `groupHeader='value'` + `selectionMode='children-only'` turns the parent into an ordinary * independent checkbox instead: clicking it picks the group's own `value` and never touches the * children, and the header's checkbox is binary rather than tri-state. Selection is visible inside * the popover (checkbox rows) AND as chips inside the trigger by default; pass an empty * `selectionSnippet` to hide the chip row entirely, or a custom one to render a count badge * or any summary instead. * * Internally proxies to `multiselect-base` (same engine as `Multiselect` / `MultiselectAsync`) * with a synchronous `Promise.resolve` `loadOptions` shim, so the 600ms spinner gate and * race-prevention against in-flight `onCreate` handlers are inherited verbatim. * * ### CSS Custom Properties * * **Trigger:** `--sc-kit--select--trigger--{height, padding-inline, gap, background, * background--disabled, border-color, border-color--hover, border-color--error, border-radius, * underline-color, font-size, color, placeholder--color, icon--color, icon--size}`. * * **Popover panel:** `--sc-kit--select--panel--{background, border-color, border-radius, * box-shadow, font-size, max-height, padding}`. * * **Option rows:** `--sc-kit--select--option--{color, color--selected, background--active, * padding-block, padding-inline}`. * * **Group header:** `--sc-kit--select--group-header--{color, font-size}`. * * **Empty text:** `--sc-kit--select--empty--color`. * * **Create-with-parent section:** `--sc-kit--multiselect--create--{background, subtitle--background, * title--color, description--color, description--color--in, description--accent--color}`. * * **Spinner** (rendered briefly when an async `onCreate` exceeds 600ms): * `--sc-kit--spinner--{size, duration}`. */ declare const Cmp: $$IsomorphicComponent; type Cmp = InstanceType>; export default Cmp;