@ngrok/mantle 0.92.0 → 0.93.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/dist/agent.json +48 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/app-layout.js +1 -1
- package/dist/code-DUJzSl4K.js +1 -0
- package/dist/{code-block-Bqw9VyK_.d.ts → code-block-BGdV4Yty.d.ts} +1 -1
- package/dist/{code-block-CNR8NuNT.js → code-block-W3kWPxCJ.js} +1 -1
- package/dist/code-block.d.ts +1 -1
- package/dist/code-block.js +2 -2
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.js +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-qordIos1.js → dialog-7TUgiSzX.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BHBzCDSZ.js +1 -0
- package/dist/dropdown-menu.js +1 -1
- package/dist/field.d.ts +1 -0
- package/dist/field.js +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/layer-container-kEQiE4zV.js +1 -0
- package/dist/layer-container.d.ts +8 -1
- package/dist/layer-container.js +1 -1
- package/dist/llms.txt +5 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover-C96V8SXi.d.ts +1 -0
- package/dist/{popover-BCGCpwkK.js → popover-DxOqLKxy.js} +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +1 -1
- package/dist/primitive-Dz9Al-us.js +1 -0
- package/dist/query-filter.d.ts +399 -0
- package/dist/query-filter.js +1 -0
- package/dist/query.d.ts +688 -0
- package/dist/query.js +1 -0
- package/dist/sandbar.d.ts +6 -0
- package/dist/sandbar.js +1 -1
- package/dist/select-CAAYk4Yj.js +1 -0
- package/dist/select.js +1 -1
- package/dist/{sheet-C0QytOsE.js → sheet-CSJc_sB4.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/split-button.js +1 -1
- package/dist/suggestions-Ciz2vaJO.js +1 -0
- package/dist/suggestions-NkqYTT49.d.ts +261 -0
- package/dist/theme-switcher.js +1 -1
- package/dist/{tooltip-BwMlCD6k.js → tooltip-b6oiTaWq.js} +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.js +1 -1
- package/package.json +4 -2
- package/dist/dropdown-menu-CLHkKzhe.js +0 -1
- package/dist/layer-container-DLf-6eBz.js +0 -1
- package/dist/primitive-AGoxSJBI.js +0 -1
- package/dist/select-MjJMGqwP.js +0 -1
package/dist/query.d.ts
ADDED
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
+
import { o as WithValidation } from "./field-V_gnkcmN.js";
|
|
4
|
+
import { t as Popover } from "./popover-BfB2I9G0.js";
|
|
5
|
+
import { c as FilterGrammar, t as FilterSuggestion } from "./suggestions-NkqYTT49.js";
|
|
6
|
+
import { ComponentProps, ReactNode } from "react";
|
|
7
|
+
/**
|
|
8
|
+
* The props for `Query.Root`.
|
|
9
|
+
*/
|
|
10
|
+
type QueryRootProps<Item extends object> = Omit<ComponentProps<"div">, "defaultValue"> & WithAsChild & WithDataSlot & {
|
|
11
|
+
/**
|
|
12
|
+
* The grammar of this surface's filter language. Declare it as a module
|
|
13
|
+
* constant: the engine caches its alias tables per grammar object.
|
|
14
|
+
*/
|
|
15
|
+
grammar: FilterGrammar<Item>;
|
|
16
|
+
/**
|
|
17
|
+
* The unfiltered items, for the live match counts. Pass the same array the
|
|
18
|
+
* surface renders from. Omit when another system runs the query; the
|
|
19
|
+
* suggestions then carry no counts.
|
|
20
|
+
*/
|
|
21
|
+
items?: Item[];
|
|
22
|
+
/** The query, exactly as typed. The caller owns it; there is no uncontrolled form. */
|
|
23
|
+
value: string;
|
|
24
|
+
/** Called with the whole query on every edit, typed or inserted. */
|
|
25
|
+
onValueChange: (value: string) => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The row and the state owner of a query input. It renders a `div` that lays
|
|
29
|
+
* out the field and any actions in one row, and it owns the caret, the open
|
|
30
|
+
* state, and the active suggestion.
|
|
31
|
+
*
|
|
32
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryroot
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const [query, setQuery] = useState("");
|
|
37
|
+
*
|
|
38
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
39
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
40
|
+
* <Query.Content>
|
|
41
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
42
|
+
* <Query.Empty />
|
|
43
|
+
* <Query.Footer>
|
|
44
|
+
* <Query.Legend />
|
|
45
|
+
* <Query.KeyboardHints />
|
|
46
|
+
* </Query.Footer>
|
|
47
|
+
* </Query.Content>
|
|
48
|
+
* </Query.Root>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare function Root<Item extends object>({ "data-slot": dataSlot, asChild, children, className, grammar, items, onValueChange, value, ...props }: QueryRootProps<Item>): import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* The props for `Query.Input`.
|
|
54
|
+
*/
|
|
55
|
+
type QueryInputProps = Omit<ComponentProps<"input">, "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-expanded" | "autoComplete" | "children" | "defaultValue" | "list" | "multiple" | "onChange" | "placeholder" | "role" | "type" | "value"> & WithValidation & WithDataSlot & {
|
|
56
|
+
/**
|
|
57
|
+
* Inline actions inside the field at its right edge, before the clear
|
|
58
|
+
* button. Pass ghost `xs` icon buttons.
|
|
59
|
+
*/
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* The accessible name and tooltip of the clear button.
|
|
63
|
+
*
|
|
64
|
+
* @default "Clear filter"
|
|
65
|
+
*/
|
|
66
|
+
clearLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Called after the clear button empties the query. Use it for work that
|
|
69
|
+
* only a clear does, such as applying the empty query at once.
|
|
70
|
+
*/
|
|
71
|
+
onClear?: () => void;
|
|
72
|
+
/** Placeholder copy. Name one example filter the grammar accepts. Required on purpose. */
|
|
73
|
+
placeholder: string;
|
|
74
|
+
/**
|
|
75
|
+
* Whether focus alone opens the suggestions. Set `false` when the host
|
|
76
|
+
* moves focus into the field for the user, as on a dialog open. The list
|
|
77
|
+
* then waits for a click, a keystroke, or an arrow key.
|
|
78
|
+
*
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
suggestOnFocus?: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* The query field: a real `<input role="combobox">` painted over by a colored
|
|
85
|
+
* copy of its own text, with a leading magnifier. The caret, the selection,
|
|
86
|
+
* IME composition, paste, and undo stay native, because the text the user
|
|
87
|
+
* edits is a plain `<input>`, not a contenteditable.
|
|
88
|
+
*
|
|
89
|
+
* `className` and `style` go to the field's outer element, as on `Input`.
|
|
90
|
+
* All other props, such as `ref`, `id`, `name`, `disabled`, `required`,
|
|
91
|
+
* `readOnly`, the `aria-*` props, and the event handlers, go to the
|
|
92
|
+
* `<input>`. A disabled or read-only field shows no suggestions. Inside
|
|
93
|
+
* `Field.Item`, the field reads its `id`, `name`, `aria-describedby`,
|
|
94
|
+
* `aria-errormessage`, and `aria-invalid` from `Field.Control`. While the
|
|
95
|
+
* suggestions show, `Query.Footer` joins the `<input>`'s description.
|
|
96
|
+
*
|
|
97
|
+
* While the query has text and the field is editable, a clear button shows
|
|
98
|
+
* at the right edge. It empties the query and moves focus back to the field.
|
|
99
|
+
* Children render after the text as inline actions, before the clear button,
|
|
100
|
+
* in a `[data-slot="query-input-actions"]` wrapper with `display: contents`.
|
|
101
|
+
* The clear button sits after that wrapper, not inside it.
|
|
102
|
+
*
|
|
103
|
+
* **CSS variables:**
|
|
104
|
+
*
|
|
105
|
+
* | CSS Variable | Default | Description |
|
|
106
|
+
* | ------------------------ | ------------------------------ | ------------------------------- |
|
|
107
|
+
* | `--query-key-color` | `var(--shiki-token-attribute)` | The color of a qualifier key. |
|
|
108
|
+
* | `--query-value-color` | `var(--shiki-token-string)` | The color of a qualifier value. |
|
|
109
|
+
* | `--query-operator-color` | `var(--shiki-token-operator)` | The color of `OR` and `AND`. |
|
|
110
|
+
*
|
|
111
|
+
* **Data attributes:**
|
|
112
|
+
*
|
|
113
|
+
* | Attribute | Value | Description |
|
|
114
|
+
* | ----------------- | -------------------------------------- | -------------------------------------------- |
|
|
115
|
+
* | `data-slot` | `"query-input"` | On the field's outer element. |
|
|
116
|
+
* | `data-slot` | `"query-input-actions"` | On the `span` that wraps the children. |
|
|
117
|
+
* | `data-slot` | `"input"` | On the field's chrome, as on `Input`. |
|
|
118
|
+
* | `data-disabled` | present | On the chrome while the field is disabled. |
|
|
119
|
+
* | `data-validation` | `"error"` \| `"success"` \| `"warning"` | On the chrome. Omitted when unset. |
|
|
120
|
+
*
|
|
121
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryinput
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* const [query, setQuery] = useState("");
|
|
126
|
+
*
|
|
127
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
128
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
129
|
+
* <Query.Content>
|
|
130
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
131
|
+
* <Query.Empty />
|
|
132
|
+
* <Query.Footer>
|
|
133
|
+
* <Query.Legend />
|
|
134
|
+
* <Query.KeyboardHints />
|
|
135
|
+
* </Query.Footer>
|
|
136
|
+
* </Query.Content>
|
|
137
|
+
* </Query.Root>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare function Input({ "aria-describedby": describedBy, "aria-errormessage": errorMessage, "aria-invalid": invalid, "data-slot": dataSlot, children, className, clearLabel, disabled, id, name, onBlur, onClear, onClick, onFocus, onKeyDown, onScroll, onSelect, placeholder, readOnly, ref, style, suggestOnFocus, ...props }: QueryInputProps): import("react").JSX.Element;
|
|
141
|
+
/**
|
|
142
|
+
* The props for `Query.Content`.
|
|
143
|
+
*/
|
|
144
|
+
type QueryContentProps = Omit<ComponentProps<typeof Popover.Content>, "align" | "asChild" | "children" | "onCloseAutoFocus" | "onInteractOutside" | "onOpenAutoFocus" | "preferredWidth" | "role"> & WithDataSlot & {
|
|
145
|
+
/** The parts of the popover: `Query.List`, `Query.Empty`, and `Query.Footer`. */
|
|
146
|
+
children: ReactNode;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* The suggestion popover. It holds the parts you compose into it, and it
|
|
150
|
+
* keeps focus in the field: the active row is announced through
|
|
151
|
+
* `aria-activedescendant`. It accepts the `Popover.Content` props except the
|
|
152
|
+
* ones it owns.
|
|
153
|
+
*
|
|
154
|
+
* **Data attributes:**
|
|
155
|
+
*
|
|
156
|
+
* | Attribute | Value | Description |
|
|
157
|
+
* | ------------ | ---------------------- | ------------------------------------------- |
|
|
158
|
+
* | `data-slot` | `"query-content"` | On the popover, beside `"popover-content"`. |
|
|
159
|
+
* | `data-state` | `"open"` \| `"closed"` | On the popover, from Radix. |
|
|
160
|
+
* | `data-side` | `"top"` \| `"bottom"` | On the popover: the side it opened on. |
|
|
161
|
+
* | `data-align` | `"start"` | On the popover. |
|
|
162
|
+
*
|
|
163
|
+
* @see https://mantle.ngrok.com/components/forms/query#querycontent
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* const [query, setQuery] = useState("");
|
|
168
|
+
*
|
|
169
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
170
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
171
|
+
* <Query.Content>
|
|
172
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
173
|
+
* <Query.Empty />
|
|
174
|
+
* <Query.Footer>
|
|
175
|
+
* <Query.Legend />
|
|
176
|
+
* <Query.KeyboardHints />
|
|
177
|
+
* </Query.Footer>
|
|
178
|
+
* </Query.Content>
|
|
179
|
+
* </Query.Root>
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare function Content({ "data-slot": dataSlot, children, className, ref, ...props }: QueryContentProps): import("react").JSX.Element;
|
|
183
|
+
/**
|
|
184
|
+
* The props for `Query.List`.
|
|
185
|
+
*/
|
|
186
|
+
type QueryListProps = Omit<ComponentProps<"div">, "children" | "id" | "role"> & WithDataSlot & {
|
|
187
|
+
/**
|
|
188
|
+
* Renders one suggestion. Return a `Query.Item` for it, and do not skip a
|
|
189
|
+
* suggestion: the arrow keys move through every one. The list calls it for
|
|
190
|
+
* each suggestion under the caret, in order.
|
|
191
|
+
*/
|
|
192
|
+
children: (suggestion: FilterSuggestion) => ReactNode;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The suggestion listbox for the token under the caret. It groups the rows
|
|
196
|
+
* under "Filter by", "Exclude", and "Values", and it scrolls when the rows
|
|
197
|
+
* do not fit. `aria-label` names the listbox and defaults to
|
|
198
|
+
* `"Filter suggestions"`.
|
|
199
|
+
*
|
|
200
|
+
* **Data attributes:**
|
|
201
|
+
*
|
|
202
|
+
* | Attribute | Value | Description |
|
|
203
|
+
* | ----------- | -------------- | -------------------- |
|
|
204
|
+
* | `data-slot` | `"query-list"` | On the listbox. |
|
|
205
|
+
*
|
|
206
|
+
* @see https://mantle.ngrok.com/components/forms/query#querylist
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```tsx
|
|
210
|
+
* const [query, setQuery] = useState("");
|
|
211
|
+
*
|
|
212
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
213
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
214
|
+
* <Query.Content>
|
|
215
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
216
|
+
* <Query.Empty />
|
|
217
|
+
* <Query.Footer>
|
|
218
|
+
* <Query.Legend />
|
|
219
|
+
* <Query.KeyboardHints />
|
|
220
|
+
* </Query.Footer>
|
|
221
|
+
* </Query.Content>
|
|
222
|
+
* </Query.Root>
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
declare function List({ "data-slot": dataSlot, children, className, ...props }: QueryListProps): import("react").JSX.Element;
|
|
226
|
+
/**
|
|
227
|
+
* The props for `Query.Item`.
|
|
228
|
+
*/
|
|
229
|
+
type QueryItemProps = Omit<ComponentProps<"div">, "aria-selected" | "id" | "role" | "tabIndex"> & WithDataSlot & {
|
|
230
|
+
/** The suggestion this row inserts. Pass the one `Query.List` hands its render function. */
|
|
231
|
+
suggestion: FilterSuggestion;
|
|
232
|
+
/**
|
|
233
|
+
* The row's content. When omitted, the row shows the suggestion's label,
|
|
234
|
+
* its description, and its match count.
|
|
235
|
+
*/
|
|
236
|
+
children?: ReactNode;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* One suggestion row: a `role="option"` that inserts its suggestion on a
|
|
240
|
+
* click. The arrow keys in the field make a row active, and Enter inserts it.
|
|
241
|
+
* A click keeps focus and the caret in the field.
|
|
242
|
+
*
|
|
243
|
+
* **Data attributes:**
|
|
244
|
+
*
|
|
245
|
+
* | Attribute | Value | Description |
|
|
246
|
+
* | ------------------ | -------------- | ----------------------------------------------------------------- |
|
|
247
|
+
* | `data-slot` | `"query-item"` | On the option. |
|
|
248
|
+
* | `data-highlighted` | present | While the row is active, or under the pointer with no active row. |
|
|
249
|
+
*
|
|
250
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryitem
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```tsx
|
|
254
|
+
* const [query, setQuery] = useState("");
|
|
255
|
+
*
|
|
256
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
257
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
258
|
+
* <Query.Content>
|
|
259
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
260
|
+
* <Query.Empty />
|
|
261
|
+
* <Query.Footer>
|
|
262
|
+
* <Query.Legend />
|
|
263
|
+
* <Query.KeyboardHints />
|
|
264
|
+
* </Query.Footer>
|
|
265
|
+
* </Query.Content>
|
|
266
|
+
* </Query.Root>
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
declare function Item({ "data-slot": dataSlot, children, className, onClick, onMouseDown, onMouseLeave, onMouseMove, ref, suggestion, ...props }: QueryItemProps): import("react").JSX.Element;
|
|
270
|
+
/**
|
|
271
|
+
* The props for `Query.Empty`.
|
|
272
|
+
*/
|
|
273
|
+
type QueryEmptyProps = Omit<ComponentProps<"div">, "id"> & WithDataSlot & {
|
|
274
|
+
/**
|
|
275
|
+
* The message. When omitted, the part says what the field accepts at the
|
|
276
|
+
* caret, from the grammar.
|
|
277
|
+
*/
|
|
278
|
+
children?: ReactNode;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* The message that shows in place of the rows when no suggestion matches. The
|
|
282
|
+
* popover stays open, so a free-text value or a typo does not leave the user
|
|
283
|
+
* with only the legend. While it shows, it joins the `<input>`'s description.
|
|
284
|
+
*
|
|
285
|
+
* **Data attributes:**
|
|
286
|
+
*
|
|
287
|
+
* | Attribute | Value | Description |
|
|
288
|
+
* | ----------- | --------------- | ---------------- |
|
|
289
|
+
* | `data-slot` | `"query-empty"` | On the message. |
|
|
290
|
+
*
|
|
291
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryempty
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```tsx
|
|
295
|
+
* const [query, setQuery] = useState("");
|
|
296
|
+
*
|
|
297
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
298
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
299
|
+
* <Query.Content>
|
|
300
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
301
|
+
* <Query.Empty />
|
|
302
|
+
* <Query.Footer>
|
|
303
|
+
* <Query.Legend />
|
|
304
|
+
* <Query.KeyboardHints />
|
|
305
|
+
* </Query.Footer>
|
|
306
|
+
* </Query.Content>
|
|
307
|
+
* </Query.Root>
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
declare function Empty({ "data-slot": dataSlot, children, className, ...props }: QueryEmptyProps): import("react").JSX.Element | null;
|
|
311
|
+
/**
|
|
312
|
+
* The props for `Query.Footer`.
|
|
313
|
+
*/
|
|
314
|
+
type QueryFooterProps = Omit<ComponentProps<"div">, "id"> & WithAsChild & WithDataSlot;
|
|
315
|
+
/**
|
|
316
|
+
* The area under the rows, pinned while the rows scroll. Compose
|
|
317
|
+
* `Query.Legend`, `Query.KeyboardHints`, and your own content, such as a link
|
|
318
|
+
* to the filter docs. While the popover is open, the footer joins the
|
|
319
|
+
* `<input>`'s description. With `asChild`, the footer replaces the child's `id`
|
|
320
|
+
* with its own, so the description keeps its link.
|
|
321
|
+
*
|
|
322
|
+
* **Data attributes:**
|
|
323
|
+
*
|
|
324
|
+
* | Attribute | Value | Description |
|
|
325
|
+
* | ----------- | ---------------- | --------------- |
|
|
326
|
+
* | `data-slot` | `"query-footer"` | On the footer. |
|
|
327
|
+
*
|
|
328
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryfooter
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```tsx
|
|
332
|
+
* const [query, setQuery] = useState("");
|
|
333
|
+
*
|
|
334
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
335
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
336
|
+
* <Query.Content>
|
|
337
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
338
|
+
* <Query.Empty />
|
|
339
|
+
* <Query.Footer>
|
|
340
|
+
* <Query.Legend />
|
|
341
|
+
* <Query.KeyboardHints />
|
|
342
|
+
* </Query.Footer>
|
|
343
|
+
* </Query.Content>
|
|
344
|
+
* </Query.Root>
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
declare function Footer({ "data-slot": dataSlot, asChild, children, className, ...props }: QueryFooterProps): import("react").JSX.Element;
|
|
348
|
+
/**
|
|
349
|
+
* The props for `Query.Legend`.
|
|
350
|
+
*/
|
|
351
|
+
type QueryLegendProps = Omit<ComponentProps<"p">, "children"> & WithDataSlot;
|
|
352
|
+
/**
|
|
353
|
+
* The syntax reminder. It describes only what the grammar honors, so a
|
|
354
|
+
* remote grammar never advertises an `OR` its executor refuses.
|
|
355
|
+
*
|
|
356
|
+
* **Data attributes:**
|
|
357
|
+
*
|
|
358
|
+
* | Attribute | Value | Description |
|
|
359
|
+
* | ----------- | ---------------- | --------------- |
|
|
360
|
+
* | `data-slot` | `"query-legend"` | On the legend. |
|
|
361
|
+
*
|
|
362
|
+
* @see https://mantle.ngrok.com/components/forms/query#querylegend
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```tsx
|
|
366
|
+
* const [query, setQuery] = useState("");
|
|
367
|
+
*
|
|
368
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
369
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
370
|
+
* <Query.Content>
|
|
371
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
372
|
+
* <Query.Empty />
|
|
373
|
+
* <Query.Footer>
|
|
374
|
+
* <Query.Legend />
|
|
375
|
+
* <Query.KeyboardHints />
|
|
376
|
+
* </Query.Footer>
|
|
377
|
+
* </Query.Content>
|
|
378
|
+
* </Query.Root>
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
declare function Legend({ "data-slot": dataSlot, className, ...props }: QueryLegendProps): import("react").JSX.Element;
|
|
382
|
+
/**
|
|
383
|
+
* The props for `Query.KeyboardHints`.
|
|
384
|
+
*/
|
|
385
|
+
type QueryKeyboardHintsProps = Omit<ComponentProps<"p">, "children"> & WithDataSlot & {
|
|
386
|
+
/**
|
|
387
|
+
* What Enter does. Name the host's own action when Enter submits a form,
|
|
388
|
+
* such as `"select, or search"`.
|
|
389
|
+
*
|
|
390
|
+
* @default "select"
|
|
391
|
+
*/
|
|
392
|
+
enterHint?: string;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* The keys the field answers to: the arrows, Enter, and Escape.
|
|
396
|
+
*
|
|
397
|
+
* **Data attributes:**
|
|
398
|
+
*
|
|
399
|
+
* | Attribute | Value | Description |
|
|
400
|
+
* | ----------- | ------------------------ | -------------- |
|
|
401
|
+
* | `data-slot` | `"query-keyboard-hints"` | On the hints. |
|
|
402
|
+
*
|
|
403
|
+
* @see https://mantle.ngrok.com/components/forms/query#querykeyboardhints
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```tsx
|
|
407
|
+
* const [query, setQuery] = useState("");
|
|
408
|
+
*
|
|
409
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
410
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
411
|
+
* <Query.Content>
|
|
412
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
413
|
+
* <Query.Empty />
|
|
414
|
+
* <Query.Footer>
|
|
415
|
+
* <Query.Legend />
|
|
416
|
+
* <Query.KeyboardHints />
|
|
417
|
+
* </Query.Footer>
|
|
418
|
+
* </Query.Content>
|
|
419
|
+
* </Query.Root>
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
declare function KeyboardHints({ "data-slot": dataSlot, className, enterHint, ...props }: QueryKeyboardHintsProps): import("react").JSX.Element;
|
|
423
|
+
/**
|
|
424
|
+
* A single-line filter field where free text and `key:value` qualifiers
|
|
425
|
+
* interleave. The tokens are colored in place, and a suggestion popover
|
|
426
|
+
* completes keys and values while the caret stays in the field. The grammar from
|
|
427
|
+
* `@ngrok/mantle/query-filter` decides the vocabulary.
|
|
428
|
+
*
|
|
429
|
+
* The typed string is the only state, and the caller owns it. Inside a
|
|
430
|
+
* `<form>`, Enter submits the form unless it accepts an active suggestion.
|
|
431
|
+
*
|
|
432
|
+
* @useWhen Filter a list with a typed query of free text and `key:value` qualifiers.
|
|
433
|
+
*
|
|
434
|
+
* @siblings
|
|
435
|
+
* - `Input`: a plain search box with no query language.
|
|
436
|
+
* - `Combobox`: pick one value from a filtered list of options.
|
|
437
|
+
* - `MultiSelect`: pick several values, shown as tags.
|
|
438
|
+
* - `Command`: a palette that runs an action or navigates.
|
|
439
|
+
*
|
|
440
|
+
* @see https://mantle.ngrok.com/components/forms/query
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* Composition:
|
|
444
|
+
* ```
|
|
445
|
+
* Query.Root
|
|
446
|
+
* ├── Query.Input
|
|
447
|
+
* └── Query.Content
|
|
448
|
+
* ├── Query.List
|
|
449
|
+
* │ └── Query.Item
|
|
450
|
+
* ├── Query.Empty
|
|
451
|
+
* └── Query.Footer
|
|
452
|
+
* ├── Query.Legend
|
|
453
|
+
* └── Query.KeyboardHints
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```tsx
|
|
458
|
+
* const [query, setQuery] = useState("");
|
|
459
|
+
*
|
|
460
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
461
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
462
|
+
* <Query.Content>
|
|
463
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
464
|
+
* <Query.Empty />
|
|
465
|
+
* <Query.Footer>
|
|
466
|
+
* <Query.Legend />
|
|
467
|
+
* <Query.KeyboardHints />
|
|
468
|
+
* </Query.Footer>
|
|
469
|
+
* </Query.Content>
|
|
470
|
+
* </Query.Root>
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
declare const Query: {
|
|
474
|
+
/**
|
|
475
|
+
* The row and the state owner of a query input. It renders a `div` that lays
|
|
476
|
+
* out the field and any actions in one row, and it owns the caret, the open
|
|
477
|
+
* state, and the active suggestion.
|
|
478
|
+
*
|
|
479
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryroot
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```tsx
|
|
483
|
+
* const [query, setQuery] = useState("");
|
|
484
|
+
*
|
|
485
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
486
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
487
|
+
* <Query.Content>
|
|
488
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
489
|
+
* <Query.Empty />
|
|
490
|
+
* <Query.Footer>
|
|
491
|
+
* <Query.Legend />
|
|
492
|
+
* <Query.KeyboardHints />
|
|
493
|
+
* </Query.Footer>
|
|
494
|
+
* </Query.Content>
|
|
495
|
+
* </Query.Root>
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
readonly Root: typeof Root;
|
|
499
|
+
/**
|
|
500
|
+
* The query field: a real `<input role="combobox">` painted over by a colored
|
|
501
|
+
* copy of its own text, with a leading magnifier and a clear button.
|
|
502
|
+
* Children render after the text as inline actions.
|
|
503
|
+
*
|
|
504
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryinput
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
* ```tsx
|
|
508
|
+
* const [query, setQuery] = useState("");
|
|
509
|
+
*
|
|
510
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
511
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
512
|
+
* <Query.Content>
|
|
513
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
514
|
+
* <Query.Empty />
|
|
515
|
+
* <Query.Footer>
|
|
516
|
+
* <Query.Legend />
|
|
517
|
+
* <Query.KeyboardHints />
|
|
518
|
+
* </Query.Footer>
|
|
519
|
+
* </Query.Content>
|
|
520
|
+
* </Query.Root>
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
readonly Input: typeof Input;
|
|
524
|
+
/**
|
|
525
|
+
* The suggestion popover. It holds the parts you compose into it, and it
|
|
526
|
+
* keeps focus in the field.
|
|
527
|
+
*
|
|
528
|
+
* @see https://mantle.ngrok.com/components/forms/query#querycontent
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* ```tsx
|
|
532
|
+
* const [query, setQuery] = useState("");
|
|
533
|
+
*
|
|
534
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
535
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
536
|
+
* <Query.Content>
|
|
537
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
538
|
+
* <Query.Empty />
|
|
539
|
+
* <Query.Footer>
|
|
540
|
+
* <Query.Legend />
|
|
541
|
+
* <Query.KeyboardHints />
|
|
542
|
+
* </Query.Footer>
|
|
543
|
+
* </Query.Content>
|
|
544
|
+
* </Query.Root>
|
|
545
|
+
* ```
|
|
546
|
+
*/
|
|
547
|
+
readonly Content: typeof Content;
|
|
548
|
+
/**
|
|
549
|
+
* The suggestion listbox for the token under the caret, grouped by section.
|
|
550
|
+
* Its children render one suggestion each.
|
|
551
|
+
*
|
|
552
|
+
* @see https://mantle.ngrok.com/components/forms/query#querylist
|
|
553
|
+
*
|
|
554
|
+
* @example
|
|
555
|
+
* ```tsx
|
|
556
|
+
* const [query, setQuery] = useState("");
|
|
557
|
+
*
|
|
558
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
559
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
560
|
+
* <Query.Content>
|
|
561
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
562
|
+
* <Query.Empty />
|
|
563
|
+
* <Query.Footer>
|
|
564
|
+
* <Query.Legend />
|
|
565
|
+
* <Query.KeyboardHints />
|
|
566
|
+
* </Query.Footer>
|
|
567
|
+
* </Query.Content>
|
|
568
|
+
* </Query.Root>
|
|
569
|
+
* ```
|
|
570
|
+
*/
|
|
571
|
+
readonly List: typeof List;
|
|
572
|
+
/**
|
|
573
|
+
* One suggestion row: a `role="option"` that inserts its suggestion on a click.
|
|
574
|
+
*
|
|
575
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryitem
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```tsx
|
|
579
|
+
* const [query, setQuery] = useState("");
|
|
580
|
+
*
|
|
581
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
582
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
583
|
+
* <Query.Content>
|
|
584
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
585
|
+
* <Query.Empty />
|
|
586
|
+
* <Query.Footer>
|
|
587
|
+
* <Query.Legend />
|
|
588
|
+
* <Query.KeyboardHints />
|
|
589
|
+
* </Query.Footer>
|
|
590
|
+
* </Query.Content>
|
|
591
|
+
* </Query.Root>
|
|
592
|
+
* ```
|
|
593
|
+
*/
|
|
594
|
+
readonly Item: typeof Item;
|
|
595
|
+
/**
|
|
596
|
+
* The message that shows in place of the rows when no suggestion matches.
|
|
597
|
+
*
|
|
598
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryempty
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```tsx
|
|
602
|
+
* const [query, setQuery] = useState("");
|
|
603
|
+
*
|
|
604
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
605
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
606
|
+
* <Query.Content>
|
|
607
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
608
|
+
* <Query.Empty />
|
|
609
|
+
* <Query.Footer>
|
|
610
|
+
* <Query.Legend />
|
|
611
|
+
* <Query.KeyboardHints />
|
|
612
|
+
* </Query.Footer>
|
|
613
|
+
* </Query.Content>
|
|
614
|
+
* </Query.Root>
|
|
615
|
+
* ```
|
|
616
|
+
*/
|
|
617
|
+
readonly Empty: typeof Empty;
|
|
618
|
+
/**
|
|
619
|
+
* The area under the rows, pinned while the rows scroll.
|
|
620
|
+
*
|
|
621
|
+
* @see https://mantle.ngrok.com/components/forms/query#queryfooter
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```tsx
|
|
625
|
+
* const [query, setQuery] = useState("");
|
|
626
|
+
*
|
|
627
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
628
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
629
|
+
* <Query.Content>
|
|
630
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
631
|
+
* <Query.Empty />
|
|
632
|
+
* <Query.Footer>
|
|
633
|
+
* <Query.Legend />
|
|
634
|
+
* <Query.KeyboardHints />
|
|
635
|
+
* </Query.Footer>
|
|
636
|
+
* </Query.Content>
|
|
637
|
+
* </Query.Root>
|
|
638
|
+
* ```
|
|
639
|
+
*/
|
|
640
|
+
readonly Footer: typeof Footer;
|
|
641
|
+
/**
|
|
642
|
+
* The syntax reminder. It describes only what the grammar honors.
|
|
643
|
+
*
|
|
644
|
+
* @see https://mantle.ngrok.com/components/forms/query#querylegend
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```tsx
|
|
648
|
+
* const [query, setQuery] = useState("");
|
|
649
|
+
*
|
|
650
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
651
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
652
|
+
* <Query.Content>
|
|
653
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
654
|
+
* <Query.Empty />
|
|
655
|
+
* <Query.Footer>
|
|
656
|
+
* <Query.Legend />
|
|
657
|
+
* <Query.KeyboardHints />
|
|
658
|
+
* </Query.Footer>
|
|
659
|
+
* </Query.Content>
|
|
660
|
+
* </Query.Root>
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
663
|
+
readonly Legend: typeof Legend;
|
|
664
|
+
/**
|
|
665
|
+
* The keys the field answers to: the arrows, Enter, and Escape.
|
|
666
|
+
*
|
|
667
|
+
* @see https://mantle.ngrok.com/components/forms/query#querykeyboardhints
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* ```tsx
|
|
671
|
+
* const [query, setQuery] = useState("");
|
|
672
|
+
*
|
|
673
|
+
* <Query.Root grammar={projectFilterGrammar} items={projects} value={query} onValueChange={setQuery}>
|
|
674
|
+
* <Query.Input aria-label="Filter projects" placeholder="Filter projects, or type a filter like is:shared" />
|
|
675
|
+
* <Query.Content>
|
|
676
|
+
* <Query.List>{(suggestion) => <Query.Item suggestion={suggestion} />}</Query.List>
|
|
677
|
+
* <Query.Empty />
|
|
678
|
+
* <Query.Footer>
|
|
679
|
+
* <Query.Legend />
|
|
680
|
+
* <Query.KeyboardHints />
|
|
681
|
+
* </Query.Footer>
|
|
682
|
+
* </Query.Content>
|
|
683
|
+
* </Query.Root>
|
|
684
|
+
* ```
|
|
685
|
+
*/
|
|
686
|
+
readonly KeyboardHints: typeof KeyboardHints;
|
|
687
|
+
};
|
|
688
|
+
export { Query, type QueryContentProps, type QueryEmptyProps, type QueryFooterProps, type QueryInputProps, type QueryItemProps, type QueryKeyboardHintsProps, type QueryLegendProps, type QueryListProps, type QueryRootProps };
|