@kenos-ui/react-combobox 0.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # @kenos-ui/react-combobox
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Initial Combobox scaffold: Root, Label, Input, Trigger, Content, List, Item, ItemText, Empty, Clear
8
+ - `ComboboxStore` with `open`, `value`, `inputValue`, `highlightedValue`, and item registry
9
+ - Type-to-filter via `@kenos-ui/utils` `useSelectCollection`
10
+ - Basic keyboard: filter on type, arrow navigation, Enter to select
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Allyson Soares
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # @kenos-ui/react-combobox
2
+
3
+ Headless, accessible, composable Combobox primitive for React.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @kenos-ui/react-combobox
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { Combobox } from '@kenos-ui/react-combobox';
15
+
16
+ <Combobox.Root onValueChange={setValue}>
17
+ <Combobox.Label>Language</Combobox.Label>
18
+ <Combobox.Input placeholder="Search…" />
19
+ <Combobox.Trigger>▼</Combobox.Trigger>
20
+ <Combobox.Content>
21
+ <Combobox.List>
22
+ <Combobox.Item value="ts">
23
+ <Combobox.ItemText>TypeScript</Combobox.ItemText>
24
+ </Combobox.Item>
25
+ <Combobox.Item value="js">
26
+ <Combobox.ItemText>JavaScript</Combobox.ItemText>
27
+ </Combobox.Item>
28
+ </Combobox.List>
29
+ <Combobox.Empty>No results</Combobox.Empty>
30
+ </Combobox.Content>
31
+ <Combobox.Clear />
32
+ </Combobox.Root>
33
+ ```
34
+
35
+ ## API
36
+
37
+ | Part | Description |
38
+ |------|-------------|
39
+ | `Root` | Context + state provider |
40
+ | `Label` | Associated `<label>` |
41
+ | `Input` | Text input (`role="combobox"`) — type to filter |
42
+ | `Trigger` | Button that toggles the listbox |
43
+ | `Content` | Listbox container (floating, lazyMount) |
44
+ | `List` | `role="listbox"` wrapper |
45
+ | `Item` | `role="option"` — registers value/label |
46
+ | `ItemText` | Option label slot |
47
+ | `Empty` | Shown when the filtered collection is empty |
48
+ | `Clear` | Clears value and input text |
49
+
50
+ ## Store
51
+
52
+ `ComboboxStore` tracks:
53
+
54
+ - `open` — listbox visibility
55
+ - `value` — selected value
56
+ - `inputValue` — current input text (filter query)
57
+ - `highlightedValue` — keyboard/mouse highlight
58
+ - `items` — registry populated by `Combobox.Item`
59
+
60
+ Filtering uses `useSelectCollection` from `@kenos-ui/utils` (not a dependency on `@kenos-ui/react-select`).
61
+
62
+ ## Popup defaults (interop-first)
63
+
64
+ - `modal={false}` — no inert/aria-modal on document
65
+ - `lazyMount` — content is not in the DOM until first opened
66
+ - Escape `stopPropagation` — closes Combobox without closing a parent Dialog
67
+
68
+ See [popup-policy.md](../../docs/popup-policy.md).