@proyecto-viviana/solidaria-components 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker2.js.map +1 -1
- package/dist/DatePicker2.jsx.map +1 -1
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +2 -6
- package/dist/Form.js.map +1 -1
- package/dist/Form.jsx +2 -4
- package/dist/Form.jsx.map +1 -1
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +51 -51
- package/dist/ListBox.jsx.map +1 -1
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx.map +1 -1
- package/package.json +5 -3
- package/src/DateField.tsx +5 -7
- package/src/DatePicker.tsx +25 -25
- package/src/Form.tsx +18 -1
- package/src/ListBox.tsx +123 -124
- package/src/SearchField.tsx +1 -3
- package/src/SharedElementTransition.tsx +64 -67
- package/src/TimeField.tsx +3 -10
package/dist/ListBox.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.jsx","names":["mergeProps"],"sources":["../src/ListBox.tsx"],"sourcesContent":["/**\n * ListBox component for solidaria-components\n *\n * A pre-wired headless listbox that combines state + aria hooks.\n * Port of react-aria-components/src/ListBox.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n on,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createListBox,\n createOption,\n createFocusRing,\n createScrollIntoViewOnFocus,\n createStringFormatter,\n createDragSession,\n getGlobalDraggingCollectionRef,\n getGlobalDraggingKeys,\n registerDropItem,\n dndIntlStrings,\n mergeProps,\n moveVirtualFocus,\n useLocale,\n FOCUS_EVENT,\n CLEAR_FOCUS_EVENT,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n createFilteredListState,\n type ListState,\n type ListFilterFn,\n type Key,\n type DropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport { useAutocompleteCollection } from \"./Autocomplete\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n DropIndicatorContext,\n type DropIndicatorProps,\n} from \"./DragAndDrop\";\nimport type { ItemDropTarget } from \"@proyecto-viviana/solid-stately\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n isCollectionSection,\n flattenCollectionEntries,\n} from \"./Collection\";\n\nexport interface ListBoxRenderProps {\n /** Whether the listbox has focus. */\n isFocused: boolean;\n /** Whether the listbox has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the listbox is disabled. */\n isDisabled: boolean;\n /** Whether the listbox is empty. */\n isEmpty: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps, \"children\">, SlotProps {\n /** The items to render in the listbox. */\n items: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior (toggle vs replace). */\n selectionBehavior?: \"toggle\" | \"replace\";\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** The children of the component. A function may be provided to render each item. */\n children: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxRenderProps>;\n /** A function to render when the listbox is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more items to load. */\n hasMore?: boolean;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Ref for the listbox element. */\n ref?: RefLike<HTMLDivElement>;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n /** Layout hint for styling parity. */\n layout?: \"stack\" | \"grid\";\n /** Orientation hint for styling parity. */\n orientation?: \"vertical\" | \"horizontal\";\n /** Slot definitions provided through ListBoxContext. */\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport interface ListBoxOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ListBoxOptionProps<T>\n extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<ListBoxOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n /** Ref for the option element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ListBoxLoadMoreItemProps extends SlotProps {\n /** Called when the sentinel becomes visible. */\n onLoadMore: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n /** Content for the load more row. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** The inline style for the element. */\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\nexport interface ListBoxSectionProps extends SectionProps {}\n\ninterface ListBoxContextValue<T> {\n state: ListState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<unknown>;\n dragState?: unknown;\n dropState?: unknown;\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport const ListBoxContext = createContext<ListBoxContextValue<unknown> | null>(null);\nexport const ListBoxStateContext = createContext<ListState<unknown> | null>(null);\nexport const ListStateContext = ListBoxStateContext;\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport function ListBox<T>(props: ListBoxProps<T>): JSX.Element {\n const parentContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"];\n const mergedListBoxProps = contextSlotProps\n ? (mergeProps(contextSlotProps, props) as ListBoxProps<T>)\n : props;\n const [local, stateProps, ariaProps] = splitProps(\n mergedListBoxProps,\n [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"onLoadMore\",\n \"dragAndDropHooks\",\n \"slots\",\n \"ref\",\n ],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"layout\",\n \"orientation\",\n ],\n );\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items);\n });\n\n const hasSections = createMemo(() => stateProps.items.some((item) => isCollectionSection(item)));\n\n const baseState = createListState<T>({\n get items() {\n return flatItems();\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disabledBehavior() {\n return stateProps.disabledBehavior;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n });\n\n // When this ListBox is the collection of an Autocomplete, the input and the\n // collection are separate components bridged by context. The collection's\n // state is filtered by the input's predicate (mirrors RAC's\n // UNSTABLE_useFilteredListState), and virtual focus is driven across the\n // component boundary by synthetic DOM events (see the bridge effects below).\n // ComboBox/Picker never provide this context, so their createListBox path is\n // untouched.\n const autocompleteCtx = useAutocompleteCollection();\n const state = autocompleteCtx\n ? createFilteredListState<T>(\n baseState,\n () => autocompleteCtx.filter as ListFilterFn<T> | undefined,\n )\n : baseState;\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const locale = useLocale();\n // A parent Virtualizer publishes `isVirtualized` through the collection\n // renderer context; the base ListBox forwards it into createListBox so each\n // option emits aria-posinset/aria-setsize for the windowed (incomplete) DOM.\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const listBoxAria = createListBox(\n {\n ...ariaProps,\n get isVirtualized() {\n return parentCollectionRenderer?.isVirtualized ?? ariaProps.isVirtualized;\n },\n // Under Autocomplete, the input owns the collection's id (its\n // aria-controls target), accessible name, and virtual-focus/type-ahead\n // config; prefer the bridged values over any locally-passed props.\n get id() {\n return autocompleteCtx?.collectionProps.id ?? (ariaProps as { id?: string }).id;\n },\n get \"aria-label\"() {\n return autocompleteCtx?.collectionProps[\"aria-label\"] ?? ariaProps[\"aria-label\"];\n },\n get shouldUseVirtualFocus() {\n return (\n autocompleteCtx?.collectionProps.shouldUseVirtualFocus ?? ariaProps.shouldUseVirtualFocus\n );\n },\n get disallowTypeAhead() {\n return autocompleteCtx?.collectionProps.disallowTypeAhead ?? ariaProps.disallowTypeAhead;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get orientation() {\n return stateProps.orientation ?? \"vertical\";\n },\n get direction() {\n return locale().direction;\n },\n },\n state,\n () => listRef(),\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<ListBoxRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanListBoxProps = () => {\n const { ref: _ref1, ...rest } = listBoxAria.listBoxProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref3, ...rest } = listBoxAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const [listRef, setListRef] = createSignal<HTMLElement | null>(null);\n\n // Reveal the activedescendant-focused option on keyboard navigation. The\n // listbox keeps real DOM focus on itself, so the browser won't natively scroll\n // an off-screen focused option into view the way roving tabindex would.\n createScrollIntoViewOnFocus({\n focusedKey: () => state.focusedKey(),\n isActive: () => state.isFocused(),\n ref: () => listRef(),\n });\n\n // Autocomplete bridge. createListBox reimplements navigation inline (it does\n // not route through createSelectableCollection), so the virtual-focus event\n // wiring the Autocomplete input relies on lives here, gated on the bridge\n // context. This mirrors createSelectableCollection's FOCUS_EVENT/CLEAR_FOCUS_EVENT\n // handlers and useSelectableItem's per-item moveVirtualFocus, at the component\n // layer, without touching the shared hooks (protecting ComboBox/Picker).\n if (autocompleteCtx) {\n // Forward path: the input dispatches FOCUS_EVENT/CLEAR_FOCUS_EVENT onto the\n // collection element. FOCUS_EVENT marks the collection focused (and, when the\n // user types forward, requests the first item); the actual arrow navigation\n // arrives as a re-dispatched KeyboardEvent handled by createListBox's onKeyDown.\n let shouldVirtualFocusFirst = false;\n createEffect(() => {\n const list = listRef();\n if (!list) return;\n const onFocusEvent = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n e.stopPropagation();\n state.setFocused(true);\n if (detail?.focusStrategy === \"first\") {\n shouldVirtualFocusFirst = true;\n }\n };\n const onClearFocusEvent = (e: Event) => {\n e.stopPropagation();\n state.setFocused(false);\n if ((e as CustomEvent).detail?.clearFocusKey) {\n state.setFocusedKey(null);\n }\n };\n list.addEventListener(FOCUS_EVENT, onFocusEvent);\n list.addEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);\n onCleanup(() => {\n list.removeEventListener(FOCUS_EVENT, onFocusEvent);\n list.removeEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);\n });\n });\n\n // Focus the first item once the (filtered) collection settles after the user\n // types forward. If nothing survives the filter, clear the input's active\n // descendant by moving virtual focus onto the collection itself (its focusin\n // reaches the input's clear branch). Mirrors useSelectableCollection.\n createEffect(\n on(\n () => [state.collection().getFirstKey?.() ?? null, state.collection().size] as const,\n ([firstKey, size]) => {\n if (!shouldVirtualFocusFirst) return;\n if (firstKey == null) {\n const list = listRef();\n if (list) moveVirtualFocus(list);\n if (size > 0) shouldVirtualFocusFirst = false;\n } else {\n state.setFocusedKey(firstKey);\n shouldVirtualFocusFirst = false;\n }\n },\n { defer: true },\n ),\n );\n\n // Reverse path: mirror the focused key onto the option's DOM element via a\n // synthetic, bubbling focusin (moveVirtualFocus). The input's focusin listener\n // reads target.id into its aria-activedescendant. Option ids are String(key)\n // in this path (createOption). Real DOM focus stays on the input.\n createEffect(() => {\n const key = state.focusedKey();\n const list = listRef();\n if (!list || !state.isFocused()) return;\n if (key == null) return;\n const el = list.ownerDocument.getElementById(String(key));\n if (el) moveVirtualFocus(el);\n });\n }\n\n const isEmpty = () => stateProps.items.length === 0;\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n });\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => listRef());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const el = listRef();\n if (el && typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const dir = window.getComputedStyle(el).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => listRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n // The real collection drives keyboard drop-target navigation\n // (`navigate()` walks getKeyAfter/getKeyBefore) and post-drop focus\n // restoration. Reading it here re-registers the drop target when the\n // collection changes (mirrors upstream keying its effect on the state).\n collection: state.collection(),\n selectedKeys: state.selectionManager.selectedKeys,\n setSelectedKeys: (keys) => state.selectionManager.setSelectedKeys(keys),\n setFocusedKey: (key) => state.setFocusedKey(key),\n },\n activeDropState,\n () => listRef(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n\n // ── Drop indicator (Fix B: labeled, self-focusing) ─────────────────────────\n // The port of react-aria-components' ListBoxDropIndicatorWrapper +\n // useDropIndicator. The droppable-collection state layer diverged to a minimal\n // reactive target-holder with no collection reference, so the label (which\n // needs the collection's text values) and the self-focus (which needs the live\n // drag session) are computed here in the host layer, where both are available.\n const dndFormatter = createStringFormatter(dndIntlStrings);\n const dragSession = createDragSession();\n const dropIndicatorTargetsEqual = (\n a: DropTarget | null | undefined,\n b: ItemDropTarget,\n ): boolean =>\n !!a && a.type === \"item\" && a.key === b.key && a.dropPosition === b.dropPosition;\n // Faithful port of useDropIndicator's label logic: \"Drop on X\" for an on-item\n // target, else \"Insert between X and Y\" / \"Insert before X\" / \"Insert after X\"\n // resolved from the target's neighbours in the collection.\n const dropIndicatorLabel = (target: ItemDropTarget): string => {\n const collection = state.collection();\n const getText = (key: Key | null): string => {\n if (key == null) return \"\";\n return collection.getTextValue(key) ?? collection.getItem(key)?.textValue ?? \"\";\n };\n if (target.dropPosition === \"on\") {\n return dndFormatter().format(\"dropOnItem\", { itemText: getText(target.key) });\n }\n let before: Key | null;\n let after: Key | null;\n if (target.dropPosition === \"before\") {\n const prevKey = collection.getKeyBefore(target.key);\n const prevNode = prevKey != null ? collection.getItem(prevKey) : null;\n before = prevNode?.type === \"item\" ? prevNode.key : null;\n } else {\n before = target.key;\n }\n if (target.dropPosition === \"after\") {\n const nextKey = collection.getKeyAfter(target.key);\n const nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n after = nextNode?.type === \"item\" ? nextNode.key : null;\n } else {\n after = target.key;\n }\n if (before != null && after != null) {\n return dndFormatter().format(\"insertBetween\", {\n beforeItemText: getText(before),\n afterItemText: getText(after),\n });\n }\n if (before != null) {\n return dndFormatter().format(\"insertAfter\", { itemText: getText(before) });\n }\n if (after != null) {\n return dndFormatter().format(\"insertBefore\", { itemText: getText(after) });\n }\n return \"\";\n };\n // Wrap the raw Set<string> the DragManager hands drop items into the DragTypes\n // delegate the port state expects (mirrors createDroppableCollection.wrapTypes).\n const wrapDropTypes = (types: Set<string>) => ({\n has: (type: string | string[]) => {\n if (typeof type === \"string\") return types.has(type);\n if (Array.isArray(type)) return type.some((t) => typeof t === \"string\" && types.has(t));\n return false;\n },\n });\n const ListBoxDropIndicator = (props: { target: ItemDropTarget }): JSX.Element => {\n const [indicatorRef, setIndicatorRef] = createSignal<HTMLDivElement | null>(null);\n const isDropTarget = createMemo(() =>\n dropIndicatorTargetsEqual(dropState()?.target, props.target),\n );\n // aria-hidden mirrors useDropIndicator: outside a drag session, or on a\n // non-active target, the indicator is hidden from AT ('true'); the active\n // target during a session is exposed (undefined). isHidden then tells us\n // whether to omit the element entirely (RAC returns null when hidden).\n const ariaHidden = createMemo(() =>\n !dragSession() ? \"true\" : isDropTarget() ? undefined : \"true\",\n );\n const isHidden = createMemo(() => !isDropTarget() && !!ariaHidden());\n // Faithful port of useDroppableItem. Registration (of the indicator element as\n // a DragManager droppable item) and the self-focus must happen in one effect,\n // registration first: the DragManager's onFocus keys off the dropItems map, so\n // if the element self-focused before it was registered, onFocus would treat it\n // as an unknown target and redirect focus back to the collection (a pickup\n // bounce). React's two useDroppableItem effects run in guaranteed order after\n // the ref is attached; Solid's independent effects race, so we fuse them. The\n // dropItems map keys off live elements — the ref nulls itself on Show cleanup\n // (below), so a hidden indicator unregisters instead of lingering as a stale\n // detached entry.\n createEffect(() => {\n const el = indicatorRef();\n if (!el) return;\n const unregister = registerDropItem({\n element: el,\n target: props.target,\n getDropOperation: (types, allowedOperations) => {\n const st = dropState();\n if (!st) return \"cancel\";\n // Thread the same drag identity the collection uses (see\n // createDroppableCollection.isInternalDropOperation): an internal\n // keyboard reorder must report `isInternal` so the state's feature\n // detection keeps before/after indicators valid (and rejects \"on\" for a\n // reorder-only host). Without it every indicator would return \"cancel\"\n // and drop out of the DragManager's ariaHideOutside keep-set.\n const isInternal = getGlobalDraggingCollectionRef() === listRef();\n return st.getDropOperation(\n props.target,\n wrapDropTypes(types) as Parameters<typeof st.getDropOperation>[1],\n allowedOperations,\n isInternal,\n getGlobalDraggingKeys(),\n );\n },\n });\n onCleanup(unregister);\n // While a drag session is active, the current drop target moves real DOM\n // focus onto itself, so keyboard drop navigation lands on the labeled\n // insertion point rather than the collection element. The self-focus is\n // deferred to an animation frame to mirror upstream's timing: in\n // useDroppableItem the focus is a *passive* useEffect, so it commits only\n // after the browser's microtask checkpoint. That ordering matters because\n // the DragManager keeps the active drop indicator visible via\n // ariaHideOutside, whose keep-set is `[dragSource, ...registered drop\n // items]` (the collection is dropped from the set once it owns items). A\n // freshly-mounted indicator is momentarily `inert` — it only leaves the\n // keep-set's blind spot once the DragManager's MutationObserver re-runs\n // updateValidDropTargets on a later microtask. Focusing synchronously (or\n // on a microtask) would call .focus() while the element is still inert and\n // silently no-op; the animation frame runs after that refresh, exactly as\n // React's passive effect does.\n if (dragSession() && isDropTarget()) {\n requestAnimationFrame(() => {\n if (dragSession() && isDropTarget() && indicatorRef() === el) {\n el.focus();\n }\n });\n }\n });\n return (\n <Show when={!isHidden()}>\n <div\n ref={(el) => {\n setIndicatorRef(el);\n onCleanup(() => setIndicatorRef(null));\n }}\n role=\"option\"\n class=\"solidaria-DropIndicator\"\n aria-roledescription={dndFormatter().format(\"dropIndicator\")}\n aria-label={dropIndicatorLabel(props.target)}\n aria-hidden={ariaHidden()}\n tabindex={-1}\n data-drop-target={isDropTarget() || undefined}\n />\n </Show>\n );\n };\n const dropIndicatorContextValue = {\n render: (p: DropIndicatorProps) => <ListBoxDropIndicator target={p.target} />,\n };\n\n const virtualizer = useVirtualizerContext();\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n local.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const baseRange = virtualizer.getVisibleRange(stateProps.items.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const focusedKey = state.focusedKey();\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n stateProps.items.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n const getItemNodes = () =>\n Array.from(state.collection()).filter((node) => node.type === \"item\");\n virtualizer.setDropTargetItemCountResolver(() => getItemNodes().length);\n virtualizer.setDropTargetIndexResolver((key) => {\n const index = getItemNodes().findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = getItemNodes()[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n if (!range) return stateProps.items;\n return stateProps.items.slice(range.start, range.end);\n });\n // Spacers reserve the windowed-out extent along the virtualizer's primary axis,\n // so a horizontal layout offsets along width rather than height.\n const virtualSpacerStyle = (size: number): JSX.CSSProperties =>\n virtualizer?.orientation === \"horizontal\" ? { width: `${size}px` } : { height: `${size}px` };\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return stateProps.items.map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => local.children(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <ListBoxContext.Provider\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: local.dragAndDropHooks as DragAndDropHooks<unknown> | undefined,\n dragState: dragState(),\n dropState: dropState(),\n slots: local.slots,\n } as ListBoxContextValue<unknown>\n }\n >\n <ListBoxStateContext.Provider value={state}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <DropIndicatorContext.Provider value={dropIndicatorContextValue}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n <div\n {...mergeProps(\n domProps(),\n cleanListBoxProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ??\n {},\n )}\n ref={(el) => {\n setListRef(el);\n assignRef(local.ref, el);\n autocompleteCtx?.collectionRef(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-empty={isEmpty() || undefined}\n data-layout={stateProps.layout}\n data-orientation={stateProps.orientation}\n data-drop-target={isRootDropTarget() || undefined}\n slot={local.slot}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </div>\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <div role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-ListBox-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-ListBox-sectionHeader\">\n {entry.section.title}\n </Header>\n )}\n <Group class=\"solidaria-ListBox-sectionGroup\">\n <div role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) => (\n <>\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"before\",\n )}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"on\",\n )}\n {local.children(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"after\",\n )}\n </>\n )}\n </For>\n </div>\n </Group>\n </Section>\n </div>\n ) : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"before\")}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"on\")}\n {local.children(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"after\")}\n </>\n )\n }\n </For>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={virtualSpacerStyle(virtualRange()!.offsetTop)}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {local.children(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={virtualSpacerStyle(virtualRange()!.offsetBottom)}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <ListBoxLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />\n )}\n </div>\n </>\n </DropIndicatorContext.Provider>\n </CollectionRendererContext.Provider>\n </ListBoxStateContext.Provider>\n </ListBoxContext.Provider>\n );\n}\n\n/**\n * An option in a listbox.\n */\nexport function ListBoxOption<T>(props: ListBoxOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"ref\",\n ]);\n\n const context = useContext(ListBoxStateContext);\n if (!context) {\n throw new Error(\"ListBoxOption must be used within a ListBox\");\n }\n const state = context as ListState<T>;\n const listContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || listContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get shouldSelectOnPressUp() {\n return ariaProps.shouldSelectOnPressUp;\n },\n get shouldFocusOnHover() {\n return ariaProps.shouldFocusOnHover;\n },\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n state,\n ref,\n );\n\n const renderValues = createMemo<ListBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n const draggableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState)\n return undefined;\n return listContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n // Surfaces the drag-affordance description (aria-describedby) only for\n // selectable collections, mirroring upstream useDraggableItem.\n selectionMode: state.selectionManager.selectionMode,\n },\n listContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDroppableItem || !listContext.dropState)\n return undefined;\n return listContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n listContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n return rest;\n };\n const domProps = () => filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <div\n ref={(el) => {\n setRef(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n domProps(),\n cleanOptionProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={optionAria.isFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n slot={local.slot}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Load more sentinel item for listbox collections.\n */\nexport function ListBoxLoadMoreItem(props: ListBoxLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n\n const isLoading = () => !!props.isLoading || isPending();\n\n const triggerLoadMore = async () => {\n if (isLoading()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? (() => (isLoading() ? \"Loading more...\" : \"Load more\"));\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-ListBox-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <div style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <div ref={sentinelRef} style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }} />\n </div>\n <div\n role=\"option\"\n aria-disabled={true}\n tabIndex={0}\n onFocus={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading={isLoading() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/**\n * Section primitive alias for ListBox composition parity.\n */\nexport function ListBoxSection(props: ListBoxSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\nListBox.Option = ListBoxOption;\nListBox.LoadMoreItem = ListBoxLoadMoreItem;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkGA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YAAY,IAAI,EAAE;MAChC,IAAI,UAAU;AACrB;AA8GA,MAAa,iBAAiB,cAAmD,IAAI;AACrF,MAAa,sBAAsB,cAAyC,IAAI;AAChF,MAAa,mBAAmB;;;;AAKhC,SAAgB,QAAW,OAAqC;CAE9D,MAAM,mBADgB,WAAW,cACI,CAAC,EAAE,QAAQ,MAAM,QAAQ;CAI9D,MAAM,CAAC,OAAO,YAAY,aAAa,WAHZ,mBACtBA,aAAW,kBAAkB,KAAK,IACnC,OAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,YAAY,iBAAsB;EACtC,OAAO,yBAAyB,WAAW,KAAK;CAClD,CAAC;CAED,MAAM,cAAc,iBAAiB,WAAW,MAAM,MAAM,SAAS,oBAAoB,IAAI,CAAC,CAAC;CAE/F,MAAM,YAAY,gBAAmB;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AACtB;AAEA,QAAQ,SAAS;AACjB,QAAQ,eAAe"}
|
|
1
|
+
{"version":3,"file":"ListBox.jsx","names":["mergeProps"],"sources":["../src/ListBox.tsx"],"sourcesContent":["/**\n * ListBox component for solidaria-components\n *\n * A pre-wired headless listbox that combines state + aria hooks.\n * Port of react-aria-components/src/ListBox.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n on,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createListBox,\n createOption,\n createFocusRing,\n createScrollIntoViewOnFocus,\n createStringFormatter,\n createDragSession,\n getGlobalDraggingCollectionRef,\n getGlobalDraggingKeys,\n registerDropItem,\n dndIntlStrings,\n mergeProps,\n moveVirtualFocus,\n useLocale,\n FOCUS_EVENT,\n CLEAR_FOCUS_EVENT,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n createFilteredListState,\n type ListState,\n type ListFilterFn,\n type Key,\n type DropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport { useAutocompleteCollection } from \"./Autocomplete\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n DropIndicatorContext,\n type DropIndicatorProps,\n} from \"./DragAndDrop\";\nimport type { ItemDropTarget } from \"@proyecto-viviana/solid-stately\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n isCollectionSection,\n flattenCollectionEntries,\n} from \"./Collection\";\n\nexport interface ListBoxRenderProps {\n /** Whether the listbox has focus. */\n isFocused: boolean;\n /** Whether the listbox has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the listbox is disabled. */\n isDisabled: boolean;\n /** Whether the listbox is empty. */\n isEmpty: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps, \"children\">, SlotProps {\n /** The items to render in the listbox. */\n items: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior (toggle vs replace). */\n selectionBehavior?: \"toggle\" | \"replace\";\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** The children of the component. A function may be provided to render each item. */\n children: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxRenderProps>;\n /** A function to render when the listbox is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more items to load. */\n hasMore?: boolean;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Ref for the listbox element. */\n ref?: RefLike<HTMLDivElement>;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n /** Layout hint for styling parity. */\n layout?: \"stack\" | \"grid\";\n /** Orientation hint for styling parity. */\n orientation?: \"vertical\" | \"horizontal\";\n /** Slot definitions provided through ListBoxContext. */\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport interface ListBoxOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ListBoxOptionProps<T>\n extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<ListBoxOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n /** Ref for the option element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ListBoxLoadMoreItemProps extends SlotProps {\n /** Called when the sentinel becomes visible. */\n onLoadMore: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n /** Content for the load more row. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** The inline style for the element. */\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\nexport interface ListBoxSectionProps extends SectionProps {}\n\ninterface ListBoxContextValue<T> {\n state: ListState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<unknown>;\n dragState?: unknown;\n dropState?: unknown;\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport const ListBoxContext = createContext<ListBoxContextValue<unknown> | null>(null);\nexport const ListBoxStateContext = createContext<ListState<unknown> | null>(null);\nexport const ListStateContext = ListBoxStateContext;\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport function ListBox<T>(props: ListBoxProps<T>): JSX.Element {\n const parentContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"];\n const mergedListBoxProps = contextSlotProps\n ? (mergeProps(contextSlotProps, props) as ListBoxProps<T>)\n : props;\n const [local, stateProps, ariaProps] = splitProps(\n mergedListBoxProps,\n [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"onLoadMore\",\n \"dragAndDropHooks\",\n \"slots\",\n \"ref\",\n ],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"layout\",\n \"orientation\",\n ],\n );\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items);\n });\n\n const hasSections = createMemo(() => stateProps.items.some((item) => isCollectionSection(item)));\n\n const baseState = createListState<T>({\n get items() {\n return flatItems();\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disabledBehavior() {\n return stateProps.disabledBehavior;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n });\n\n // When this ListBox is the collection of an Autocomplete, the input and the\n // collection are separate components bridged by context. The collection's\n // state is filtered by the input's predicate (mirrors RAC's\n // UNSTABLE_useFilteredListState), and virtual focus is driven across the\n // component boundary by synthetic DOM events (see the bridge effects below).\n // ComboBox/Picker never provide this context, so their createListBox path is\n // untouched.\n const autocompleteCtx = useAutocompleteCollection();\n const state = autocompleteCtx\n ? createFilteredListState<T>(\n baseState,\n () => autocompleteCtx.filter as ListFilterFn<T> | undefined,\n )\n : baseState;\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const locale = useLocale();\n // A parent Virtualizer publishes `isVirtualized` through the collection\n // renderer context; the base ListBox forwards it into createListBox so each\n // option emits aria-posinset/aria-setsize for the windowed (incomplete) DOM.\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const listBoxAria = createListBox(\n {\n ...ariaProps,\n get isVirtualized() {\n return parentCollectionRenderer?.isVirtualized ?? ariaProps.isVirtualized;\n },\n // Under Autocomplete, the input owns the collection's id (its\n // aria-controls target), accessible name, and virtual-focus/type-ahead\n // config; prefer the bridged values over any locally-passed props.\n get id() {\n return autocompleteCtx?.collectionProps.id ?? (ariaProps as { id?: string }).id;\n },\n get \"aria-label\"() {\n return autocompleteCtx?.collectionProps[\"aria-label\"] ?? ariaProps[\"aria-label\"];\n },\n get shouldUseVirtualFocus() {\n return (\n autocompleteCtx?.collectionProps.shouldUseVirtualFocus ?? ariaProps.shouldUseVirtualFocus\n );\n },\n get disallowTypeAhead() {\n return autocompleteCtx?.collectionProps.disallowTypeAhead ?? ariaProps.disallowTypeAhead;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get orientation() {\n return stateProps.orientation ?? \"vertical\";\n },\n get direction() {\n return locale().direction;\n },\n },\n state,\n () => listRef(),\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<ListBoxRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanListBoxProps = () => {\n const { ref: _ref1, ...rest } = listBoxAria.listBoxProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref3, ...rest } = listBoxAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const [listRef, setListRef] = createSignal<HTMLElement | null>(null);\n\n // Reveal the activedescendant-focused option on keyboard navigation. The\n // listbox keeps real DOM focus on itself, so the browser won't natively scroll\n // an off-screen focused option into view the way roving tabindex would.\n createScrollIntoViewOnFocus({\n focusedKey: () => state.focusedKey(),\n isActive: () => state.isFocused(),\n ref: () => listRef(),\n });\n\n // Autocomplete bridge. createListBox reimplements navigation inline (it does\n // not route through createSelectableCollection), so the virtual-focus event\n // wiring the Autocomplete input relies on lives here, gated on the bridge\n // context. This mirrors createSelectableCollection's FOCUS_EVENT/CLEAR_FOCUS_EVENT\n // handlers and useSelectableItem's per-item moveVirtualFocus, at the component\n // layer, without touching the shared hooks (protecting ComboBox/Picker).\n if (autocompleteCtx) {\n // Forward path: the input dispatches FOCUS_EVENT/CLEAR_FOCUS_EVENT onto the\n // collection element. FOCUS_EVENT marks the collection focused (and, when the\n // user types forward, requests the first item); the actual arrow navigation\n // arrives as a re-dispatched KeyboardEvent handled by createListBox's onKeyDown.\n let shouldVirtualFocusFirst = false;\n createEffect(() => {\n const list = listRef();\n if (!list) return;\n const onFocusEvent = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n e.stopPropagation();\n state.setFocused(true);\n if (detail?.focusStrategy === \"first\") {\n shouldVirtualFocusFirst = true;\n }\n };\n const onClearFocusEvent = (e: Event) => {\n e.stopPropagation();\n state.setFocused(false);\n if ((e as CustomEvent).detail?.clearFocusKey) {\n state.setFocusedKey(null);\n }\n };\n list.addEventListener(FOCUS_EVENT, onFocusEvent);\n list.addEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);\n onCleanup(() => {\n list.removeEventListener(FOCUS_EVENT, onFocusEvent);\n list.removeEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);\n });\n });\n\n // Focus the first item once the (filtered) collection settles after the user\n // types forward. If nothing survives the filter, clear the input's active\n // descendant by moving virtual focus onto the collection itself (its focusin\n // reaches the input's clear branch). Mirrors useSelectableCollection.\n createEffect(\n on(\n () => [state.collection().getFirstKey?.() ?? null, state.collection().size] as const,\n ([firstKey, size]) => {\n if (!shouldVirtualFocusFirst) return;\n if (firstKey == null) {\n const list = listRef();\n if (list) moveVirtualFocus(list);\n if (size > 0) shouldVirtualFocusFirst = false;\n } else {\n state.setFocusedKey(firstKey);\n shouldVirtualFocusFirst = false;\n }\n },\n { defer: true },\n ),\n );\n\n // Reverse path: mirror the focused key onto the option's DOM element via a\n // synthetic, bubbling focusin (moveVirtualFocus). The input's focusin listener\n // reads target.id into its aria-activedescendant. Option ids are String(key)\n // in this path (createOption). Real DOM focus stays on the input.\n createEffect(() => {\n const key = state.focusedKey();\n const list = listRef();\n if (!list || !state.isFocused()) return;\n if (key == null) return;\n const el = list.ownerDocument.getElementById(String(key));\n if (el) moveVirtualFocus(el);\n });\n }\n\n const isEmpty = () => stateProps.items.length === 0;\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n });\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => listRef());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const el = listRef();\n if (el && typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const dir = window.getComputedStyle(el).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => listRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n // The real collection drives keyboard drop-target navigation\n // (`navigate()` walks getKeyAfter/getKeyBefore) and post-drop focus\n // restoration. Reading it here re-registers the drop target when the\n // collection changes (mirrors upstream keying its effect on the state).\n collection: state.collection(),\n selectedKeys: state.selectionManager.selectedKeys,\n setSelectedKeys: (keys) => state.selectionManager.setSelectedKeys(keys),\n setFocusedKey: (key) => state.setFocusedKey(key),\n },\n activeDropState,\n () => listRef(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n\n // ── Drop indicator (Fix B: labeled, self-focusing) ─────────────────────────\n // The port of react-aria-components' ListBoxDropIndicatorWrapper +\n // useDropIndicator. The droppable-collection state layer diverged to a minimal\n // reactive target-holder with no collection reference, so the label (which\n // needs the collection's text values) and the self-focus (which needs the live\n // drag session) are computed here in the host layer, where both are available.\n const dndFormatter = createStringFormatter(dndIntlStrings);\n const dragSession = createDragSession();\n const dropIndicatorTargetsEqual = (\n a: DropTarget | null | undefined,\n b: ItemDropTarget,\n ): boolean => !!a && a.type === \"item\" && a.key === b.key && a.dropPosition === b.dropPosition;\n // Faithful port of useDropIndicator's label logic: \"Drop on X\" for an on-item\n // target, else \"Insert between X and Y\" / \"Insert before X\" / \"Insert after X\"\n // resolved from the target's neighbours in the collection.\n const dropIndicatorLabel = (target: ItemDropTarget): string => {\n const collection = state.collection();\n const getText = (key: Key | null): string => {\n if (key == null) return \"\";\n return collection.getTextValue(key) ?? collection.getItem(key)?.textValue ?? \"\";\n };\n if (target.dropPosition === \"on\") {\n return dndFormatter().format(\"dropOnItem\", { itemText: getText(target.key) });\n }\n let before: Key | null;\n let after: Key | null;\n if (target.dropPosition === \"before\") {\n const prevKey = collection.getKeyBefore(target.key);\n const prevNode = prevKey != null ? collection.getItem(prevKey) : null;\n before = prevNode?.type === \"item\" ? prevNode.key : null;\n } else {\n before = target.key;\n }\n if (target.dropPosition === \"after\") {\n const nextKey = collection.getKeyAfter(target.key);\n const nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n after = nextNode?.type === \"item\" ? nextNode.key : null;\n } else {\n after = target.key;\n }\n if (before != null && after != null) {\n return dndFormatter().format(\"insertBetween\", {\n beforeItemText: getText(before),\n afterItemText: getText(after),\n });\n }\n if (before != null) {\n return dndFormatter().format(\"insertAfter\", { itemText: getText(before) });\n }\n if (after != null) {\n return dndFormatter().format(\"insertBefore\", { itemText: getText(after) });\n }\n return \"\";\n };\n // Wrap the raw Set<string> the DragManager hands drop items into the DragTypes\n // delegate the port state expects (mirrors createDroppableCollection.wrapTypes).\n const wrapDropTypes = (types: Set<string>) => ({\n has: (type: string | string[]) => {\n if (typeof type === \"string\") return types.has(type);\n if (Array.isArray(type)) return type.some((t) => typeof t === \"string\" && types.has(t));\n return false;\n },\n });\n const ListBoxDropIndicator = (props: { target: ItemDropTarget }): JSX.Element => {\n const [indicatorRef, setIndicatorRef] = createSignal<HTMLDivElement | null>(null);\n const isDropTarget = createMemo(() =>\n dropIndicatorTargetsEqual(dropState()?.target, props.target),\n );\n // aria-hidden mirrors useDropIndicator: outside a drag session, or on a\n // non-active target, the indicator is hidden from AT ('true'); the active\n // target during a session is exposed (undefined). isHidden then tells us\n // whether to omit the element entirely (RAC returns null when hidden).\n const ariaHidden = createMemo(() =>\n !dragSession() ? \"true\" : isDropTarget() ? undefined : \"true\",\n );\n const isHidden = createMemo(() => !isDropTarget() && !!ariaHidden());\n // Faithful port of useDroppableItem. Registration (of the indicator element as\n // a DragManager droppable item) and the self-focus must happen in one effect,\n // registration first: the DragManager's onFocus keys off the dropItems map, so\n // if the element self-focused before it was registered, onFocus would treat it\n // as an unknown target and redirect focus back to the collection (a pickup\n // bounce). React's two useDroppableItem effects run in guaranteed order after\n // the ref is attached; Solid's independent effects race, so we fuse them. The\n // dropItems map keys off live elements — the ref nulls itself on Show cleanup\n // (below), so a hidden indicator unregisters instead of lingering as a stale\n // detached entry.\n createEffect(() => {\n const el = indicatorRef();\n if (!el) return;\n const unregister = registerDropItem({\n element: el,\n target: props.target,\n getDropOperation: (types, allowedOperations) => {\n const st = dropState();\n if (!st) return \"cancel\";\n // Thread the same drag identity the collection uses (see\n // createDroppableCollection.isInternalDropOperation): an internal\n // keyboard reorder must report `isInternal` so the state's feature\n // detection keeps before/after indicators valid (and rejects \"on\" for a\n // reorder-only host). Without it every indicator would return \"cancel\"\n // and drop out of the DragManager's ariaHideOutside keep-set.\n const isInternal = getGlobalDraggingCollectionRef() === listRef();\n return st.getDropOperation(\n props.target,\n wrapDropTypes(types) as Parameters<typeof st.getDropOperation>[1],\n allowedOperations,\n isInternal,\n getGlobalDraggingKeys(),\n );\n },\n });\n onCleanup(unregister);\n // While a drag session is active, the current drop target moves real DOM\n // focus onto itself, so keyboard drop navigation lands on the labeled\n // insertion point rather than the collection element. The self-focus is\n // deferred to an animation frame to mirror upstream's timing: in\n // useDroppableItem the focus is a *passive* useEffect, so it commits only\n // after the browser's microtask checkpoint. That ordering matters because\n // the DragManager keeps the active drop indicator visible via\n // ariaHideOutside, whose keep-set is `[dragSource, ...registered drop\n // items]` (the collection is dropped from the set once it owns items). A\n // freshly-mounted indicator is momentarily `inert` — it only leaves the\n // keep-set's blind spot once the DragManager's MutationObserver re-runs\n // updateValidDropTargets on a later microtask. Focusing synchronously (or\n // on a microtask) would call .focus() while the element is still inert and\n // silently no-op; the animation frame runs after that refresh, exactly as\n // React's passive effect does.\n if (dragSession() && isDropTarget()) {\n requestAnimationFrame(() => {\n if (dragSession() && isDropTarget() && indicatorRef() === el) {\n el.focus();\n }\n });\n }\n });\n return (\n <Show when={!isHidden()}>\n <div\n ref={(el) => {\n setIndicatorRef(el);\n onCleanup(() => setIndicatorRef(null));\n }}\n role=\"option\"\n class=\"solidaria-DropIndicator\"\n aria-roledescription={dndFormatter().format(\"dropIndicator\")}\n aria-label={dropIndicatorLabel(props.target)}\n aria-hidden={ariaHidden()}\n tabindex={-1}\n data-drop-target={isDropTarget() || undefined}\n />\n </Show>\n );\n };\n const dropIndicatorContextValue = {\n render: (p: DropIndicatorProps) => <ListBoxDropIndicator target={p.target} />,\n };\n\n const virtualizer = useVirtualizerContext();\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n local.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const baseRange = virtualizer.getVisibleRange(stateProps.items.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const focusedKey = state.focusedKey();\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n stateProps.items.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n const getItemNodes = () =>\n Array.from(state.collection()).filter((node) => node.type === \"item\");\n virtualizer.setDropTargetItemCountResolver(() => getItemNodes().length);\n virtualizer.setDropTargetIndexResolver((key) => {\n const index = getItemNodes().findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = getItemNodes()[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n if (!range) return stateProps.items;\n return stateProps.items.slice(range.start, range.end);\n });\n // Spacers reserve the windowed-out extent along the virtualizer's primary axis,\n // so a horizontal layout offsets along width rather than height.\n const virtualSpacerStyle = (size: number): JSX.CSSProperties =>\n virtualizer?.orientation === \"horizontal\" ? { width: `${size}px` } : { height: `${size}px` };\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return stateProps.items.map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => local.children(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <ListBoxContext.Provider\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: local.dragAndDropHooks as DragAndDropHooks<unknown> | undefined,\n dragState: dragState(),\n dropState: dropState(),\n slots: local.slots,\n } as ListBoxContextValue<unknown>\n }\n >\n <ListBoxStateContext.Provider value={state}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <DropIndicatorContext.Provider value={dropIndicatorContextValue}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n <div\n {...mergeProps(\n domProps(),\n cleanListBoxProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ??\n {},\n )}\n ref={(el) => {\n setListRef(el);\n assignRef(local.ref, el);\n autocompleteCtx?.collectionRef(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-empty={isEmpty() || undefined}\n data-layout={stateProps.layout}\n data-orientation={stateProps.orientation}\n data-drop-target={isRootDropTarget() || undefined}\n slot={local.slot}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </div>\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <div role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-ListBox-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-ListBox-sectionHeader\">\n {entry.section.title}\n </Header>\n )}\n <Group class=\"solidaria-ListBox-sectionGroup\">\n <div role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) => (\n <>\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"before\",\n )}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"on\",\n )}\n {local.children(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"after\",\n )}\n </>\n )}\n </For>\n </div>\n </Group>\n </Section>\n </div>\n ) : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"before\")}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"on\")}\n {local.children(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"after\")}\n </>\n )\n }\n </For>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={virtualSpacerStyle(virtualRange()!.offsetTop)}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {local.children(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={virtualSpacerStyle(virtualRange()!.offsetBottom)}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <ListBoxLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />\n )}\n </div>\n </>\n </DropIndicatorContext.Provider>\n </CollectionRendererContext.Provider>\n </ListBoxStateContext.Provider>\n </ListBoxContext.Provider>\n );\n}\n\n/**\n * An option in a listbox.\n */\nexport function ListBoxOption<T>(props: ListBoxOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"ref\",\n ]);\n\n const context = useContext(ListBoxStateContext);\n if (!context) {\n throw new Error(\"ListBoxOption must be used within a ListBox\");\n }\n const state = context as ListState<T>;\n const listContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || listContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get shouldSelectOnPressUp() {\n return ariaProps.shouldSelectOnPressUp;\n },\n get shouldFocusOnHover() {\n return ariaProps.shouldFocusOnHover;\n },\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n state,\n ref,\n );\n\n const renderValues = createMemo<ListBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n const draggableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState)\n return undefined;\n return listContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n // Surfaces the drag-affordance description (aria-describedby) only for\n // selectable collections, mirroring upstream useDraggableItem.\n selectionMode: state.selectionManager.selectionMode,\n },\n listContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDroppableItem || !listContext.dropState)\n return undefined;\n return listContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n listContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n return rest;\n };\n const domProps = () => filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <div\n ref={(el) => {\n setRef(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n domProps(),\n cleanOptionProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={optionAria.isFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n slot={local.slot}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Load more sentinel item for listbox collections.\n */\nexport function ListBoxLoadMoreItem(props: ListBoxLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n\n const isLoading = () => !!props.isLoading || isPending();\n\n const triggerLoadMore = async () => {\n if (isLoading()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? (() => (isLoading() ? \"Loading more...\" : \"Load more\"));\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-ListBox-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <div style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <div ref={sentinelRef} style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }} />\n </div>\n <div\n role=\"option\"\n aria-disabled={true}\n tabIndex={0}\n onFocus={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading={isLoading() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/**\n * Section primitive alias for ListBox composition parity.\n */\nexport function ListBoxSection(props: ListBoxSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\nListBox.Option = ListBoxOption;\nListBox.LoadMoreItem = ListBoxLoadMoreItem;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkGA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YAAY,IAAI,EAAE;MAChC,IAAI,UAAU;AACrB;AA8GA,MAAa,iBAAiB,cAAmD,IAAI;AACrF,MAAa,sBAAsB,cAAyC,IAAI;AAChF,MAAa,mBAAmB;;;;AAKhC,SAAgB,QAAW,OAAqC;CAE9D,MAAM,mBADgB,WAAW,cACI,CAAC,EAAE,QAAQ,MAAM,QAAQ;CAI9D,MAAM,CAAC,OAAO,YAAY,aAAa,WAHZ,mBACtBA,aAAW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,kBAAkB,yCAAsD,CAAC;AA0EtF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAuYhE;yBAvYe,WAAW;;;;;AAyY3B;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;CAC3B,GAAG,GAAG,CAAC,OAAO,CAoBd;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA4I1E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG,CAAC,OAAO,CAiFtF"}
|
package/dist/SearchField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.js","names":["JSX","Context","createContext","createMemo","onCleanup","onMount","splitProps","useContext","Show","createSearchField","createFocusRing","createHover","createPress","mergeProps","AriaSearchFieldProps","createSearchFieldState","VALID_VALIDITY_STATE","SearchFieldState","ValidationResult","FormContext","FormProps","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","Provider","TextContext","useAutocompleteInput","SearchFieldRenderProps","isEmpty","isDisabled","isInvalid","isReadOnly","isRequired","value","SearchFieldProps","Omit","defaultValue","onChange","onSubmit","onClear","label","Element","children","class","style","ref","el","HTMLDivElement","SearchFieldInputRenderProps","isFocused","isFocusVisible","isHovered","SearchFieldInputProps","InputHTMLAttributes","HTMLInputElement","SearchFieldClearButtonRenderProps","isPressed","SearchFieldClearButtonProps","ButtonHTMLAttributes","HTMLButtonElement","SearchFieldContextValue","Partial","state","inputProps","clearButtonProps","tabIndex","disabled","onMouseDown","e","MouseEvent","onClick","labelProps","HTMLAttributes","HTMLElement","descriptionProps","errorMessageProps","setInputRef","slots","Record","SearchFieldContext","withFormValidationBehavior","props","formContext","validationBehavior","Proxy","get","target","property","receiver","localValue","Reflect","undefined","has","ownKeys","keys","Set","add","Array","from","getOwnPropertyDescriptor","descriptor","enumerable","configurable","eventWithCurrentTarget","event","Event","element","T","bind","clearDelegatedTextEntryHandlers","delegatedElement","$$input","$$change","SearchField","contextProps","contextSlotProps","slot","contextBaseProps","_state","_inputProps","_clearButtonProps","_labelProps","_descriptionProps","_errorMessageProps","_isDisabled","_isInvalid","_isRequired","_isReadOnly","_setInputRef","_slots","restContextProps","baseProps","autocompleteInput","autocompleteProps","onKeyDown","onFocus","onBlur","mergedProps","local","stateProps","ariaProps","rest","inputRef","searchFieldAria","aria-label","aria-labelledby","aria-describedby","description","errorMessage","placeholder","name","form","type","autoFocus","excludeFromTabOrder","autoComplete","inputMode","enterKeyHint","autoCorrect","autoCapitalize","spellCheck","maxLength","minLength","pattern","onFocusChange","onKeyUp","onCopy","onCut","onPaste","onCompositionStart","onCompositionEnd","onCompositionUpdate","onSelect","onBeforeInput","onInput","renderValues","renderProps","defaultClassName","childRenderValues","domProps","global","fieldValidation","validationErrors","validationDetails","customError","valid","fieldErrorContext","validation","contextValue","fieldChildren","textSlots","_$createComponent","_el$","_$getNextElement","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","data-empty","data-disabled","data-invalid","data-required","data-readonly","_$insert","values","_$runHydrationEvents","SearchFieldLabel","CSSProperties","context","Error","cleanLabelProps","_ref","_el$2","_tmpl$2","SearchFieldInput","inputElement","focusProps","hoverProps","cleanInputProps","cleanFocusProps","cleanHoverProps","autocompleteInputAttrs","mergedInputProps","inputHandler","handler","EventHandler","InputEvent","currentTarget","stopPropagation","changeHandler","addEventListener","removeEventListener","_el$3","_tmpl$3","data-focused","data-focus-visible","data-hovered","SearchFieldClearButton","clear","pressProps","onPress","cleanPressProps","when","_el$4","_tmpl$4","data-pressed","renderChildren","Label","Input","ClearButton"],"sources":["../src/SearchField.tsx"],"sourcesContent":["/**\n * SearchField component for solidaria-components\n *\n * A pre-wired headless search field that combines state + aria hooks.\n * Port of react-aria-components/src/SearchField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n mergeProps,\n type AriaSearchFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSearchFieldState,\n VALID_VALIDITY_STATE,\n type SearchFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { useAutocompleteInput } from \"./Autocomplete\";\n\nexport interface SearchFieldRenderProps {\n /** Whether the search field is empty. */\n isEmpty: boolean;\n /** Whether the search field is disabled. */\n isDisabled: boolean;\n /** Whether the search field is invalid. */\n isInvalid: boolean;\n /** Whether the search field is read-only. */\n isReadOnly: boolean;\n /** Whether the search field is required. */\n isRequired: boolean;\n /** The current value. */\n value: string;\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler called when the value changes. */\n onChange?: (value: string) => void;\n /** Handler called when the user submits the search. */\n onSubmit?: (value: string) => void;\n /** Handler called when the field is cleared. */\n onClear?: () => void;\n /** A visible label for the search field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SearchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldRenderProps>;\n /** Ref for the outer search field element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SearchFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface SearchFieldInputProps\n extends SlotProps, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"class\" | \"style\"> {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldInputRenderProps>;\n}\n\nexport interface SearchFieldClearButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SearchFieldClearButtonProps\n extends\n SlotProps,\n Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. */\n children?: RenderChildren<SearchFieldClearButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldClearButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldClearButtonRenderProps>;\n}\n\ninterface SearchFieldContextValue extends Partial<SearchFieldProps> {\n state?: SearchFieldState;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n clearButtonProps?: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n labelProps?: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isDisabled?: boolean;\n isInvalid?: boolean;\n isRequired?: boolean;\n isReadOnly?: boolean;\n setInputRef?: (el: HTMLInputElement) => void;\n slots?: Record<string, SearchFieldProps>;\n}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\nfunction withFormValidationBehavior(\n props: SearchFieldProps,\n formContext: FormProps | null,\n): SearchFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport function SearchField(props: SearchFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(SearchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SearchFieldProps>(() => {\n if (!contextProps) return {};\n const {\n state: _state,\n inputProps: _inputProps,\n clearButtonProps: _clearButtonProps,\n labelProps: _labelProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n setInputRef: _setInputRef,\n slots: _slots,\n ...restContextProps\n } = contextProps;\n return restContextProps as SearchFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as SearchFieldProps;\n\n // When rendered inside an <Autocomplete>, the FieldInputContext (AutocompleteContext)\n // controls the input's value and keyboard handling: value + onChange make the field's\n // state controlled by the shared autocomplete state (which drives the collection\n // filter), and onKeyDown/onFocus/onBlur chain the autocomplete's virtual-focus\n // navigation into the input. This mirrors RAC's\n // useContextProps(props, inputRef, FieldInputContext). The remaining passthroughs\n // (aria-activedescendant/aria-controls/aria-autocomplete) and the input-ref\n // registration are applied at the <input> in SearchFieldInput.\n const autocompleteInput = useAutocompleteInput();\n const autocompleteProps = autocompleteInput\n ? ({\n get value() {\n return autocompleteInput.inputProps.value();\n },\n onChange: autocompleteInput.inputProps.onChange,\n onKeyDown: autocompleteInput.inputProps\n .onKeyDown as unknown as SearchFieldProps[\"onKeyDown\"],\n onFocus: autocompleteInput.inputProps.onFocus as unknown as SearchFieldProps[\"onFocus\"],\n onBlur: autocompleteInput.inputProps.onBlur as unknown as SearchFieldProps[\"onBlur\"],\n } as Partial<SearchFieldProps>)\n : undefined;\n\n const mergedProps = withFormValidationBehavior(\n autocompleteProps\n ? (mergeProps(baseProps, autocompleteProps) as SearchFieldProps)\n : baseProps,\n formContext,\n );\n\n const [local, stateProps, ariaProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onSubmit\", \"onClear\"],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"name\",\n \"form\",\n \"validationBehavior\",\n \"type\",\n \"placeholder\",\n \"autoComplete\",\n \"inputMode\",\n \"enterKeyHint\",\n \"autoCorrect\",\n \"autoCapitalize\",\n \"spellCheck\",\n \"maxLength\",\n \"minLength\",\n \"pattern\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onCopy\",\n \"onCut\",\n \"onPaste\",\n \"onCompositionStart\",\n \"onCompositionEnd\",\n \"onCompositionUpdate\",\n \"onSelect\",\n \"onBeforeInput\",\n \"onInput\",\n ],\n );\n\n const state = createSearchFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const searchFieldAria = createSearchField(\n {\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get placeholder() {\n return ariaProps.placeholder;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get type() {\n return ariaProps.type;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get excludeFromTabOrder() {\n return ariaProps.excludeFromTabOrder;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\n },\n get enterKeyHint() {\n return ariaProps.enterKeyHint;\n },\n get autoCorrect() {\n return ariaProps.autoCorrect;\n },\n get autoCapitalize() {\n return ariaProps.autoCapitalize;\n },\n get spellCheck() {\n return ariaProps.spellCheck;\n },\n get maxLength() {\n return ariaProps.maxLength;\n },\n get minLength() {\n return ariaProps.minLength;\n },\n get pattern() {\n return ariaProps.pattern;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCompositionStart() {\n return ariaProps.onCompositionStart;\n },\n get onCompositionEnd() {\n return ariaProps.onCompositionEnd;\n },\n get onCompositionUpdate() {\n return ariaProps.onCompositionUpdate;\n },\n get onSelect() {\n return ariaProps.onSelect;\n },\n get onBeforeInput() {\n return ariaProps.onBeforeInput;\n },\n get onInput() {\n return ariaProps.onInput;\n },\n get onSubmit() {\n return stateProps.onSubmit;\n },\n get onClear() {\n return stateProps.onClear;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SearchFieldRenderProps>(() => ({\n isEmpty: state.value() === \"\",\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: searchFieldAria.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.value(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField\",\n },\n renderValues,\n );\n const childRenderValues: SearchFieldRenderProps = {\n get isEmpty() {\n return state.value() === \"\";\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.value();\n },\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = searchFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n };\n const contextValue: SearchFieldContextValue = {\n state,\n get inputProps() {\n return searchFieldAria.inputProps;\n },\n get clearButtonProps() {\n return searchFieldAria.clearButtonProps;\n },\n get labelProps() {\n return searchFieldAria.labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' SearchField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `SearchFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessage() {\n return searchFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={state.value() === \"\" || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={searchFieldAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </SearchFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldLabel must be used within a SearchField\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-SearchField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input element for a search field.\n */\nexport function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n let inputElement: HTMLInputElement | undefined;\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldInput must be used within a SearchField\");\n }\n\n // Inside an <Autocomplete>, expose the ARIA attributes that identify the\n // controlled collection and its virtually-focused option. value/onChange and the\n // keyboard handlers are already merged upstream in SearchField(); here we only add\n // the passthrough attributes that createTextField doesn't forward, and register the\n // input element as the autocomplete inputRef so the beforeinput + reverse-path\n // (aria-activedescendant mirror) listeners bind. Mirrors RAC's\n // [InputContext, {...inputProps, ref: inputRef}].\n const autocompleteInput = useAutocompleteInput();\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<SearchFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: !!context.isDisabled,\n isInvalid: !!context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const autocompleteInputAttrs = (): Record<string, unknown> => {\n if (!autocompleteInput) {\n return {};\n }\n const inputProps = autocompleteInput.inputProps;\n return {\n \"aria-controls\": inputProps[\"aria-controls\"],\n \"aria-autocomplete\": inputProps[\"aria-autocomplete\"],\n \"aria-activedescendant\": inputProps[\"aria-activedescendant\"](),\n };\n };\n\n const mergedInputProps = () =>\n ({\n ...domProps,\n ...cleanInputProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n ...autocompleteInputAttrs(),\n }) as Record<string, unknown>;\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedInputProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedInputProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedInputProps()}\n ref={(element) => {\n inputElement = element;\n context.setInputRef?.(element);\n autocompleteInput?.inputRef(element);\n const ref = (domProps as { ref?: unknown }).ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The clear button for a search field.\n */\nexport function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldClearButton must be used within a SearchField\");\n }\n\n const isDisabled = () => !!(context.isDisabled || context.isReadOnly);\n const isEmpty = () => (context.state?.value() ?? \"\") === \"\";\n const clear = () => {\n if (!isDisabled() && !isEmpty()) {\n context.clearButtonProps?.onClick();\n }\n };\n\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onClick: clear,\n onPress: clear,\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-clear\",\n },\n renderValues,\n );\n\n const cleanPressProps = () => {\n const { ref: _ref, ...rest } = pressProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps?.[\"aria-label\"] ?? \"Clear search\"}\n tabIndex={context.clearButtonProps?.tabIndex ?? -1}\n disabled={context.clearButtonProps?.disabled}\n onMouseDown={context.clearButtonProps?.onMouseDown}\n {...cleanPressProps()}\n onPointerUp={clear}\n onMouseUp={clear}\n onClick={clear}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n </Show>\n );\n}\n\nSearchField.Label = SearchFieldLabel;\nSearchField.Input = SearchFieldInput;\nSearchField.ClearButton = SearchFieldClearButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmJA,MAAaoF,qBAAqBlF,cAA8C,IAAI;AAEpF,SAASmF,2BACPC,OACAC,aACkB;CAClB,IAAI,CAACA,aAAaC,oBAChB,OAAOF;CAGT,OAAO,IAAIG,MAAMH,OAAO;EACtBI,IAAIC,QAAQC,UAAUC,UAAU;GAC9B,MAAMC,aAAaC,QAAQL,IAAIC,QAAQC,UAAUC,QAAQ;GACzD,IAAID,aAAa,wBAAwBE,eAAeE,KAAAA,GACtD,OAAOT,YAAYC;GAGrB,OAAOM;EACT;EACAG,IAAIN,QAAQC,UAAU;GACpB,OACEG,QAAQE,IAAIN,QAAQC,QAAQ,KAC3BA,aAAa,wBAAwBL,YAAYC,uBAAuBQ,KAAAA;EAE7E;EACAE,QAAQP,QAAQ;GACd,MAAMQ,OAAO,IAAIC,IAAIL,QAAQG,QAAQP,MAA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AAK,aACPA;IAAK,WACPA;GAAK,GACVlB,iBAAe;IAAA,KAAA,WAAA;KAAA,OACZ7C,YAAYrI,MAAM;IAAC;IAAA,IAC1BC,QAAK;KAAA,OAAEoI,YAAYpI,MAAM;IAAC;IAAA,KAAA,kBAAA;KAAA,OACZY,UAAU,KAAKmC,KAAAA;IAAS;IAAA,KAAA,kBAAA;KAAA,OACxBxC,UAAU,KAAKwC,KAAAA;IAAS;IAAA,KAAA,mBAAA;KAAA,OACvB9D,WAAW,KAAK8D,KAAAA;IAAS;GAAA,CAAA,GAAA,OAAA,IAAA;GAAAiH,OAAAwC,aAEvCpE,YAAYuE,eAAe,CAAC;GAAAzC,mBAAA;GAAA,OAAAsC;EAAA;CAAA,CAAA;AAIrC;AAEAnI,YAAYuI,QAAQzC;AACpB9F,YAAYwI,QAAQlC;AACpBtG,YAAYyI,cAAcZ"}
|
|
1
|
+
{"version":3,"file":"SearchField.js","names":["JSX","Context","createContext","createMemo","onCleanup","onMount","splitProps","useContext","Show","createSearchField","createFocusRing","createHover","createPress","mergeProps","AriaSearchFieldProps","createSearchFieldState","VALID_VALIDITY_STATE","SearchFieldState","ValidationResult","FormContext","FormProps","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","Provider","TextContext","useAutocompleteInput","SearchFieldRenderProps","isEmpty","isDisabled","isInvalid","isReadOnly","isRequired","value","SearchFieldProps","Omit","defaultValue","onChange","onSubmit","onClear","label","Element","children","class","style","ref","el","HTMLDivElement","SearchFieldInputRenderProps","isFocused","isFocusVisible","isHovered","SearchFieldInputProps","InputHTMLAttributes","HTMLInputElement","SearchFieldClearButtonRenderProps","isPressed","SearchFieldClearButtonProps","ButtonHTMLAttributes","HTMLButtonElement","SearchFieldContextValue","Partial","state","inputProps","clearButtonProps","tabIndex","disabled","onMouseDown","e","MouseEvent","onClick","labelProps","HTMLAttributes","HTMLElement","descriptionProps","errorMessageProps","setInputRef","slots","Record","SearchFieldContext","withFormValidationBehavior","props","formContext","validationBehavior","Proxy","get","target","property","receiver","localValue","Reflect","undefined","has","ownKeys","keys","Set","add","Array","from","getOwnPropertyDescriptor","descriptor","enumerable","configurable","eventWithCurrentTarget","event","Event","element","T","bind","clearDelegatedTextEntryHandlers","delegatedElement","$$input","$$change","SearchField","contextProps","contextSlotProps","slot","contextBaseProps","_state","_inputProps","_clearButtonProps","_labelProps","_descriptionProps","_errorMessageProps","_isDisabled","_isInvalid","_isRequired","_isReadOnly","_setInputRef","_slots","restContextProps","baseProps","autocompleteInput","autocompleteProps","onKeyDown","onFocus","onBlur","mergedProps","local","stateProps","ariaProps","rest","inputRef","searchFieldAria","aria-label","aria-labelledby","aria-describedby","description","errorMessage","placeholder","name","form","type","autoFocus","excludeFromTabOrder","autoComplete","inputMode","enterKeyHint","autoCorrect","autoCapitalize","spellCheck","maxLength","minLength","pattern","onFocusChange","onKeyUp","onCopy","onCut","onPaste","onCompositionStart","onCompositionEnd","onCompositionUpdate","onSelect","onBeforeInput","onInput","renderValues","renderProps","defaultClassName","childRenderValues","domProps","global","fieldValidation","validationErrors","validationDetails","customError","valid","fieldErrorContext","validation","contextValue","fieldChildren","textSlots","_$createComponent","_el$","_$getNextElement","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","data-empty","data-disabled","data-invalid","data-required","data-readonly","_$insert","values","_$runHydrationEvents","SearchFieldLabel","CSSProperties","context","Error","cleanLabelProps","_ref","_el$2","_tmpl$2","SearchFieldInput","inputElement","focusProps","hoverProps","cleanInputProps","cleanFocusProps","cleanHoverProps","autocompleteInputAttrs","mergedInputProps","inputHandler","handler","EventHandler","InputEvent","currentTarget","stopPropagation","changeHandler","addEventListener","removeEventListener","_el$3","_tmpl$3","data-focused","data-focus-visible","data-hovered","SearchFieldClearButton","clear","pressProps","onPress","cleanPressProps","when","_el$4","_tmpl$4","data-pressed","renderChildren","Label","Input","ClearButton"],"sources":["../src/SearchField.tsx"],"sourcesContent":["/**\n * SearchField component for solidaria-components\n *\n * A pre-wired headless search field that combines state + aria hooks.\n * Port of react-aria-components/src/SearchField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n mergeProps,\n type AriaSearchFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSearchFieldState,\n VALID_VALIDITY_STATE,\n type SearchFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { useAutocompleteInput } from \"./Autocomplete\";\n\nexport interface SearchFieldRenderProps {\n /** Whether the search field is empty. */\n isEmpty: boolean;\n /** Whether the search field is disabled. */\n isDisabled: boolean;\n /** Whether the search field is invalid. */\n isInvalid: boolean;\n /** Whether the search field is read-only. */\n isReadOnly: boolean;\n /** Whether the search field is required. */\n isRequired: boolean;\n /** The current value. */\n value: string;\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler called when the value changes. */\n onChange?: (value: string) => void;\n /** Handler called when the user submits the search. */\n onSubmit?: (value: string) => void;\n /** Handler called when the field is cleared. */\n onClear?: () => void;\n /** A visible label for the search field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SearchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldRenderProps>;\n /** Ref for the outer search field element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SearchFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface SearchFieldInputProps\n extends SlotProps, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"class\" | \"style\"> {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldInputRenderProps>;\n}\n\nexport interface SearchFieldClearButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SearchFieldClearButtonProps\n extends\n SlotProps,\n Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. */\n children?: RenderChildren<SearchFieldClearButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldClearButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldClearButtonRenderProps>;\n}\n\ninterface SearchFieldContextValue extends Partial<SearchFieldProps> {\n state?: SearchFieldState;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n clearButtonProps?: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n labelProps?: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isDisabled?: boolean;\n isInvalid?: boolean;\n isRequired?: boolean;\n isReadOnly?: boolean;\n setInputRef?: (el: HTMLInputElement) => void;\n slots?: Record<string, SearchFieldProps>;\n}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\nfunction withFormValidationBehavior(\n props: SearchFieldProps,\n formContext: FormProps | null,\n): SearchFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport function SearchField(props: SearchFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(SearchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SearchFieldProps>(() => {\n if (!contextProps) return {};\n const {\n state: _state,\n inputProps: _inputProps,\n clearButtonProps: _clearButtonProps,\n labelProps: _labelProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n setInputRef: _setInputRef,\n slots: _slots,\n ...restContextProps\n } = contextProps;\n return restContextProps as SearchFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as SearchFieldProps;\n\n // When rendered inside an <Autocomplete>, the FieldInputContext (AutocompleteContext)\n // controls the input's value and keyboard handling: value + onChange make the field's\n // state controlled by the shared autocomplete state (which drives the collection\n // filter), and onKeyDown/onFocus/onBlur chain the autocomplete's virtual-focus\n // navigation into the input. This mirrors RAC's\n // useContextProps(props, inputRef, FieldInputContext). The remaining passthroughs\n // (aria-activedescendant/aria-controls/aria-autocomplete) and the input-ref\n // registration are applied at the <input> in SearchFieldInput.\n const autocompleteInput = useAutocompleteInput();\n const autocompleteProps = autocompleteInput\n ? ({\n get value() {\n return autocompleteInput.inputProps.value();\n },\n onChange: autocompleteInput.inputProps.onChange,\n onKeyDown: autocompleteInput.inputProps\n .onKeyDown as unknown as SearchFieldProps[\"onKeyDown\"],\n onFocus: autocompleteInput.inputProps.onFocus as unknown as SearchFieldProps[\"onFocus\"],\n onBlur: autocompleteInput.inputProps.onBlur as unknown as SearchFieldProps[\"onBlur\"],\n } as Partial<SearchFieldProps>)\n : undefined;\n\n const mergedProps = withFormValidationBehavior(\n autocompleteProps ? (mergeProps(baseProps, autocompleteProps) as SearchFieldProps) : baseProps,\n formContext,\n );\n\n const [local, stateProps, ariaProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onSubmit\", \"onClear\"],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"name\",\n \"form\",\n \"validationBehavior\",\n \"type\",\n \"placeholder\",\n \"autoComplete\",\n \"inputMode\",\n \"enterKeyHint\",\n \"autoCorrect\",\n \"autoCapitalize\",\n \"spellCheck\",\n \"maxLength\",\n \"minLength\",\n \"pattern\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onCopy\",\n \"onCut\",\n \"onPaste\",\n \"onCompositionStart\",\n \"onCompositionEnd\",\n \"onCompositionUpdate\",\n \"onSelect\",\n \"onBeforeInput\",\n \"onInput\",\n ],\n );\n\n const state = createSearchFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const searchFieldAria = createSearchField(\n {\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get placeholder() {\n return ariaProps.placeholder;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get type() {\n return ariaProps.type;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get excludeFromTabOrder() {\n return ariaProps.excludeFromTabOrder;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\n },\n get enterKeyHint() {\n return ariaProps.enterKeyHint;\n },\n get autoCorrect() {\n return ariaProps.autoCorrect;\n },\n get autoCapitalize() {\n return ariaProps.autoCapitalize;\n },\n get spellCheck() {\n return ariaProps.spellCheck;\n },\n get maxLength() {\n return ariaProps.maxLength;\n },\n get minLength() {\n return ariaProps.minLength;\n },\n get pattern() {\n return ariaProps.pattern;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCompositionStart() {\n return ariaProps.onCompositionStart;\n },\n get onCompositionEnd() {\n return ariaProps.onCompositionEnd;\n },\n get onCompositionUpdate() {\n return ariaProps.onCompositionUpdate;\n },\n get onSelect() {\n return ariaProps.onSelect;\n },\n get onBeforeInput() {\n return ariaProps.onBeforeInput;\n },\n get onInput() {\n return ariaProps.onInput;\n },\n get onSubmit() {\n return stateProps.onSubmit;\n },\n get onClear() {\n return stateProps.onClear;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SearchFieldRenderProps>(() => ({\n isEmpty: state.value() === \"\",\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: searchFieldAria.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.value(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField\",\n },\n renderValues,\n );\n const childRenderValues: SearchFieldRenderProps = {\n get isEmpty() {\n return state.value() === \"\";\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.value();\n },\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = searchFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n };\n const contextValue: SearchFieldContextValue = {\n state,\n get inputProps() {\n return searchFieldAria.inputProps;\n },\n get clearButtonProps() {\n return searchFieldAria.clearButtonProps;\n },\n get labelProps() {\n return searchFieldAria.labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' SearchField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `SearchFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessage() {\n return searchFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={state.value() === \"\" || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={searchFieldAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </SearchFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldLabel must be used within a SearchField\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-SearchField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input element for a search field.\n */\nexport function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n let inputElement: HTMLInputElement | undefined;\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldInput must be used within a SearchField\");\n }\n\n // Inside an <Autocomplete>, expose the ARIA attributes that identify the\n // controlled collection and its virtually-focused option. value/onChange and the\n // keyboard handlers are already merged upstream in SearchField(); here we only add\n // the passthrough attributes that createTextField doesn't forward, and register the\n // input element as the autocomplete inputRef so the beforeinput + reverse-path\n // (aria-activedescendant mirror) listeners bind. Mirrors RAC's\n // [InputContext, {...inputProps, ref: inputRef}].\n const autocompleteInput = useAutocompleteInput();\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<SearchFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: !!context.isDisabled,\n isInvalid: !!context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const autocompleteInputAttrs = (): Record<string, unknown> => {\n if (!autocompleteInput) {\n return {};\n }\n const inputProps = autocompleteInput.inputProps;\n return {\n \"aria-controls\": inputProps[\"aria-controls\"],\n \"aria-autocomplete\": inputProps[\"aria-autocomplete\"],\n \"aria-activedescendant\": inputProps[\"aria-activedescendant\"](),\n };\n };\n\n const mergedInputProps = () =>\n ({\n ...domProps,\n ...cleanInputProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n ...autocompleteInputAttrs(),\n }) as Record<string, unknown>;\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedInputProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedInputProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedInputProps()}\n ref={(element) => {\n inputElement = element;\n context.setInputRef?.(element);\n autocompleteInput?.inputRef(element);\n const ref = (domProps as { ref?: unknown }).ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The clear button for a search field.\n */\nexport function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldClearButton must be used within a SearchField\");\n }\n\n const isDisabled = () => !!(context.isDisabled || context.isReadOnly);\n const isEmpty = () => (context.state?.value() ?? \"\") === \"\";\n const clear = () => {\n if (!isDisabled() && !isEmpty()) {\n context.clearButtonProps?.onClick();\n }\n };\n\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onClick: clear,\n onPress: clear,\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-clear\",\n },\n renderValues,\n );\n\n const cleanPressProps = () => {\n const { ref: _ref, ...rest } = pressProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps?.[\"aria-label\"] ?? \"Clear search\"}\n tabIndex={context.clearButtonProps?.tabIndex ?? -1}\n disabled={context.clearButtonProps?.disabled}\n onMouseDown={context.clearButtonProps?.onMouseDown}\n {...cleanPressProps()}\n onPointerUp={clear}\n onMouseUp={clear}\n onClick={clear}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n </Show>\n );\n}\n\nSearchField.Label = SearchFieldLabel;\nSearchField.Input = SearchFieldInput;\nSearchField.ClearButton = SearchFieldClearButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmJA,MAAaoF,qBAAqBlF,cAA8C,IAAI;AAEpF,SAASmF,2BACPC,OACAC,aACkB;CAClB,IAAI,CAACA,aAAaC,oBAChB,OAAOF;CAGT,OAAO,IAAIG,MAAMH,OAAO;EACtBI,IAAIC,QAAQC,UAAUC,UAAU;GAC9B,MAAMC,aAAaC,QAAQL,IAAIC,QAAQC,UAAUC,QAAQ;GACzD,IAAID,aAAa,wBAAwBE,eAAeE,KAAAA,GACtD,OAAOT,YAAYC;GAGrB,OAAOM;EACT;EACAG,IAAIN,QAAQC,UAAU;GACpB,OACEG,QAAQE,IAAIN,QAAQC,QAAQ,KAC3BA,aAAa,wBAAwBL,YAAYC,uBAAuBQ,KAAAA;EAE7E;EACAE,QAAQP,QAAQ;GACd,MAAMQ,OAAO,IAAIC,IAAIL,QAAQG,QAAQP,MAAM,CAAC;GAC5C,IAAIJ,YAAYC,uBAAuBQ,KAAAA,GACrCG,K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