@molecule/app-search-ui-solid 0.0.0-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.
- package/LICENSE +202 -0
- package/README.md +425 -2
- package/dist/Highlight.d.ts +17 -0
- package/dist/Highlight.d.ts.map +1 -0
- package/dist/Highlight.jsx +22 -0
- package/dist/Highlight.jsx.map +1 -0
- package/dist/Kbd.d.ts +17 -0
- package/dist/Kbd.d.ts.map +1 -0
- package/dist/Kbd.jsx +21 -0
- package/dist/Kbd.jsx.map +1 -0
- package/dist/QuickSearchDialog.d.ts +22 -0
- package/dist/QuickSearchDialog.d.ts.map +1 -0
- package/dist/QuickSearchDialog.jsx +68 -0
- package/dist/QuickSearchDialog.jsx.map +1 -0
- package/dist/SearchBox.d.ts +19 -0
- package/dist/SearchBox.d.ts.map +1 -0
- package/dist/SearchBox.jsx +168 -0
- package/dist/SearchBox.jsx.map +1 -0
- package/dist/SearchResults.d.ts +27 -0
- package/dist/SearchResults.d.ts.map +1 -0
- package/dist/SearchResults.jsx +177 -0
- package/dist/SearchResults.jsx.map +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +162 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/package.json +70 -4
package/dist/index.d.ts
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.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"}
|
package/dist/types.d.ts
ADDED
|
@@ -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,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-search-ui-solid",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Solid 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
|
+
"homepage": "https://www.molecule.dev/packages/app-search-ui-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",
|
|
28
|
+
"search-box",
|
|
29
|
+
"results",
|
|
30
|
+
"quick-search",
|
|
31
|
+
"solid"
|
|
32
|
+
],
|
|
33
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
38
|
+
"directory": "packages/app/features/search-ui-solid"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20"
|
|
42
|
+
},
|
|
43
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@molecule/app-client-search": "^1.0.0",
|
|
49
|
+
"@molecule/app-client-search-solid": "^1.0.0",
|
|
50
|
+
"@molecule/app-solid": "^3.5.0",
|
|
51
|
+
"@molecule/app-ui": "^1.3.3",
|
|
52
|
+
"@molecule/app-ui-solid": "^1.1.0",
|
|
53
|
+
"solid-js": "^1.8.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@molecule/app-client-search": "1.0.4",
|
|
57
|
+
"@molecule/app-client-search-minisearch": "1.0.4",
|
|
58
|
+
"@molecule/app-client-search-solid": "1.1.0",
|
|
59
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
60
|
+
"@molecule/app-i18n": "1.2.2",
|
|
61
|
+
"@molecule/app-icons": "1.0.4",
|
|
62
|
+
"@molecule/app-solid": "3.9.0",
|
|
63
|
+
"@molecule/app-ui": "1.5.0",
|
|
64
|
+
"@molecule/app-ui-solid": "1.2.1",
|
|
65
|
+
"@types/node": "26.6.5",
|
|
66
|
+
"jsdom": "30.1.3",
|
|
67
|
+
"solid-js": "1.9.17",
|
|
68
|
+
"typescript": "6.0.3",
|
|
69
|
+
"vite-plugin-solid": "2.11.15",
|
|
70
|
+
"vitest": "4.1.12"
|
|
71
|
+
}
|
|
72
|
+
}
|