import type { JSX, ValidComponent } from "@solidjs/web"; import { dynamic } from "@solidjs/web"; import { omit } from "solid-js"; import { composeRefs, userRef } from "../../internals/compose-refs"; import { mergeRootProps } from "../../internals/merge-root-props"; import { resolveClassStyle } from "../../internals/resolve-class-style"; import type { BaseUIComponentProps } from "../../internals/types"; export type ComboboxIconState = Record; export interface ComboboxIconProps extends BaseUIComponentProps<"span", ComboboxIconState> { /** * Tag/component to render. Defaults to `"span"`. Replaces the * pre-spike `render` prop (axis G). */ as?: ValidComponent; } const EMPTY_STATE: ComboboxIconState = {}; /** * A presentational icon indicating that the trigger button opens the popup. * Renders a `` element. */ export function ComboboxIcon(props: ComboboxIconProps): JSX.Element { const internal = { "aria-hidden": true, children: "▼" as JSX.Element, }; const userClassStyle = resolveClassStyle(props, () => EMPTY_STATE); const userProps = omit(props, "as", "class", "style", "attrs"); let merged: Record = mergeRootProps( internal, userClassStyle, ); merged = mergeRootProps(merged, userProps); const Tag = dynamic(() => props.as ?? "span"); return ; }