@molecule/app-search-autocomplete-solid 0.0.0-stage → 0.0.1-stage

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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,11 @@
1
- # Temporary Holding Version
1
+ # @molecule/app-search-autocomplete-solid
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Search input with typeahead suggestion popover
4
+
5
+ ```
6
+ npm install @molecule/app-search-autocomplete-solid
7
+ ```
8
+
9
+ Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
10
+
11
+ License: Apache-2.0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Solid search input with a typeahead suggestion popover.
3
+ *
4
+ * @module
5
+ */
6
+ import type { Component } from 'solid-js';
7
+ import type { SearchAutocompleteProps } from './types.js';
8
+ /**
9
+ * Search input with a typeahead suggestions popover. Pass either
10
+ * `onSearch` (async fetch with debounce) or `suggestions` (controlled).
11
+ *
12
+ * Solid counterpart of `@molecule/app-search-autocomplete-react`'s
13
+ * `SearchAutocomplete` — the same props (React names), the same ClassMap
14
+ * tokens, the same DOM for the same input, and the same callback calls.
15
+ *
16
+ * @param props - Component props (see {@link SearchAutocompleteProps}).
17
+ * @returns The rendered search autocomplete.
18
+ */
19
+ export declare const SearchAutocomplete: Component<SearchAutocompleteProps>;
20
+ //# sourceMappingURL=SearchAutocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchAutocomplete.d.ts","sourceRoot":"","sources":["../src/SearchAutocomplete.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAO,MAAM,UAAU,CAAA;AAQ9C,OAAO,KAAK,EAAE,uBAAuB,EAAkB,MAAM,YAAY,CAAA;AAazE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CAuOjE,CAAA"}
@@ -0,0 +1,215 @@
1
+ /**
2
+ * Solid search input with a typeahead suggestion popover.
3
+ *
4
+ * @module
5
+ */
6
+ import { createEffect, createSignal, createUniqueId, For, on, onCleanup, Show } from 'solid-js';
7
+ import { useTranslation } from '@molecule/app-solid';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { Input } from '@molecule/app-ui-solid';
10
+ /**
11
+ * Renders a node value: a plain JSX value, or the accessor a conformance node
12
+ * value arrives as inside a data prop (React keeps the node itself, so each
13
+ * framework unwraps its own form).
14
+ *
15
+ * @param value - The node value.
16
+ * @returns The JSX the node contributes.
17
+ */
18
+ const nodeValue = (value) => typeof value === 'function' ? value() : value;
19
+ /**
20
+ * Search input with a typeahead suggestions popover. Pass either
21
+ * `onSearch` (async fetch with debounce) or `suggestions` (controlled).
22
+ *
23
+ * Solid counterpart of `@molecule/app-search-autocomplete-react`'s
24
+ * `SearchAutocomplete` — the same props (React names), the same ClassMap
25
+ * tokens, the same DOM for the same input, and the same callback calls.
26
+ *
27
+ * @param props - Component props (see {@link SearchAutocompleteProps}).
28
+ * @returns The rendered search autocomplete.
29
+ */
30
+ export const SearchAutocomplete = (props) => {
31
+ const cm = getClassMap();
32
+ const { t } = useTranslation();
33
+ const [internal, setInternal] = createSignal([]);
34
+ const [open, setOpen] = createSignal(false);
35
+ const [activeIndex, setActiveIndex] = createSignal(-1);
36
+ /** The wrapper element the outside-mousedown check tests against. */
37
+ let wrapper;
38
+ // Monotonic id of the latest in-flight `onSearch`. A response only applies if
39
+ // its token still equals the latest — the stale-response race guard.
40
+ let request = 0;
41
+ const baseId = createUniqueId();
42
+ const listId = `${baseId}-listbox`;
43
+ /**
44
+ * Stable DOM id for the option at `index` (referenced by aria-activedescendant).
45
+ * @param index - Option position.
46
+ * @returns The option id.
47
+ */
48
+ const optionId = (index) => `${baseId}-option-${index}`;
49
+ /** The suggestion list: the caller's controlled list wins over fetched results. */
50
+ const list = () => props.suggestions ?? internal();
51
+ /** The popover is only visible with open + at least one suggestion. */
52
+ const isExpanded = () => open() && list().length > 0;
53
+ /**
54
+ * The highlight clamped to the current list: a list that shrinks below the
55
+ * highlighted index leaves the old option id pointing at nothing, so every
56
+ * read of the index (activedescendant, the highlighted option, Enter) sees
57
+ * -1 — nothing highlighted — instead of naming an option that is gone.
58
+ *
59
+ * @returns The active index, or -1 when nothing is highlighted.
60
+ */
61
+ const active = () => {
62
+ const index = activeIndex();
63
+ return index < list().length ? index : -1;
64
+ };
65
+ /** React's `debounceMs = 200` default parameter. */
66
+ const debounce = () => props.debounceMs ?? 200;
67
+ /** React's `minChars = 1` default parameter. */
68
+ const minChars = () => props.minChars ?? 1;
69
+ // React's debounced `onSearch` effect: a new value/search/debounce/minChars
70
+ // restarts the timer; a query shorter than minChars clears the results.
71
+ createEffect(() => {
72
+ const value = props.value;
73
+ const onSearch = props.onSearch;
74
+ const debounceMs = debounce();
75
+ const threshold = minChars();
76
+ if (!onSearch || value.length < threshold) {
77
+ setInternal([]);
78
+ return;
79
+ }
80
+ const timer = setTimeout(() => {
81
+ const token = ++request;
82
+ Promise.resolve(onSearch(value))
83
+ .then((result) => {
84
+ // Drop a response that lost the race: only the LATEST request may
85
+ // apply, so a slow earlier fetch can't clobber fresher results.
86
+ if (token === request)
87
+ setInternal(result);
88
+ })
89
+ .catch((_error) => {
90
+ // Typeahead is best-effort — a failed suggestion fetch simply yields
91
+ // no suggestions for THIS query. Guard on the token so an
92
+ // out-of-order failure can't wipe a fresher successful result.
93
+ if (token === request)
94
+ setInternal([]);
95
+ });
96
+ }, debounceMs);
97
+ onCleanup(() => clearTimeout(timer));
98
+ });
99
+ // A new query resets the keyboard highlight (works for both the internal and
100
+ // the controlled `suggestions` data modes).
101
+ createEffect(on(() => props.value, () => setActiveIndex(-1)));
102
+ // React's outside-mousedown effect: the listener exists only while open.
103
+ createEffect(() => {
104
+ if (!open())
105
+ return;
106
+ /**
107
+ * Closes the dropdown when a click occurs outside the wrapper element.
108
+ * @param event - The document mousedown.
109
+ */
110
+ const onDoc = (event) => {
111
+ if (!wrapper?.contains(event.target)) {
112
+ setOpen(false);
113
+ setActiveIndex(-1);
114
+ }
115
+ };
116
+ document.addEventListener('mousedown', onDoc);
117
+ onCleanup(() => document.removeEventListener('mousedown', onDoc));
118
+ });
119
+ /**
120
+ * Commits a suggestion selection and closes the popover.
121
+ * @param item - The chosen suggestion.
122
+ */
123
+ const select = (item) => {
124
+ props.onSelect?.(item);
125
+ setOpen(false);
126
+ setActiveIndex(-1);
127
+ };
128
+ /**
129
+ * Full keyboard support for the combobox: ArrowDown/ArrowUp move the
130
+ * highlight (opening the popover if needed), Enter selects the highlighted
131
+ * option, Escape closes.
132
+ * @param event - The keyboard event from the input.
133
+ */
134
+ const onKeyDown = (event) => {
135
+ const current = list();
136
+ if (event.key === 'ArrowDown') {
137
+ event.preventDefault();
138
+ if (!open()) {
139
+ if (current.length > 0)
140
+ setOpen(true);
141
+ return;
142
+ }
143
+ if (current.length === 0)
144
+ return;
145
+ setActiveIndex((index) => (index + 1) % current.length);
146
+ }
147
+ else if (event.key === 'ArrowUp') {
148
+ event.preventDefault();
149
+ if (!open()) {
150
+ if (current.length > 0)
151
+ setOpen(true);
152
+ return;
153
+ }
154
+ if (current.length === 0)
155
+ return;
156
+ setActiveIndex((index) => (index <= 0 ? current.length - 1 : index - 1));
157
+ }
158
+ else if (event.key === 'Enter') {
159
+ const index = active();
160
+ if (isExpanded() && index >= 0) {
161
+ event.preventDefault();
162
+ select(current[index]);
163
+ }
164
+ }
165
+ else if (event.key === 'Escape') {
166
+ if (open()) {
167
+ event.preventDefault();
168
+ setOpen(false);
169
+ setActiveIndex(-1);
170
+ }
171
+ }
172
+ };
173
+ return (<div ref={(element) => {
174
+ wrapper = element;
175
+ }} class={cm.cn(cm.position('relative'), props.className)}>
176
+ <Input type="search" value={props.value} onChange={(event) => {
177
+ props.onChange?.(event.target.value);
178
+ setOpen(true);
179
+ }} onFocus={() => {
180
+ if (props.value.length >= minChars())
181
+ setOpen(true);
182
+ }} onKeyDown={onKeyDown} placeholder={props.placeholder ?? t('search.placeholder', {}, { defaultValue: 'Search…' })} role="combobox" aria-label={props.ariaLabel ?? t('search.aria.label', undefined, { defaultValue: 'Search' })} aria-autocomplete="list" aria-expanded={isExpanded()} aria-controls={listId} aria-activedescendant={isExpanded() && active() >= 0 ? optionId(active()) : undefined}/>
183
+ <Show when={isExpanded()}>
184
+ <ul role="listbox" id={listId} class={cm.cn(cm.stack(0), cm.sp('p', 1))} style={{
185
+ position: 'absolute',
186
+ top: '100%',
187
+ left: '0px',
188
+ right: '0px',
189
+ 'z-index': '50',
190
+ background: 'var(--color-surface, #fff)',
191
+ border: '1px solid rgba(0, 0, 0, 0.1)',
192
+ 'border-radius': '8px',
193
+ 'box-shadow': '0 8px 24px rgba(0,0,0,0.12)',
194
+ 'max-height': '320px',
195
+ 'overflow-y': 'auto',
196
+ }}>
197
+ <For each={list()}>
198
+ {(suggestion, index) => (<li id={optionId(index())} role="option" aria-selected={index() === active() ? 'true' : 'false'} tabindex={-1} data-mol-id="search-autocomplete-option" onMouseEnter={() => setActiveIndex(index())}
199
+ // Pointer selection happens on press: preventDefault keeps DOM
200
+ // focus on the input, which owns the combobox.
201
+ onMouseDown={(event) => {
202
+ event.preventDefault();
203
+ select(suggestion);
204
+ }} class={cm.cn(cm.sp('px', 2), cm.sp('py', 2), cm.textSize('sm'), cm.cursorPointer, index() === active() && cm.surfaceSecondary)}>
205
+ <div class={cm.fontWeight('medium')}>{nodeValue(suggestion.label)}</div>
206
+ <Show when={suggestion.meta}>
207
+ <div class={cm.textSize('xs')}>{nodeValue(suggestion.meta)}</div>
208
+ </Show>
209
+ </li>)}
210
+ </For>
211
+ </ul>
212
+ </Show>
213
+ </div>);
214
+ };
215
+ //# sourceMappingURL=SearchAutocomplete.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UAAA,EAAE,GAAG,CACP;QAAA,EAAE,EAAE,CACN;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Search input with a typeahead suggestion popover.
3
+ *
4
+ * Exports `<SearchAutocomplete>` and the `SuggestionItem<T>` type
5
+ * (`{ id, label, meta?, data? }`). Two data modes — pass ONE of:
6
+ * `onSearch(query)` (async fetch, debounced; default 200 ms) or
7
+ * `suggestions` (caller-controlled list). Other props: `value` / `onChange`
8
+ * (controlled input), `onSelect(item)`, `placeholder?` (defaults to the
9
+ * translated `search.placeholder`), `debounceMs?`, `minChars?` (default 1),
10
+ * `className?`.
11
+ *
12
+ * Solid counterpart of `@molecule/app-search-autocomplete-react`: the same
13
+ * exports, the same props (React names), the same ClassMap tokens and the same
14
+ * DOM for the same input.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { createSignal } from 'solid-js'
19
+ *
20
+ * import { SearchAutocomplete } from '@molecule/app-search-autocomplete-solid'
21
+ * import type { SuggestionItem } from '@molecule/app-search-autocomplete-solid'
22
+ *
23
+ * function UserSearch(props: {
24
+ * fetchUsers: (q: string) => Promise<SuggestionItem<{ id: string }>[]>
25
+ * onPick: (id: string) => void
26
+ * }) {
27
+ * const [query, setQuery] = createSignal('')
28
+ * return (
29
+ * <SearchAutocomplete
30
+ * value={query()}
31
+ * onChange={setQuery}
32
+ * onSearch={props.fetchUsers}
33
+ * onSelect={(item) => (item.data ? props.onPick(item.data.id) : undefined)}
34
+ * placeholder="Search users…"
35
+ * />
36
+ * )
37
+ * }
38
+ * ```
39
+ *
40
+ * @remarks
41
+ * - Throws unless rendered inside `<MoleculeProvider>` (from
42
+ * `@molecule/app-solid`) with a bonded ClassMap.
43
+ * - Full keyboard support: it's an ARIA combobox — ArrowDown/ArrowUp move the
44
+ * highlight (opening the popover), Enter selects the highlighted option, and
45
+ * Escape closes. `aria-activedescendant` tracks the active `role="option"`.
46
+ * - Stale-response safe: out-of-order `onSearch` responses are dropped (each
47
+ * request carries a token; only the latest applies), so a slow earlier fetch
48
+ * can't overwrite fresher results. `onSearch` needs no cancellation of its own.
49
+ * - The popover surface uses `var(--color-surface)` with a WHITE fallback
50
+ * and black-alpha borders — define `--color-surface` (dark themes) or the
51
+ * dropdown stays light.
52
+ * - Default placeholder translations: `@molecule/app-locales-search-autocomplete`.
53
+ *
54
+ * @module
55
+ */
56
+ export * from './SearchAutocomplete.jsx';
57
+ export * from './types.js';
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,0BAA0B,CAAA;AACxC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Search input with a typeahead suggestion popover.
3
+ *
4
+ * Exports `<SearchAutocomplete>` and the `SuggestionItem<T>` type
5
+ * (`{ id, label, meta?, data? }`). Two data modes — pass ONE of:
6
+ * `onSearch(query)` (async fetch, debounced; default 200 ms) or
7
+ * `suggestions` (caller-controlled list). Other props: `value` / `onChange`
8
+ * (controlled input), `onSelect(item)`, `placeholder?` (defaults to the
9
+ * translated `search.placeholder`), `debounceMs?`, `minChars?` (default 1),
10
+ * `className?`.
11
+ *
12
+ * Solid counterpart of `@molecule/app-search-autocomplete-react`: the same
13
+ * exports, the same props (React names), the same ClassMap tokens and the same
14
+ * DOM for the same input.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { createSignal } from 'solid-js'
19
+ *
20
+ * import { SearchAutocomplete } from '@molecule/app-search-autocomplete-solid'
21
+ * import type { SuggestionItem } from '@molecule/app-search-autocomplete-solid'
22
+ *
23
+ * function UserSearch(props: {
24
+ * fetchUsers: (q: string) => Promise<SuggestionItem<{ id: string }>[]>
25
+ * onPick: (id: string) => void
26
+ * }) {
27
+ * const [query, setQuery] = createSignal('')
28
+ * return (
29
+ * <SearchAutocomplete
30
+ * value={query()}
31
+ * onChange={setQuery}
32
+ * onSearch={props.fetchUsers}
33
+ * onSelect={(item) => (item.data ? props.onPick(item.data.id) : undefined)}
34
+ * placeholder="Search users…"
35
+ * />
36
+ * )
37
+ * }
38
+ * ```
39
+ *
40
+ * @remarks
41
+ * - Throws unless rendered inside `<MoleculeProvider>` (from
42
+ * `@molecule/app-solid`) with a bonded ClassMap.
43
+ * - Full keyboard support: it's an ARIA combobox — ArrowDown/ArrowUp move the
44
+ * highlight (opening the popover), Enter selects the highlighted option, and
45
+ * Escape closes. `aria-activedescendant` tracks the active `role="option"`.
46
+ * - Stale-response safe: out-of-order `onSearch` responses are dropped (each
47
+ * request carries a token; only the latest applies), so a slow earlier fetch
48
+ * can't overwrite fresher results. `onSearch` needs no cancellation of its own.
49
+ * - The popover surface uses `var(--color-surface)` with a WHITE fallback
50
+ * and black-alpha borders — define `--color-surface` (dark themes) or the
51
+ * dropdown stays light.
52
+ * - Default placeholder translations: `@molecule/app-locales-search-autocomplete`.
53
+ *
54
+ * @module
55
+ */
56
+ export * from './SearchAutocomplete.jsx';
57
+ export * from './types.js';
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,0BAA0B,CAAA;AACxC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Types of `@molecule/app-search-autocomplete-solid` — the Solid counterpart of
3
+ * `@molecule/app-search-autocomplete-react`, the same props (React names) and
4
+ * the same DOM for the same input.
5
+ *
6
+ * @module
7
+ */
8
+ import type { JSX } from 'solid-js';
9
+ /**
10
+ * A single suggestion entry returned by `onSearch` or passed via `suggestions`.
11
+ */
12
+ export interface SuggestionItem<T = unknown> {
13
+ id: string;
14
+ label: JSX.Element;
15
+ /** Optional secondary line / category. */
16
+ meta?: JSX.Element;
17
+ /** Original payload for the selection callback. */
18
+ data?: T;
19
+ }
20
+ /** Props accepted by the {@link SearchAutocomplete} component. */
21
+ export interface SearchAutocompleteProps<T = unknown> {
22
+ /** Current input value. */
23
+ value: string;
24
+ /** Called whenever the input changes. */
25
+ onChange: (value: string) => void;
26
+ /** Async search function — receives the query, returns suggestions. */
27
+ onSearch?: (query: string) => Promise<SuggestionItem<T>[]> | SuggestionItem<T>[];
28
+ /** Optional pre-computed suggestion list (when caller controls fetching). */
29
+ suggestions?: SuggestionItem<T>[];
30
+ /** Called when the user picks a suggestion. */
31
+ onSelect: (item: SuggestionItem<T>) => void;
32
+ /** Placeholder. */
33
+ placeholder?: string;
34
+ /**
35
+ * Accessible name for the input, rendered as `aria-label`. Defaults to the
36
+ * translated `search.aria.label`: a placeholder is not a label, so an input
37
+ * named only by its placeholder (let alone an empty one) is nameless for
38
+ * assistive technology.
39
+ */
40
+ ariaLabel?: string;
41
+ /** Debounce ms for `onSearch`. Defaults to 200. */
42
+ debounceMs?: number;
43
+ /** Min chars before suggestions appear. Defaults to 1. */
44
+ minChars?: number;
45
+ /** Extra classes on the wrapper. */
46
+ className?: string;
47
+ }
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,mDAAmD;IACnD,IAAI,CAAC,EAAE,CAAC,CAAA;CACT;AAED,kEAAkE;AAClE,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,OAAO;IAClD,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,yCAAyC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAA;IAChF,6EAA6E;IAC7E,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAA;IACjC,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IAC3C,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Types of `@molecule/app-search-autocomplete-solid` — the Solid counterpart of
3
+ * `@molecule/app-search-autocomplete-react`, the same props (React names) and
4
+ * the same DOM for the same input.
5
+ *
6
+ * @module
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@molecule/app-search-autocomplete-solid",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1-stage",
4
+ "description": "Search input with typeahead suggestion popover",
5
+ "homepage": "https://www.molecule.dev/packages/app-search-autocomplete-solid",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "keywords": [
26
+ "molecule",
27
+ "search-autocomplete",
28
+ "solid"
29
+ ],
30
+ "author": "Molecule Dev, Inc. (https://molecule.dev)",
31
+ "license": "Apache-2.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/molecule-dev/molecule.git",
35
+ "directory": "packages/app/features/search-autocomplete-solid"
36
+ },
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "bugs": "https://github.com/molecule-dev/molecule/issues",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "peerDependencies": {
45
+ "@molecule/app-solid": "^3.5.0",
46
+ "@molecule/app-ui": "^1.5.0",
47
+ "@molecule/app-ui-solid": "^1.1.0",
48
+ "solid-js": "^1.8.0"
49
+ },
50
+ "devDependencies": {
51
+ "@molecule/app-framework-conformance": "0.0.0",
52
+ "@molecule/app-i18n": "1.2.2",
53
+ "@molecule/app-icons": "1.0.4",
54
+ "@molecule/app-solid": "3.7.2",
55
+ "@molecule/app-ui": "1.4.0",
56
+ "@molecule/app-ui-solid": "1.1.5",
57
+ "@types/node": "26.6.5",
58
+ "jsdom": "30.1.3",
59
+ "solid-js": "1.9.17",
60
+ "typescript": "6.0.3",
61
+ "vite-plugin-solid": "2.11.15",
62
+ "vitest": "4.1.12"
63
+ }
64
+ }