@aria-ui/combobox
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -33,3 +33,3 @@ import * as _aria_ui_core from '@aria-ui/core'; | ||
*/ | ||
declare function useComboboxEmpty(element: ConnectableElement): {}; | ||
declare function useComboboxEmpty(element: ConnectableElement): void; | ||
@@ -67,3 +67,3 @@ /** | ||
*/ | ||
declare function useComboboxItem(element: ConnectableElement, props?: Partial<ComboboxItemProps>): SignalState<ComboboxItemProps>; | ||
declare function useComboboxItem(element: ConnectableElement, state: SignalState<ComboboxItemProps>): void; | ||
@@ -93,3 +93,3 @@ /** | ||
*/ | ||
declare function useComboboxList(element: ConnectableElement): {}; | ||
declare function useComboboxList(element: ConnectableElement): void; | ||
@@ -119,4 +119,4 @@ /** | ||
*/ | ||
declare function useComboboxRoot(element: ConnectableElement): {}; | ||
declare function useComboboxRoot(element: ConnectableElement): void; | ||
export { ComboboxEmptyElement, type ComboboxEmptyProps, ComboboxItemElement, type ComboboxItemProps, ComboboxListElement, ComboboxRootElement, defaultComboboxEmptyProps, defaultComboboxItemProps, useComboboxEmpty, useComboboxItem, useComboboxList, useComboboxRoot }; |
// src/combobox-empty.element.gen.ts | ||
import { ElementMixin } from "@aria-ui/core"; | ||
import { ElementBuilder } from "@aria-ui/core"; | ||
@@ -12,7 +12,7 @@ // src/combobox-empty.props.ts | ||
function useComboboxEmpty(element) { | ||
return useListboxEmpty(element); | ||
useListboxEmpty(element); | ||
} | ||
// src/combobox-empty.element.gen.ts | ||
var ComboboxEmptyElement = class extends ElementMixin( | ||
var ComboboxEmptyElement = class extends ElementBuilder( | ||
useComboboxEmpty, | ||
@@ -24,3 +24,3 @@ defaultComboboxEmptyProps | ||
// src/combobox-item.element.gen.ts | ||
import { ElementMixin as ElementMixin2 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder2 } from "@aria-ui/core"; | ||
@@ -37,8 +37,8 @@ // src/combobox-item.props.ts | ||
import { useListboxItem } from "@aria-ui/listbox"; | ||
function useComboboxItem(element, props) { | ||
return useListboxItem(element, props); | ||
function useComboboxItem(element, state) { | ||
useListboxItem(element, state); | ||
} | ||
// src/combobox-item.element.gen.ts | ||
var ComboboxItemElement = class extends ElementMixin2( | ||
var ComboboxItemElement = class extends ElementBuilder2( | ||
useComboboxItem, | ||
@@ -50,3 +50,3 @@ defaultComboboxItemProps | ||
// src/combobox-list.element.gen.ts | ||
import { ElementMixin as ElementMixin3 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder3 } from "@aria-ui/core"; | ||
@@ -59,4 +59,7 @@ // src/combobox-list.props.ts | ||
// src/combobox-list.state.ts | ||
import { useEffect } from "@aria-ui/core"; | ||
import { useListbox } from "@aria-ui/listbox"; | ||
import { mapSignals, useEffect } from "@aria-ui/core"; | ||
import { | ||
defaultListboxProps, | ||
useListbox | ||
} from "@aria-ui/listbox"; | ||
@@ -77,19 +80,18 @@ // src/combobox-item.context.ts | ||
const keydownHandler = keydownHandlerContext.consume(element); | ||
const { query } = useListbox(element, { | ||
onKeydownHandlerAdd: (handler) => { | ||
keydownHandler.set(handler); | ||
return () => { | ||
keydownHandler.set(null); | ||
}; | ||
} | ||
const inputValue = inputValueContext.consume(element); | ||
const listboxState = mapSignals(defaultListboxProps); | ||
listboxState.onKeydownHandlerAdd.set((handler) => { | ||
keydownHandler.set(handler); | ||
return () => { | ||
keydownHandler.set(null); | ||
}; | ||
}); | ||
const inputValue = inputValueContext.consume(element); | ||
useListbox(element, listboxState); | ||
useEffect(element, () => { | ||
query.set(inputValue.get()); | ||
listboxState.query.set(inputValue.get()); | ||
}); | ||
return {}; | ||
} | ||
// src/combobox-list.element.gen.ts | ||
var ComboboxListElement = class extends ElementMixin3( | ||
var ComboboxListElement = class extends ElementBuilder3( | ||
useComboboxList, | ||
@@ -101,3 +103,3 @@ defaultComboboxListProps | ||
// src/combobox-root.element.gen.ts | ||
import { ElementMixin as ElementMixin4 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder4 } from "@aria-ui/core"; | ||
@@ -116,2 +118,3 @@ // src/combobox-root.props.ts | ||
} from "@aria-ui/core"; | ||
import { getEventTarget } from "@zag-js/dom-query"; | ||
function useInputValue(element) { | ||
@@ -126,3 +129,3 @@ const input = useQuerySelector(element, "input"); | ||
const handler = (event) => { | ||
const target = event.target; | ||
const target = getEventTarget(event); | ||
if (!target) { | ||
@@ -157,7 +160,6 @@ return; | ||
keydownHandlerContext.provide(element, keydownHandler); | ||
return {}; | ||
} | ||
// src/combobox-root.element.gen.ts | ||
var ComboboxRootElement = class extends ElementMixin4( | ||
var ComboboxRootElement = class extends ElementBuilder4( | ||
useComboboxRoot, | ||
@@ -164,0 +166,0 @@ defaultComboboxRootProps |
{ | ||
"name": "@aria-ui/combobox", | ||
"type": "module", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"private": false, | ||
@@ -12,8 +12,9 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@aria-ui/core": "^0.0.15", | ||
"@aria-ui/listbox": "^0.0.14" | ||
"@aria-ui/core": "^0.0.16", | ||
"@aria-ui/listbox": "^0.0.15", | ||
"@zag-js/dom-query": "^0.58.0" | ||
}, | ||
"devDependencies": { | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.4.5" | ||
"typescript": "^5.5.2" | ||
}, | ||
@@ -20,0 +21,0 @@ "publishConfig": { |
9503
257
3
+ Added@zag-js/dom-query@^0.58.0
+ Added@aria-ui/core@0.0.16(transitive)
+ Added@aria-ui/listbox@0.0.15(transitive)
+ Added@aria-ui/presence@0.0.11(transitive)
+ Added@zag-js/dom-query@0.58.3(transitive)
- Removed@aria-ui/core@0.0.15(transitive)
- Removed@aria-ui/listbox@0.0.14(transitive)
- Removed@aria-ui/presence@0.0.10(transitive)
Updated@aria-ui/core@^0.0.16
Updated@aria-ui/listbox@^0.0.15