@molecule/app-search-ui-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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Solid ranked search results — the counterpart of
3
+ * `@molecule/app-search-ui-react`'s `SearchResults`.
4
+ *
5
+ * @module
6
+ */
7
+ import { type JSX } from 'solid-js';
8
+ import type { SearchResultsProps } from './types.js';
9
+ /**
10
+ * The ranked hits: title and description with the matched terms marked, the
11
+ * meta line, hover making a row active and warming its page. The whole row is
12
+ * the link, so the list is a plain list of links (no listbox roles: an
13
+ * option's children are presentational and would hide the row's link and
14
+ * action); the active row is marked with `aria-current` on its `<li>` and
15
+ * announced through a polite, visually hidden status region after the list.
16
+ *
17
+ * React keys each row by the hit's `id` value, so a re-passed or re-ordered
18
+ * array keeps the rendered rows per id. Solid's `For` keys by reference, so
19
+ * the rows are keyed through stable per-id records: the record for an id is
20
+ * created once and reused, while the row's content reads the CURRENT hit for
21
+ * that id reactively.
22
+ *
23
+ * @param props - See {@link SearchResultsProps}.
24
+ * @returns The list, or the empty state.
25
+ */
26
+ export declare const SearchResults: <T>(props: SearchResultsProps<T>) => JSX.Element;
27
+ //# sourceMappingURL=SearchResults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../src/SearchResults.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAqB,KAAK,GAAG,EAAQ,MAAM,UAAU,CAAA;AAM5D,OAAO,KAAK,EAA0C,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAuB5F;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,OAAO,kBAAkB,CAAC,CAAC,CAAC,KAAG,GAAG,CAAC,OAwLpE,CAAA"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Solid ranked search results — the counterpart of
3
+ * `@molecule/app-search-ui-react`'s `SearchResults`.
4
+ *
5
+ * @module
6
+ */
7
+ import { createEffect, For, Show } from 'solid-js';
8
+ import { useTranslation } from '@molecule/app-solid';
9
+ import { getClassMap } from '@molecule/app-ui';
10
+ import { Highlight } from './Highlight.jsx';
11
+ /**
12
+ * The default row link: a plain anchor. Apps pass a router link instead; the
13
+ * opaque `state` is theirs to consume and never reaches the DOM.
14
+ *
15
+ * @param linkProps - The link props.
16
+ * @returns The anchor.
17
+ */
18
+ const defaultLink = (linkProps) => {
19
+ const { state: _state, children, className, ...rest } = linkProps;
20
+ return (<a {...rest} class={className}>
21
+ {children}
22
+ </a>);
23
+ };
24
+ /**
25
+ * The ranked hits: title and description with the matched terms marked, the
26
+ * meta line, hover making a row active and warming its page. The whole row is
27
+ * the link, so the list is a plain list of links (no listbox roles: an
28
+ * option's children are presentational and would hide the row's link and
29
+ * action); the active row is marked with `aria-current` on its `<li>` and
30
+ * announced through a polite, visually hidden status region after the list.
31
+ *
32
+ * React keys each row by the hit's `id` value, so a re-passed or re-ordered
33
+ * array keeps the rendered rows per id. Solid's `For` keys by reference, so
34
+ * the rows are keyed through stable per-id records: the record for an id is
35
+ * created once and reused, while the row's content reads the CURRENT hit for
36
+ * that id reactively.
37
+ *
38
+ * @param props - See {@link SearchResultsProps}.
39
+ * @returns The list, or the empty state.
40
+ */
41
+ export const SearchResults = (props) => {
42
+ const cm = getClassMap();
43
+ const { t } = useTranslation();
44
+ // React's default parameter: the ids carry the `search` prefix unless overridden.
45
+ const molId = () => props.molId ?? 'search';
46
+ let listRef;
47
+ /**
48
+ * Assigns the list element, as React's `ref` does.
49
+ *
50
+ * @param el - The list element.
51
+ */
52
+ const listRefFn = (el) => {
53
+ listRef = el;
54
+ };
55
+ // Keep the keyboard-active row in view.
56
+ createEffect(() => {
57
+ const index = props.activeIndex;
58
+ if (index < 0)
59
+ return;
60
+ const el = listRef?.querySelector(`[data-index="${index}"]`);
61
+ el?.scrollIntoView?.({ block: 'nearest' });
62
+ });
63
+ const records = new Map();
64
+ const keyedHits = () => {
65
+ const seen = new Set();
66
+ const rows = props.hits.map((hit) => {
67
+ seen.add(hit.id);
68
+ let row = records.get(hit.id);
69
+ if (!row) {
70
+ row = { id: hit.id };
71
+ records.set(hit.id, row);
72
+ }
73
+ return row;
74
+ });
75
+ for (const id of [...records.keys()])
76
+ if (!seen.has(id))
77
+ records.delete(id);
78
+ return rows;
79
+ };
80
+ const hitFor = (id) => props.hits.find((hit) => hit.id === id);
81
+ /**
82
+ * The active row's announcement; empty when no row is keyboard-active.
83
+ *
84
+ * @returns The status text.
85
+ */
86
+ const activeText = () => {
87
+ const hit = props.activeIndex >= 0 ? props.hits[props.activeIndex] : undefined;
88
+ if (!hit)
89
+ return '';
90
+ return t('searchUi.activeResult', {
91
+ title: props.view(hit.doc).title,
92
+ position: props.activeIndex + 1,
93
+ count: props.hits.length,
94
+ }, { defaultValue: '{{title}}, {{position}} of {{count}}' });
95
+ };
96
+ /**
97
+ * Builds the row body the link carries: the title and meta line, then the
98
+ * description, with the matched terms marked.
99
+ *
100
+ * @param hit - The hit.
101
+ * @param v - The hit's view.
102
+ * @returns The body.
103
+ */
104
+ const bodyOf = (hit, v) => {
105
+ const meta = [...(v.meta ?? [])];
106
+ return (<>
107
+ <span class={cm.flex({ align: 'baseline', wrap: 'wrap', gap: 2 })}>
108
+ <span class={cm.cn(cm.resultTitle, v.mono && cm.resultTitleMono)}>
109
+ <Highlight text={v.title} terms={hit.terms}/>
110
+ </span>
111
+ {meta.length ? <span class={cm.resultMeta}>{meta.join(' · ')}</span> : null}
112
+ {hit.related ? (<span class={cm.resultMeta} data-mol-id={`${molId()}-related`} title={t('searchUi.relatedTitle', undefined, {
113
+ defaultValue: 'Matches the meaning of your search, not its words',
114
+ })}>
115
+ {t('searchUi.related', undefined, { defaultValue: 'related' })}
116
+ </span>) : null}
117
+ </span>
118
+ {v.description ? (<span class={cm.cn(cm.resultDescription, cm.displayBlock)}>
119
+ <Highlight text={v.description} terms={hit.terms}/>
120
+ </span>) : null}
121
+ </>);
122
+ };
123
+ /**
124
+ * Builds the link props one row's link gets, closing over the hit so a
125
+ * plain click opens it.
126
+ *
127
+ * @param hit - The hit.
128
+ * @param v - The hit's view.
129
+ * @returns The link props.
130
+ */
131
+ const linkPropsOf = (hit, v) => ({
132
+ href: v.href,
133
+ state: v.state,
134
+ className: cm.resultBody,
135
+ 'data-mol-id': `${molId()}-link`,
136
+ children: bodyOf(hit, v),
137
+ onClick: (event) => {
138
+ // A modified click opens a new tab; the router handles the rest.
139
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0)
140
+ return;
141
+ event.preventDefault();
142
+ props.onOpen(hit.doc);
143
+ },
144
+ });
145
+ return (<Show when={props.hits.length === 0} fallback={<>
146
+ <ul ref={listRefFn} aria-label={t('searchUi.results', undefined, { defaultValue: 'Search results' })} class={cm.cn(cm.resultList, props.className)} data-mol-id={`${molId()}-results`}>
147
+ <For each={keyedHits()}>
148
+ {(row) => {
149
+ const index = () => props.hits.findIndex((h) => h.id === row.id);
150
+ const hit = () => hitFor(row.id);
151
+ const v = () => props.view(hit().doc);
152
+ return (<li aria-current={index() === props.activeIndex ? 'true' : undefined} data-index={index()} data-mol-id={`${molId()}-hit`} data-hit-id={row.id} class={cm.cn(cm.resultItem, index() === props.activeIndex && cm.resultItemActive)} onPointerOver={() => {
153
+ props.onActivate?.(index());
154
+ props.onPrefetch?.(hit().doc);
155
+ }} onFocusIn={() => props.onPrefetch?.(hit().doc)} onTouchStart={() => props.onPrefetch?.(hit().doc)}>
156
+ {props.renderLink
157
+ ? props.renderLink(linkPropsOf(hit(), v()))
158
+ : defaultLink(linkPropsOf(hit(), v()))}
159
+ {props.action ? (<span class={cm.resultAction}>{props.action(hit().doc)}</span>) : null}
160
+ </li>);
161
+ }}
162
+ </For>
163
+ </ul>
164
+ <p role="status" class={cm.srOnly} data-mol-id={`${molId()}-active`}>
165
+ {activeText()}
166
+ </p>
167
+ </>}>
168
+ <>
169
+ <p class={cm.resultEmpty} data-mol-id={`${molId()}-empty`}>
170
+ {props.emptyText}
171
+ </p>
172
+ {/* The status region exists before results arrive, so it is live. */}
173
+ <p role="status" class={cm.srOnly} data-mol-id={`${molId()}-active`}/>
174
+ </>
175
+ </Show>);
176
+ };
177
+ //# sourceMappingURL=SearchResults.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchResults.jsx","sourceRoot":"","sources":["../src/SearchResults.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,GAAG,EAAY,IAAI,EAAE,MAAM,UAAU,CAAA;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,CAAC,SAAgC,EAAe,EAAE;IACpE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,CAAA;IACjE,OAAO,CACL,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,CAAC,CAAC,CACL,CAAA;AACH,CAAC,CAAA;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAK,KAA4B,EAAe,EAAE;IAC7E,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,kFAAkF;IAClF,MAAM,KAAK,GAAG,GAAW,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAA;IACnD,IAAI,OAAqC,CAAA;IAEzC;;;;OAIG;IACH,MAAM,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AAC,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CACxC;oBAAA,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACd,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAC/D,CAAC,CAAC,CAAC,IAAI,CACV;kBAAA,EAAE,EAAE,CAAC,CACN,CAAA;YACH,CAAC,CACH;YAAA,EAAE,GAAG,CACP;UAAA,EAAE,EAAE,CACJ;UAAA,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC,CAClE;YAAA,CAAC,UAAU,EAAE,CACf;UAAA,EAAE,CAAC,CACL;QAAA,GACF,CAAC,CAED;MAAA,EACE;QAAA,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC,CACxD;UAAA,CAAC,KAAK,CAAC,SAAS,CAClB;QAAA,EAAE,CAAC,CACH;QAAA,CAAC,oEAAoE,CACrE;QAAA,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC,EACtE;MAAA,GACF;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Solid search UI for `@molecule/app-client-search`.
3
+ *
4
+ * The Solid counterpart of `@molecule/app-search-ui-react` — the same props
5
+ * (React names) and the same DOM for the same input. Three pieces that fit a
6
+ * `useSearchSession` from `@molecule/app-client-search-solid`:
7
+ * {@link SearchBox} (the field, its clear button and shortcut cap, a help icon
8
+ * whose tooltip shows the search syntax, an `afterField` slot for the
9
+ * consumer's own tabs, the active filter chips and the hit count),
10
+ * {@link SearchResults} (ranked rows with the matched terms marked, hover
11
+ * prefetch, an optional action per row; the keyboard-active row is marked with
12
+ * `aria-current` and announced through a polite status region), and
13
+ * {@link QuickSearchDialog} (both in a `mod+k` dialog named for screen readers
14
+ * by its `label`, "Search" by default). Every class comes from
15
+ * the ClassMap's search tokens (`searchField`, `resultList`, …), so a UI bond
16
+ * restyles all of it at once.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { Link, useTranslation } from '@molecule/app-solid'
21
+ * import { useSearchSession } from '@molecule/app-client-search-solid'
22
+ * import { SearchBox, SearchResults } from '@molecule/app-search-ui-solid'
23
+ * import type { SearchResultLinkProps } from '@molecule/app-search-ui-solid'
24
+ *
25
+ * function Catalog() {
26
+ * const { t } = useTranslation()
27
+ * const session = useSearchSession({
28
+ * docs: packages,
29
+ * options: PACKAGE_INDEX_OPTIONS,
30
+ * rememberKey: 'catalog.search',
31
+ * onOpen: (p) => navigate(`/packages/${p.name}`),
32
+ * })
33
+ * const renderLink = (p: SearchResultLinkProps) => (
34
+ * <Link to={p.href} state={p.state} className={p.className} onClick={p.onClick} data-mol-id={p['data-mol-id']}>
35
+ * {p.children}
36
+ * </Link>
37
+ * )
38
+ * return (
39
+ * <>
40
+ * <SearchBox
41
+ * value={session.query()}
42
+ * onChange={session.setQuery}
43
+ * onKeyDown={session.onKeyDown}
44
+ * inputRef={session.inputRef}
45
+ * placeholder={t('catalog.search', undefined, { defaultValue: 'Search packages' })}
46
+ * count={session.hits().length}
47
+ * filters={session.parsed().filters}
48
+ * onRemoveFilter={session.removeFilter}
49
+ * onClear={session.clear}
50
+ * examples={['category:auth', 'type:bond']}
51
+ * />
52
+ * <SearchResults
53
+ * hits={session.hits()}
54
+ * view={(p) => ({ href: `/packages/${p.name}`, title: `@molecule/${p.name}`, description: p.description, meta: [p.type, p.category], mono: true })}
55
+ * activeIndex={session.activeIndex()}
56
+ * onActivate={session.setActiveIndex}
57
+ * onOpen={session.open}
58
+ * onPrefetch={session.prefetch}
59
+ * renderLink={renderLink}
60
+ * emptyText={t('catalog.empty', undefined, { defaultValue: 'Nothing matches' })}
61
+ * />
62
+ * </>
63
+ * )
64
+ * }
65
+ * ```
66
+ *
67
+ * (`searchPlaceholder` and `nothingMatches` are the app's own translated strings.)
68
+ *
69
+ * @remarks
70
+ * - **Pass a router link through `renderLink`**, or every row is a full page
71
+ * load: the list renders a plain `<a>` by default because it does not know
72
+ * your router. A plain click calls `onOpen` (which the session turns into
73
+ * navigation); a modified click is left to the browser so "open in new tab" works.
74
+ * - The box does not own the text: bind `value`/`onChange` to a session (or
75
+ * any state) and it stays mounted, with its text, across searches. Do not
76
+ * remount it per search.
77
+ * - `placeholder`, `emptyText` and the like are already-translated strings
78
+ * from the app; the package translates only its own chrome ("Clear
79
+ * search", "{{count}} results", "Search tips") through `@molecule/app-locales-search-ui`.
80
+ * - The quick dialog needs a session created with `syncUrl: false` and
81
+ * `onEscape: onClose`; the page's own session keeps the URL.
82
+ *
83
+ * @module
84
+ */
85
+ export * from './Highlight.jsx';
86
+ export * from './Kbd.jsx';
87
+ export * from './QuickSearchDialog.jsx';
88
+ export * from './SearchBox.jsx';
89
+ export * from './SearchResults.jsx';
90
+ export * from './types.js';
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Solid search UI for `@molecule/app-client-search`.
3
+ *
4
+ * The Solid counterpart of `@molecule/app-search-ui-react` — the same props
5
+ * (React names) and the same DOM for the same input. Three pieces that fit a
6
+ * `useSearchSession` from `@molecule/app-client-search-solid`:
7
+ * {@link SearchBox} (the field, its clear button and shortcut cap, a help icon
8
+ * whose tooltip shows the search syntax, an `afterField` slot for the
9
+ * consumer's own tabs, the active filter chips and the hit count),
10
+ * {@link SearchResults} (ranked rows with the matched terms marked, hover
11
+ * prefetch, an optional action per row; the keyboard-active row is marked with
12
+ * `aria-current` and announced through a polite status region), and
13
+ * {@link QuickSearchDialog} (both in a `mod+k` dialog named for screen readers
14
+ * by its `label`, "Search" by default). Every class comes from
15
+ * the ClassMap's search tokens (`searchField`, `resultList`, …), so a UI bond
16
+ * restyles all of it at once.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { Link, useTranslation } from '@molecule/app-solid'
21
+ * import { useSearchSession } from '@molecule/app-client-search-solid'
22
+ * import { SearchBox, SearchResults } from '@molecule/app-search-ui-solid'
23
+ * import type { SearchResultLinkProps } from '@molecule/app-search-ui-solid'
24
+ *
25
+ * function Catalog() {
26
+ * const { t } = useTranslation()
27
+ * const session = useSearchSession({
28
+ * docs: packages,
29
+ * options: PACKAGE_INDEX_OPTIONS,
30
+ * rememberKey: 'catalog.search',
31
+ * onOpen: (p) => navigate(`/packages/${p.name}`),
32
+ * })
33
+ * const renderLink = (p: SearchResultLinkProps) => (
34
+ * <Link to={p.href} state={p.state} className={p.className} onClick={p.onClick} data-mol-id={p['data-mol-id']}>
35
+ * {p.children}
36
+ * </Link>
37
+ * )
38
+ * return (
39
+ * <>
40
+ * <SearchBox
41
+ * value={session.query()}
42
+ * onChange={session.setQuery}
43
+ * onKeyDown={session.onKeyDown}
44
+ * inputRef={session.inputRef}
45
+ * placeholder={t('catalog.search', undefined, { defaultValue: 'Search packages' })}
46
+ * count={session.hits().length}
47
+ * filters={session.parsed().filters}
48
+ * onRemoveFilter={session.removeFilter}
49
+ * onClear={session.clear}
50
+ * examples={['category:auth', 'type:bond']}
51
+ * />
52
+ * <SearchResults
53
+ * hits={session.hits()}
54
+ * view={(p) => ({ href: `/packages/${p.name}`, title: `@molecule/${p.name}`, description: p.description, meta: [p.type, p.category], mono: true })}
55
+ * activeIndex={session.activeIndex()}
56
+ * onActivate={session.setActiveIndex}
57
+ * onOpen={session.open}
58
+ * onPrefetch={session.prefetch}
59
+ * renderLink={renderLink}
60
+ * emptyText={t('catalog.empty', undefined, { defaultValue: 'Nothing matches' })}
61
+ * />
62
+ * </>
63
+ * )
64
+ * }
65
+ * ```
66
+ *
67
+ * (`searchPlaceholder` and `nothingMatches` are the app's own translated strings.)
68
+ *
69
+ * @remarks
70
+ * - **Pass a router link through `renderLink`**, or every row is a full page
71
+ * load: the list renders a plain `<a>` by default because it does not know
72
+ * your router. A plain click calls `onOpen` (which the session turns into
73
+ * navigation); a modified click is left to the browser so "open in new tab" works.
74
+ * - The box does not own the text: bind `value`/`onChange` to a session (or
75
+ * any state) and it stays mounted, with its text, across searches. Do not
76
+ * remount it per search.
77
+ * - `placeholder`, `emptyText` and the like are already-translated strings
78
+ * from the app; the package translates only its own chrome ("Clear
79
+ * search", "{{count}} results", "Search tips") through `@molecule/app-locales-search-ui`.
80
+ * - The quick dialog needs a session created with `syncUrl: false` and
81
+ * `onEscape: onClose`; the page's own session keeps the URL.
82
+ *
83
+ * @module
84
+ */
85
+ export * from './Highlight.jsx';
86
+ export * from './Kbd.jsx';
87
+ export * from './QuickSearchDialog.jsx';
88
+ export * from './SearchBox.jsx';
89
+ export * from './SearchResults.jsx';
90
+ export * from './types.js';
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Types for the Solid search UI.
3
+ *
4
+ * Prop names are React's, so an app can switch framework by changing only the
5
+ * package name in its imports. Node-valued props (`children`, `afterField`)
6
+ * are `JSX.Element`; callbacks are plain functions; a render function
7
+ * (`renderLink`, `action`) returns `JSX.Element`.
8
+ *
9
+ * @module
10
+ */
11
+ import type { JSX } from 'solid-js';
12
+ import type { ClientSearchDocument, ClientSearchFilter } from '@molecule/app-client-search';
13
+ import type { SearchSession } from '@molecule/app-client-search-solid';
14
+ /** Props accepted by {@link Kbd}. */
15
+ export interface KbdProps {
16
+ /** The key or keys shown, e.g. `/`, `↵`, `esc`. */
17
+ children?: JSX.Element;
18
+ /** Extra classes composed onto the cap. */
19
+ className?: string;
20
+ }
21
+ /** Props for {@link Highlight}. */
22
+ export interface HighlightProps {
23
+ /** The text to show. */
24
+ text: string;
25
+ /** The matched terms to mark (a hit's `terms`). */
26
+ terms: string[];
27
+ }
28
+ /** Props accepted by {@link SearchBox}. */
29
+ export interface SearchBoxProps {
30
+ /** The text. */
31
+ value: string;
32
+ /** Called with the new text on every keystroke. */
33
+ onChange: (value: string) => void;
34
+ /** Key handling for the input (arrows, Enter, Escape), usually a session's `onKeyDown`. */
35
+ onKeyDown?: (event: KeyboardEvent) => void;
36
+ /** A ref to the input, so a shortcut can focus it. */
37
+ inputRef?: {
38
+ current: HTMLInputElement | null;
39
+ };
40
+ /** Placeholder, already translated. Also the accessible name unless `label` is given. */
41
+ placeholder: string;
42
+ /** Accessible name for the input, already translated. Defaults to `placeholder`. */
43
+ label?: string;
44
+ /** How many hits the current text has. Omit to show no count. */
45
+ count?: number;
46
+ /** Active `field:value` filters, shown as removable chips. */
47
+ filters?: ClientSearchFilter[];
48
+ /** Removes the i-th filter. */
49
+ onRemoveFilter?: (index: number) => void;
50
+ /** Clears the text. Shown as an × while there is text. */
51
+ onClear?: () => void;
52
+ /**
53
+ * Example tokens for the search tips, e.g. `['category:auth', 'type:bond']`.
54
+ * Given, a help icon sits inside the field and shows the syntax on hover or
55
+ * focus. Omit for no help icon.
56
+ */
57
+ examples?: string[];
58
+ /** The key that focuses the box, shown as a cap while it is empty. `null` hides it. Defaults to `/`. */
59
+ shortcut?: string | null;
60
+ /** Focus the input on mount. */
61
+ autoFocus?: boolean;
62
+ /**
63
+ * Rendered directly under the field, before the status row (chips and
64
+ * count), so a consumer can put its own controls — tabs, a scope switch —
65
+ * right below the input.
66
+ */
67
+ afterField?: JSX.Element;
68
+ /** `data-mol-id` prefix: `<molId>-input`, `-clear`, `-help`, `-filter`, `-count`. */
69
+ molId?: string;
70
+ /** Extra classes composed onto the field. */
71
+ className?: string;
72
+ }
73
+ /** What the list needs from a hit. A session's hits already have this shape. */
74
+ export interface SearchResultHit<T> {
75
+ id: string;
76
+ doc: T;
77
+ /** The matched terms, marked in the title and description. */
78
+ terms: string[];
79
+ /** Found by meaning rather than by the words typed. */
80
+ related?: boolean;
81
+ }
82
+ /** How one hit renders. */
83
+ export interface SearchResultView {
84
+ /** Where the row goes. */
85
+ href: string;
86
+ /** The row's title. */
87
+ title: string;
88
+ /** Under the title, clamped to two lines. */
89
+ description?: string;
90
+ /** Small facts after the title: type, category, source. */
91
+ meta?: string[];
92
+ /** Render the title in monospace (a package name). */
93
+ mono?: boolean;
94
+ /** Opaque data handed to `renderLink` (router state). */
95
+ state?: unknown;
96
+ }
97
+ /** Props the row's link gets; `renderLink` turns them into an element. */
98
+ export interface SearchResultLinkProps {
99
+ href: string;
100
+ className: string;
101
+ children: JSX.Element;
102
+ onClick: (event: MouseEvent) => void;
103
+ state?: unknown;
104
+ 'data-mol-id': string;
105
+ }
106
+ /** Props for {@link SearchResults}. */
107
+ export interface SearchResultsProps<T> {
108
+ hits: SearchResultHit<T>[];
109
+ /** How a hit renders. */
110
+ view: (doc: T) => SearchResultView;
111
+ /** The keyboard- or pointer-active row, or `-1`. */
112
+ activeIndex: number;
113
+ /** The pointer moved onto a row. */
114
+ onActivate?: (index: number) => void;
115
+ /** A row was chosen (a plain click, or Enter elsewhere). Navigation is the caller's. */
116
+ onOpen: (doc: T) => void;
117
+ /** The person is about to open a row (hover, focus, touch): warm its page. */
118
+ onPrefetch?: (doc: T) => void;
119
+ /**
120
+ * Renders the row's link. Defaults to a plain `<a>`; pass a router link to
121
+ * keep navigation client-side (spread `props` onto it; `state` is optional).
122
+ */
123
+ renderLink?: (props: SearchResultLinkProps) => JSX.Element;
124
+ /** Something at the row's end (an action button). */
125
+ action?: (doc: T) => JSX.Element;
126
+ /** Shown when there are no hits. */
127
+ emptyText: string;
128
+ /** `data-mol-id` prefix: `<molId>-results`, `-hit`, `-link`, `-related`, `-empty`, `-active`. */
129
+ molId?: string;
130
+ /** Extra classes composed onto the list. */
131
+ className?: string;
132
+ }
133
+ /** Props for {@link QuickSearchDialog}. */
134
+ export interface QuickSearchDialogProps<T extends ClientSearchDocument> {
135
+ /** Whether the dialog is open. Rendered only while open. */
136
+ open: boolean;
137
+ /** Close it (Escape with nothing typed, the overlay, or after opening a hit). */
138
+ onClose: () => void;
139
+ /** The search session (from `useSearchSession`), created with `syncUrl: false` and `onEscape: onClose`. */
140
+ session: SearchSession<T>;
141
+ /** How a hit renders. */
142
+ view: (doc: T) => SearchResultView;
143
+ /** Placeholder for the box, already translated. */
144
+ placeholder: string;
145
+ /** Example tokens for the tips line. */
146
+ examples?: string[];
147
+ /** Shown while the text matches nothing, already translated. */
148
+ emptyText: string;
149
+ /** Shown before anything is typed, already translated. Defaults to the empty text. */
150
+ idleText?: string;
151
+ /** Renders each row's link (a router link keeps navigation client-side). */
152
+ renderLink?: (props: SearchResultLinkProps) => JSX.Element;
153
+ /**
154
+ * The dialog's accessible name, already translated (like `placeholder`, it
155
+ * names nothing visible). Defaults to `t('searchUi.dialogLabel')`
156
+ * ("Search"); the field's placeholder already names the field.
157
+ */
158
+ label?: string;
159
+ /** `data-mol-id` prefix. Defaults to `quick-search`. */
160
+ molId?: string;
161
+ }
162
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEtE,qCAAqC;AACrC,MAAM,WAAW,QAAQ;IACvB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAC1C,sDAAsD;IACtD,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;KAAE,CAAA;IAC/C,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAA;IACnB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AO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IACzB,yBAAyB;IACzB,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,gBAAgB,CAAA;IAClC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;IACjB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,GAAG,CAAC,OAAO,CAAA;IAC1D;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
package/dist/types.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Types for the Solid search UI.
3
+ *
4
+ * Prop names are React's, so an app can switch framework by changing only the
5
+ * package name in its imports. Node-valued props (`children`, `afterField`)
6
+ * are `JSX.Element`; callbacks are plain functions; a render function
7
+ * (`renderLink`, `action`) returns `JSX.Element`.
8
+ *
9
+ * @module
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}