@molecule/app-search-ui-vue 0.0.1-stage → 1.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.
Files changed (2) hide show
  1. package/README.md +657 -4
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,11 +1,664 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-21T12:47:15.234Z
7
+ -->
8
+
1
9
  # @molecule/app-search-ui-vue
2
10
 
3
- Vue search UI for @molecule/app-client-search — a search box with filter chips and tips, a ranked results list with matched terms marked, and a quick-search dialog; styled through the ClassMap
11
+ Vue search UI for `@molecule/app-client-search`.
12
+
13
+ The Vue counterpart of `@molecule/app-search-ui-react` — the same props
14
+ (React names) and the same DOM for the same input. Three pieces that fit a
15
+ `useSearchSession` from `@molecule/app-client-search-vue`:
16
+ {@link SearchBox} (the field, its clear button and shortcut cap, a help icon
17
+ whose tooltip shows the search syntax, an `afterField` slot for the
18
+ consumer's own tabs, the active filter chips and the hit count),
19
+ {@link SearchResults} (ranked rows with the matched terms marked, hover
20
+ prefetch, an optional action per row; the keyboard-active row is marked with
21
+ `aria-current` and announced through a polite status region), and
22
+ {@link QuickSearchDialog} (both in a `mod+k` dialog named for screen readers
23
+ by its `label`, "Search" by default). Every class comes from
24
+ the ClassMap's search tokens (`searchField`, `resultList`, …), so a UI bond
25
+ restyles all of it at once.
26
+
27
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
28
+ > It is written to be read by coding agents as much as by people, and is generated from this
29
+ > package's source — edit `src/index.ts` JSDoc, not this file.
30
+
31
+ ## Quick Start
32
+
33
+ ```ts
34
+ import { defineComponent, h } from 'vue'
35
+ import { Link } from '@molecule/app-vue'
36
+ import { useSearchSession } from '@molecule/app-client-search-vue'
37
+ import { SearchBox, SearchResults } from '@molecule/app-search-ui-vue'
38
+ import { useTranslation } from '@molecule/app-vue'
39
+ import type { SearchResultLinkProps } from '@molecule/app-search-ui-vue'
40
+
41
+ const Catalog = defineComponent({
42
+ setup() {
43
+ const { t } = useTranslation()
44
+ const session = useSearchSession({
45
+ docs: packages,
46
+ options: PACKAGE_INDEX_OPTIONS,
47
+ rememberKey: 'catalog.search',
48
+ onOpen: (p) => router.push(`/packages/${p.name}`),
49
+ })
50
+ const renderLink = (p: SearchResultLinkProps) =>
51
+ h(
52
+ Link,
53
+ {
54
+ to: p.href,
55
+ state: p.state,
56
+ class: p.className,
57
+ onClick: p.onClick,
58
+ 'data-mol-id': p['data-mol-id'],
59
+ },
60
+ () => [p.children],
61
+ )
62
+ return () => [
63
+ h(SearchBox, {
64
+ value: session.query.value,
65
+ onChange: session.setQuery,
66
+ onKeyDown: session.onKeyDown,
67
+ inputRef: session.inputRef,
68
+ placeholder: t('catalog.search', undefined, { defaultValue: 'Search packages' }),
69
+ count: session.hits.value.length,
70
+ filters: session.parsed.value.filters,
71
+ onRemoveFilter: session.removeFilter,
72
+ onClear: session.clear,
73
+ examples: ['category:auth', 'type:bond'],
74
+ }),
75
+ h(SearchResults, {
76
+ hits: session.hits.value,
77
+ view: (p) => ({
78
+ href: `/packages/${p.name}`,
79
+ title: `@molecule/${p.name}`,
80
+ description: p.description,
81
+ meta: [p.type, p.category],
82
+ mono: true,
83
+ }),
84
+ activeIndex: session.activeIndex.value,
85
+ onActivate: session.setActiveIndex,
86
+ onOpen: session.open,
87
+ onPrefetch: session.prefetch,
88
+ renderLink,
89
+ emptyText: t('catalog.empty', undefined, { defaultValue: 'Nothing matches' }),
90
+ }),
91
+ ]
92
+ },
93
+ })
94
+ ```
95
+
96
+ (`searchPlaceholder` and `nothingMatches` are the app's own translated strings.)
97
+
98
+ ## Type
99
+
100
+ `feature`
101
+
102
+ ## Installation
103
+
104
+ ```bash
105
+ npm install @molecule/app-search-ui-vue @molecule/app-client-search @molecule/app-client-search-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
106
+ ```
107
+
108
+ ## API
109
+
110
+ ### Interfaces
111
+
112
+ #### `KbdProps`
113
+
114
+ Props accepted by {@link Kbd}.
115
+
116
+ ```typescript
117
+ interface KbdProps {
118
+ /** The key or keys shown, e.g. `/`, `↵`, `esc`. Passed as a prop or as the default slot. */
119
+ children?: VNodeChild
120
+ /** Extra classes composed onto the cap. */
121
+ className?: string
122
+ }
123
+ ```
124
+
125
+ #### `HighlightProps`
126
+
127
+ Props for {@link Highlight}.
128
+
129
+ ```typescript
130
+ interface HighlightProps {
131
+ /** The text to show. */
132
+ text: string
133
+ /** The matched terms to mark (a hit's `terms`). */
134
+ terms: string[]
135
+ }
136
+ ```
137
+
138
+ #### `SearchBoxProps`
139
+
140
+ Props accepted by {@link SearchBox}.
141
+
142
+ ```typescript
143
+ interface SearchBoxProps {
144
+ /** The text. */
145
+ value: string
146
+ /** Called with the new text on every keystroke. */
147
+ onChange: (value: string) => void
148
+ /** Key handling for the input (arrows, Enter, Escape), usually a session's `onKeyDown`. */
149
+ onKeyDown?: (event: KeyboardEvent) => void
150
+ /** A ref to the input, so a shortcut can focus it. */
151
+ inputRef?: { current: HTMLInputElement | null }
152
+ /** Placeholder, already translated. Also the accessible name unless `label` is given. */
153
+ placeholder: string
154
+ /** Accessible name for the input, already translated. Defaults to `placeholder`. */
155
+ label?: string
156
+ /** How many hits the current text has. Omit to show no count. */
157
+ count?: number
158
+ /** Active `field:value` filters, shown as removable chips. */
159
+ filters?: ClientSearchFilter[]
160
+ /** Removes the i-th filter. */
161
+ onRemoveFilter?: (index: number) => void
162
+ /** Clears the text. Shown as an × while there is text. */
163
+ onClear?: () => void
164
+ /**
165
+ * Example tokens for the search tips, e.g. `['category:auth', 'type:bond']`.
166
+ * Given, a help icon sits inside the field and shows the syntax on hover or
167
+ * focus. Omit for no help icon.
168
+ */
169
+ examples?: string[]
170
+ /** The key that focuses the box, shown as a cap while it is empty. `null` hides it. Defaults to `/`. */
171
+ shortcut?: string | null
172
+ /** Focus the input on mount. */
173
+ autoFocus?: boolean
174
+ /**
175
+ * Rendered directly under the field, before the status row (chips and
176
+ * count), so a consumer can put its own controls — tabs, a scope switch —
177
+ * right below the input. Passed as a prop or as the same-named slot.
178
+ */
179
+ afterField?: VNodeChild
180
+ /** `data-mol-id` prefix: `<molId>-input`, `-clear`, `-help`, `-filter`, `-count`. */
181
+ molId?: string
182
+ /** Extra classes composed onto the field. */
183
+ className?: string
184
+ }
185
+ ```
186
+
187
+ #### `SearchResultHit`
188
+
189
+ What the list needs from a hit. A session's hits already have this shape.
190
+
191
+ ```typescript
192
+ interface SearchResultHit<T> {
193
+ id: string
194
+ doc: T
195
+ /** The matched terms, marked in the title and description. */
196
+ terms: string[]
197
+ /** Found by meaning rather than by the words typed. */
198
+ related?: boolean
199
+ }
200
+ ```
201
+
202
+ #### `SearchResultView`
203
+
204
+ How one hit renders.
205
+
206
+ ```typescript
207
+ interface SearchResultView {
208
+ /** Where the row goes. */
209
+ href: string
210
+ /** The row's title. */
211
+ title: string
212
+ /** Under the title, clamped to two lines. */
213
+ description?: string
214
+ /** Small facts after the title: type, category, source. */
215
+ meta?: string[]
216
+ /** Render the title in monospace (a package name). */
217
+ mono?: boolean
218
+ /** Opaque data handed to `renderLink` (router state). */
219
+ state?: unknown
220
+ }
221
+ ```
222
+
223
+ #### `SearchResultLinkProps`
224
+
225
+ Props the row's link gets; `renderLink` turns them into a node.
226
+
227
+ ```typescript
228
+ interface SearchResultLinkProps {
229
+ href: string
230
+ className: string
231
+ children: VNodeChild
232
+ onClick: (event: MouseEvent) => void
233
+ state?: unknown
234
+ 'data-mol-id': string
235
+ }
236
+ ```
237
+
238
+ #### `SearchResultsProps`
239
+
240
+ Props for {@link SearchResults}.
4
241
 
242
+ ```typescript
243
+ interface SearchResultsProps<T> {
244
+ hits: SearchResultHit<T>[]
245
+ /** How a hit renders. */
246
+ view: (doc: T) => SearchResultView
247
+ /** The keyboard- or pointer-active row, or `-1`. */
248
+ activeIndex: number
249
+ /** The pointer moved onto a row. */
250
+ onActivate?: (index: number) => void
251
+ /** A row was chosen (a plain click, or Enter elsewhere). Navigation is the caller's. */
252
+ onOpen: (doc: T) => void
253
+ /** The person is about to open a row (hover, focus, touch): warm its page. */
254
+ onPrefetch?: (doc: T) => void
255
+ /**
256
+ * Renders the row's link. Defaults to a plain `<a>`; pass a router link to
257
+ * keep navigation client-side (spread `props` onto it; `state` is optional).
258
+ */
259
+ renderLink?: (props: SearchResultLinkProps) => VNodeChild
260
+ /** Something at the row's end (an action button). */
261
+ action?: (doc: T) => VNodeChild
262
+ /** Shown when there are no hits. */
263
+ emptyText: string
264
+ /** `data-mol-id` prefix: `<molId>-results`, `-hit`, `-link`, `-related`, `-empty`, `-active`. */
265
+ molId?: string
266
+ /** Extra classes composed onto the list. */
267
+ className?: string
268
+ }
5
269
  ```
6
- npm install @molecule/app-search-ui-vue
270
+
271
+ #### `QuickSearchDialogProps`
272
+
273
+ Props for {@link QuickSearchDialog}.
274
+
275
+ ```typescript
276
+ interface QuickSearchDialogProps<T extends ClientSearchDocument> {
277
+ /** Whether the dialog is open. Rendered only while open. */
278
+ open: boolean
279
+ /** Close it (Escape with nothing typed, the overlay, or after opening a hit). */
280
+ onClose: () => void
281
+ /** The search session (from `useSearchSession`), created with `syncUrl: false` and `onEscape: onClose`. */
282
+ session: SearchSession<T>
283
+ /** How a hit renders. */
284
+ view: (doc: T) => SearchResultView
285
+ /** Placeholder for the box, already translated. */
286
+ placeholder: string
287
+ /** Example tokens for the tips line. */
288
+ examples?: string[]
289
+ /** Shown while the text matches nothing, already translated. */
290
+ emptyText: string
291
+ /** Shown before anything is typed, already translated. Defaults to the empty text. */
292
+ idleText?: string
293
+ /** Renders each row's link (a router link keeps navigation client-side). */
294
+ renderLink?: (props: SearchResultLinkProps) => VNodeChild
295
+ /**
296
+ * The dialog's accessible name, already translated (like `placeholder`, it
297
+ * names nothing visible). Defaults to `t('searchUi.dialogLabel')`
298
+ * ("Search"); the field's placeholder already names the field.
299
+ */
300
+ label?: string
301
+ /** `data-mol-id` prefix. Defaults to `quick-search`. */
302
+ molId?: string
303
+ }
7
304
  ```
8
305
 
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.
306
+ ### Constants
307
+
308
+ #### `Highlight`
309
+
310
+ Text with the matched terms marked: each term is marked where it starts a
311
+ word, case-insensitively, through the ClassMap's `resultMark`.
312
+
313
+ ```typescript
314
+ const Highlight: DefineComponent<
315
+ ExtractPropTypes<{
316
+ text: { type: StringConstructor; required: true }
317
+ terms: { type: PropType<string[]>; required: true }
318
+ }>,
319
+ () => VNodeChild[],
320
+ {},
321
+ {},
322
+ {},
323
+ ComponentOptionsMixin,
324
+ ComponentOptionsMixin,
325
+ {},
326
+ string,
327
+ PublicProps,
328
+ Readonly<
329
+ ExtractPropTypes<{
330
+ text: { type: StringConstructor; required: true }
331
+ terms: { type: PropType<string[]>; required: true }
332
+ }>
333
+ > &
334
+ Readonly<{}>,
335
+ {},
336
+ {},
337
+ {},
338
+ {},
339
+ string,
340
+ ComponentProvideOptions,
341
+ true,
342
+ {},
343
+ any
344
+ >
345
+ ```
346
+
347
+ - `props` — See {@link HighlightProps}.
348
+
349
+ **Returns:** The marked text component.
350
+
351
+ #### `Kbd`
352
+
353
+ A key cap, for shortcut hints (`/` to focus, `↵` to open). The cap shows a
354
+ key name, not prose (a physical key such as `esc` reads the same in every
355
+ language), so it carries HTML's own `translate="no"`.
356
+
357
+ ```typescript
358
+ const Kbd: DefineComponent<
359
+ ExtractPropTypes<{ children: null; className: StringConstructor }>,
360
+ () => VNode,
361
+ {},
362
+ {},
363
+ {},
364
+ ComponentOptionsMixin,
365
+ ComponentOptionsMixin,
366
+ {},
367
+ string,
368
+ PublicProps,
369
+ Readonly<ExtractPropTypes<{ children: null; className: StringConstructor }>> & Readonly<{}>,
370
+ {},
371
+ {},
372
+ {},
373
+ {},
374
+ string,
375
+ ComponentProvideOptions,
376
+ true,
377
+ {},
378
+ any
379
+ >
380
+ ```
381
+
382
+ - `props` — See {@link KbdProps}.
383
+
384
+ **Returns:** The key cap component.
385
+
386
+ #### `QuickSearchDialog`
387
+
388
+ A search dialog for `mod+k`: the box on top with focus, the hits below in
389
+ a scrolling pane, and the key hints in the footer. Before anything is
390
+ typed the pane shows `idleText` rather than a browse list. Enter opens the active
391
+ hit through the session (which closes the dialog by the caller's `onOpen`).
392
+ The dialog is named for screen readers through `label` (or the translated
393
+ "Search" default).
394
+
395
+ ```typescript
396
+ const QuickSearchDialog: DefineComponent<
397
+ ExtractPropTypes<{
398
+ open: { type: BooleanConstructor; required: true }
399
+ onClose: { type: PropType<() => void>; required: true }
400
+ session: { type: PropType<SearchSession<ClientSearchDocument>>; required: true }
401
+ view: { type: PropType<(doc: unknown) => SearchResultView>; required: true }
402
+ placeholder: { type: StringConstructor; required: true }
403
+ examples: { type: PropType<string[]>; default: undefined }
404
+ emptyText: { type: StringConstructor; required: true }
405
+ idleText: { type: StringConstructor; default: undefined }
406
+ renderLink: {
407
+ type: PropType<((linkProps: SearchResultLinkProps) => VNodeChild) | undefined>
408
+ default: undefined
409
+ }
410
+ label: { type: StringConstructor; default: undefined }
411
+ molId: { type: StringConstructor; default: string }
412
+ }>,
413
+ () => VNodeChild,
414
+ {},
415
+ {},
416
+ {},
417
+ ComponentOptionsMixin,
418
+ ComponentOptionsMixin,
419
+ {},
420
+ string,
421
+ PublicProps,
422
+ Readonly<
423
+ ExtractPropTypes<{
424
+ open: { type: BooleanConstructor; required: true }
425
+ onClose: { type: PropType<() => void>; required: true }
426
+ session: { type: PropType<SearchSession<ClientSearchDocument>>; required: true }
427
+ view: { type: PropType<(doc: unknown) => SearchResultView>; required: true }
428
+ placeholder: { type: StringConstructor; required: true }
429
+ examples: { type: PropType<string[]>; default: undefined }
430
+ emptyText: { type: StringConstructor; required: true }
431
+ idleText: { type: StringConstructor; default: undefined }
432
+ renderLink: {
433
+ type: PropType<((linkProps: SearchResultLinkProps) => VNodeChild) | undefined>
434
+ default: undefined
435
+ }
436
+ label: { type: StringConstructor; default: undefined }
437
+ molId: { type: StringConstructor; default: string }
438
+ }>
439
+ > &
440
+ Readonly<{}>,
441
+ {
442
+ examples: string[]
443
+ idleText: string
444
+ renderLink: ((linkProps: SearchResultLinkProps) => VNodeChild) | undefined
445
+ label: string
446
+ molId: string
447
+ },
448
+ {},
449
+ {},
450
+ {},
451
+ string,
452
+ ComponentProvideOptions,
453
+ true,
454
+ {},
455
+ any
456
+ >
457
+ ```
458
+
459
+ - `props` — See {@link QuickSearchDialogProps}.
460
+
461
+ **Returns:** The dialog component.
462
+
463
+ #### `SearchBox`
464
+
465
+ A search field: a leading icon, the input, a help icon that shows the
466
+ syntax on hover, an × to clear, and the shortcut cap; under it, whatever
467
+ `afterField` holds, then the active filters as removable chips and the
468
+ hit count. The field stays mounted, and its text with it, across searches.
469
+
470
+ ```typescript
471
+ const SearchBox: DefineComponent<
472
+ ExtractPropTypes<{
473
+ value: { type: StringConstructor; required: true }
474
+ onChange: { type: PropType<SearchBoxProps['onChange']>; required: true }
475
+ onKeyDown: { type: PropType<SearchBoxProps['onKeyDown']>; default: undefined }
476
+ inputRef: { type: PropType<SearchBoxProps['inputRef']>; default: undefined }
477
+ placeholder: { type: StringConstructor; required: true }
478
+ label: { type: StringConstructor; default: undefined }
479
+ count: { type: NumberConstructor; default: undefined }
480
+ filters: { type: PropType<ClientSearchFilter[]>; default: () => never[] }
481
+ onRemoveFilter: { type: PropType<SearchBoxProps['onRemoveFilter']>; default: undefined }
482
+ onClear: { type: PropType<SearchBoxProps['onClear']>; default: undefined }
483
+ examples: { type: PropType<string[]>; default: undefined }
484
+ shortcut: { type: null; default: string }
485
+ autoFocus: { type: BooleanConstructor; default: boolean }
486
+ afterField: null
487
+ molId: { type: StringConstructor; default: string }
488
+ className: StringConstructor
489
+ }>,
490
+ () => VNode,
491
+ {},
492
+ {},
493
+ {},
494
+ ComponentOptionsMixin,
495
+ ComponentOptionsMixin,
496
+ {},
497
+ string,
498
+ PublicProps,
499
+ Readonly<
500
+ ExtractPropTypes<{
501
+ value: { type: StringConstructor; required: true }
502
+ onChange: { type: PropType<SearchBoxProps['onChange']>; required: true }
503
+ onKeyDown: { type: PropType<SearchBoxProps['onKeyDown']>; default: undefined }
504
+ inputRef: { type: PropType<SearchBoxProps['inputRef']>; default: undefined }
505
+ placeholder: { type: StringConstructor; required: true }
506
+ label: { type: StringConstructor; default: undefined }
507
+ count: { type: NumberConstructor; default: undefined }
508
+ filters: { type: PropType<ClientSearchFilter[]>; default: () => never[] }
509
+ onRemoveFilter: { type: PropType<SearchBoxProps['onRemoveFilter']>; default: undefined }
510
+ onClear: { type: PropType<SearchBoxProps['onClear']>; default: undefined }
511
+ examples: { type: PropType<string[]>; default: undefined }
512
+ shortcut: { type: null; default: string }
513
+ autoFocus: { type: BooleanConstructor; default: boolean }
514
+ afterField: null
515
+ molId: { type: StringConstructor; default: string }
516
+ className: StringConstructor
517
+ }>
518
+ > &
519
+ Readonly<{}>,
520
+ {
521
+ examples: string[]
522
+ label: string
523
+ molId: string
524
+ onKeyDown: ((event: KeyboardEvent) => void) | undefined
525
+ inputRef: { current: HTMLInputElement | null } | undefined
526
+ onRemoveFilter: ((index: number) => void) | undefined
527
+ onClear: (() => void) | undefined
528
+ count: number
529
+ filters: ClientSearchFilter[]
530
+ shortcut: any
531
+ autoFocus: boolean
532
+ },
533
+ {},
534
+ {},
535
+ {},
536
+ string,
537
+ ComponentProvideOptions,
538
+ true,
539
+ {},
540
+ any
541
+ >
542
+ ```
543
+
544
+ - `props` — See {@link SearchBoxProps}.
545
+
546
+ **Returns:** The field component.
547
+
548
+ #### `SearchResults`
549
+
550
+ The ranked hits: title and description with the matched terms marked, the
551
+ meta line, hover making a row active and warming its page. The whole row is
552
+ the link, so the list is a plain list of links (no listbox roles: an
553
+ option's children are presentational and would hide the row's link and
554
+ action); the active row is marked with `aria-current` on its `<li>` and
555
+ announced through a polite, visually hidden status region after the list.
556
+
557
+ ```typescript
558
+ const SearchResults: DefineComponent<
559
+ ExtractPropTypes<{
560
+ hits: { type: PropType<SearchResultHit<unknown>[]>; required: true }
561
+ view: { type: PropType<(doc: unknown) => SearchResultView>; required: true }
562
+ activeIndex: { type: NumberConstructor; required: true }
563
+ onActivate: { type: PropType<((index: number) => void) | undefined>; default: undefined }
564
+ onOpen: { type: PropType<(doc: unknown) => void>; required: true }
565
+ onPrefetch: { type: PropType<((doc: unknown) => void) | undefined>; default: undefined }
566
+ renderLink: {
567
+ type: PropType<((linkProps: SearchResultLinkProps) => VNodeChild) | undefined>
568
+ default: undefined
569
+ }
570
+ action: { type: PropType<((doc: unknown) => VNodeChild) | undefined>; default: undefined }
571
+ emptyText: { type: StringConstructor; required: true }
572
+ molId: { type: StringConstructor; default: string }
573
+ className: StringConstructor
574
+ }>,
575
+ () => VNodeChild,
576
+ {},
577
+ {},
578
+ {},
579
+ ComponentOptionsMixin,
580
+ ComponentOptionsMixin,
581
+ {},
582
+ string,
583
+ PublicProps,
584
+ Readonly<
585
+ ExtractPropTypes<{
586
+ hits: { type: PropType<SearchResultHit<unknown>[]>; required: true }
587
+ view: { type: PropType<(doc: unknown) => SearchResultView>; required: true }
588
+ activeIndex: { type: NumberConstructor; required: true }
589
+ onActivate: { type: PropType<((index: number) => void) | undefined>; default: undefined }
590
+ onOpen: { type: PropType<(doc: unknown) => void>; required: true }
591
+ onPrefetch: { type: PropType<((doc: unknown) => void) | undefined>; default: undefined }
592
+ renderLink: {
593
+ type: PropType<((linkProps: SearchResultLinkProps) => VNodeChild) | undefined>
594
+ default: undefined
595
+ }
596
+ action: { type: PropType<((doc: unknown) => VNodeChild) | undefined>; default: undefined }
597
+ emptyText: { type: StringConstructor; required: true }
598
+ molId: { type: StringConstructor; default: string }
599
+ className: StringConstructor
600
+ }>
601
+ > &
602
+ Readonly<{}>,
603
+ {
604
+ renderLink: ((linkProps: SearchResultLinkProps) => VNodeChild) | undefined
605
+ molId: string
606
+ onActivate: ((index: number) => void) | undefined
607
+ onPrefetch: ((doc: unknown) => void) | undefined
608
+ action: ((doc: unknown) => VNodeChild) | undefined
609
+ },
610
+ {},
611
+ {},
612
+ {},
613
+ string,
614
+ ComponentProvideOptions,
615
+ true,
616
+ {},
617
+ any
618
+ >
619
+ ```
620
+
621
+ - `props` — See {@link SearchResultsProps}.
622
+
623
+ **Returns:** The results component.
624
+
625
+ ## Injection Notes
626
+
627
+ ### Requirements
628
+
629
+ Peer dependencies:
630
+
631
+ - `@molecule/app-client-search` ^1.0.0
632
+ - `@molecule/app-client-search-vue` ^1.0.0
633
+ - `@molecule/app-ui` ^1.3.3
634
+ - `@molecule/app-ui-vue` ^1.1.0
635
+ - `@molecule/app-vue` ^3.5.0
636
+ - `vue` ^3.4.0
637
+
638
+ ### Runtime Dependencies
639
+
640
+ - `@molecule/app-client-search`
641
+ - `@molecule/app-client-search-vue`
642
+ - `@molecule/app-ui`
643
+ - `@molecule/app-ui-vue`
644
+ - `@molecule/app-vue`
645
+ - `vue`
646
+
647
+ - **Pass a router link through `renderLink`**, or every row is a full page
648
+ load: the list renders a plain `<a>` by default because it does not know
649
+ your router. A plain click calls `onOpen` (which the session turns into
650
+ navigation); a modified click is left to the browser so "open in new tab" works.
651
+ - The box does not own the text: bind `value`/`onChange` to a session (or
652
+ any state) and it stays mounted, with its text, across searches. Do not
653
+ remount it per search.
654
+ - `placeholder`, `emptyText` and the like are already-translated strings
655
+ from the app; the package translates only its own chrome ("Clear
656
+ search", "{{count}} results", "Search tips") through `@molecule/app-locales-search-ui`.
657
+ - The quick dialog needs a session created with `syncUrl: false` and
658
+ `onEscape: onClose`; the page's own session keeps the URL.
659
+ - Node-valued props (`afterField`, `Kbd`'s `children`) arrive as a prop AND
660
+ a same-named slot; components accept either.
661
+
662
+ ## Translations
10
663
 
11
- License: Apache-2.0
664
+ Translation strings are provided by `@molecule/app-locales-search-ui`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-search-ui-vue",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.0",
4
4
  "description": "Vue search UI for @molecule/app-client-search — a search box with filter chips and tips, a ranked results list with matched terms marked, and a quick-search dialog; styled through the ClassMap",
5
5
  "homepage": "https://www.molecule.dev/packages/app-search-ui-vue",
6
6
  "type": "module",
@@ -55,13 +55,13 @@
55
55
  "devDependencies": {
56
56
  "@molecule/app-client-search": "1.0.4",
57
57
  "@molecule/app-client-search-minisearch": "1.0.4",
58
- "@molecule/app-client-search-vue": "1.0.0",
58
+ "@molecule/app-client-search-vue": "1.1.0",
59
59
  "@molecule/app-framework-conformance": "0.0.0",
60
60
  "@molecule/app-i18n": "1.2.2",
61
61
  "@molecule/app-icons": "1.0.4",
62
- "@molecule/app-ui": "1.4.0",
63
- "@molecule/app-ui-vue": "1.1.5",
64
- "@molecule/app-vue": "3.7.2",
62
+ "@molecule/app-ui": "1.5.0",
63
+ "@molecule/app-ui-vue": "1.2.1",
64
+ "@molecule/app-vue": "3.9.0",
65
65
  "@types/node": "26.6.5",
66
66
  "jsdom": "30.1.3",
67
67
  "typescript": "6.0.3",