@andesine/ui 0.4.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/solid/client/index.js +1354 -0
- package/dist/solid/server/index.js +1244 -0
- package/dist/solid/source/index.jsx +1166 -0
- package/dist/solid/types/index.d.ts +432 -0
- package/package.json +65 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { Accessor, ComponentProps, JSX as JSX$1, ParentComponent } from "solid-js";
|
|
2
|
+
import { Tabs as Tabs$1 } from "@ark-ui/solid/tabs";
|
|
3
|
+
//#region src/solid/navigation-tree/create-navigation-tree.d.ts
|
|
4
|
+
interface NavigationTreeItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
current?: boolean;
|
|
9
|
+
/** The item contains the current page. Active groups are always expanded on load. */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
children?: NavigationTreeItem[];
|
|
12
|
+
}
|
|
13
|
+
interface NavigationTreeOptions {
|
|
14
|
+
items: Accessor<NavigationTreeItem[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Keeps expanded groups in session storage, shared by trees with the same key, so the tree
|
|
17
|
+
* stays the same between pages.
|
|
18
|
+
*/
|
|
19
|
+
storageKey?: string;
|
|
20
|
+
/** Groups up to this depth start expanded, e.g. `2` for the first two levels. */
|
|
21
|
+
defaultDepth?: number;
|
|
22
|
+
}
|
|
23
|
+
interface NavigationTree$1 {
|
|
24
|
+
isExpanded(id: string): boolean;
|
|
25
|
+
setExpanded(id: string, expanded: boolean): void;
|
|
26
|
+
}
|
|
27
|
+
declare const createNavigationTree: (options: NavigationTreeOptions) => NavigationTree$1;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/solid/navigation-tree/navigation-tree.d.ts
|
|
30
|
+
interface RootProps$3 extends JSX$1.HTMLAttributes<HTMLElement> {
|
|
31
|
+
items: NavigationTreeItem[];
|
|
32
|
+
storageKey?: string;
|
|
33
|
+
/** Groups up to this depth start expanded. */
|
|
34
|
+
defaultDepth?: number;
|
|
35
|
+
}
|
|
36
|
+
interface ItemProps extends JSX$1.LiHTMLAttributes<HTMLLIElement> {
|
|
37
|
+
item: NavigationTreeItem;
|
|
38
|
+
}
|
|
39
|
+
declare const NavigationTree: {
|
|
40
|
+
Root: ParentComponent<RootProps$3>;
|
|
41
|
+
List: ParentComponent<JSX$1.HTMLAttributes<HTMLUListElement>>;
|
|
42
|
+
Item: ParentComponent<ItemProps>;
|
|
43
|
+
Link: ParentComponent<JSX$1.AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
44
|
+
GroupTrigger: ParentComponent<JSX$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
45
|
+
GroupContent: ParentComponent<JSX$1.HTMLAttributes<HTMLDivElement>>;
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/solid/table-of-contents/create-table-of-contents.d.ts
|
|
49
|
+
interface TableOfContentsOptions {
|
|
50
|
+
headingIDs: Accessor<string[]>;
|
|
51
|
+
}
|
|
52
|
+
interface TableOfContents$1 {
|
|
53
|
+
activeID: Accessor<string | undefined>;
|
|
54
|
+
/** Headings whose sections are in the viewport, below the sticky headers. */
|
|
55
|
+
visibleIDs: Accessor<string[]>;
|
|
56
|
+
/** Marks a heading as current until the user scrolls, e.g. after a link click. */
|
|
57
|
+
select(id: string): void;
|
|
58
|
+
}
|
|
59
|
+
declare const createTableOfContents: (options: TableOfContentsOptions) => TableOfContents$1;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/solid/table-of-contents/table-of-contents.d.ts
|
|
62
|
+
interface RootProps$2 extends JSX$1.HTMLAttributes<HTMLElement> {
|
|
63
|
+
headingIDs: string[];
|
|
64
|
+
}
|
|
65
|
+
interface LinkProps$1 extends Omit<JSX$1.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
|
|
66
|
+
headingID: string;
|
|
67
|
+
}
|
|
68
|
+
declare const useTableOfContents: () => TableOfContents$1;
|
|
69
|
+
declare const TableOfContents: {
|
|
70
|
+
Root: ParentComponent<RootProps$2>;
|
|
71
|
+
List: ParentComponent<JSX$1.HTMLAttributes<HTMLUListElement>>;
|
|
72
|
+
Item: ParentComponent<JSX$1.LiHTMLAttributes<HTMLLIElement>>;
|
|
73
|
+
Link: ParentComponent<LinkProps$1>;
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/solid/table-of-contents/create-table-of-contents-guide.d.ts
|
|
77
|
+
interface TableOfContentsGuideOptions {
|
|
78
|
+
ids: Accessor<string[]>;
|
|
79
|
+
/** The links to highlight, in outline order. */
|
|
80
|
+
highlightedIDs: Accessor<string[]>;
|
|
81
|
+
/** The x position of the guide line for each link. */
|
|
82
|
+
position(id: string): number;
|
|
83
|
+
/** Scrolled to keep the highlighted links in view, e.g. the viewport of a long outline. */
|
|
84
|
+
viewport?: Accessor<HTMLElement | undefined>;
|
|
85
|
+
/** Space between the guide's ends and each link's top and bottom, in pixels. */
|
|
86
|
+
inset?: number;
|
|
87
|
+
/** Corner radius of the backdrop, in pixels. */
|
|
88
|
+
radius?: number;
|
|
89
|
+
/** Points on the guide line along the backdrop's left edge. */
|
|
90
|
+
edgePoints?: number;
|
|
91
|
+
}
|
|
92
|
+
interface TableOfContentsGuide {
|
|
93
|
+
stroke: Accessor<TableOfContentsGuideStroke | undefined>;
|
|
94
|
+
trackRef(element: HTMLElement): void;
|
|
95
|
+
linkRef(id: string, element: HTMLElement): void;
|
|
96
|
+
pathRef(element: SVGPathElement): void;
|
|
97
|
+
}
|
|
98
|
+
interface TableOfContentsGuideShape {
|
|
99
|
+
path: string;
|
|
100
|
+
width: number;
|
|
101
|
+
/** The highlighted links, relative to the track; undefined when no link is highlighted. */
|
|
102
|
+
range?: TableOfContentsGuideRange;
|
|
103
|
+
}
|
|
104
|
+
interface TableOfContentsGuideStroke extends TableOfContentsGuideShape {
|
|
105
|
+
/** Dash offset and length that draw the highlighted part of the path. */
|
|
106
|
+
offset: number;
|
|
107
|
+
length: number;
|
|
108
|
+
total: number;
|
|
109
|
+
/**
|
|
110
|
+
* The highlighted area right of the guide line, with rounded corners. It always has the same
|
|
111
|
+
* commands, so CSS can animate it.
|
|
112
|
+
*/
|
|
113
|
+
backdrop?: string;
|
|
114
|
+
}
|
|
115
|
+
interface TableOfContentsGuideRange {
|
|
116
|
+
top: number;
|
|
117
|
+
height: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Measures one guide path through all table of contents links, with curves between depths, the
|
|
121
|
+
* dash that highlights a range of links, and a backdrop for that range.
|
|
122
|
+
*/
|
|
123
|
+
declare const createTableOfContentsGuide: (options: TableOfContentsGuideOptions) => TableOfContentsGuide;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/solid/mobile-navigation/enhance-mobile-navigation.d.ts
|
|
126
|
+
interface MobileNavigationOptions {
|
|
127
|
+
/** The menu works only while this media query matches, e.g. `(max-width: 767.9px)`. */
|
|
128
|
+
mediaQuery?: string;
|
|
129
|
+
/** Receives focus after a link to the current page closes the menu. */
|
|
130
|
+
navigationTarget?: () => HTMLElement | null;
|
|
131
|
+
onOpenChange?(open: boolean): void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Makes a server-rendered `<details>` menu modal: it traps focus, makes the rest of the page
|
|
135
|
+
* inert, locks scrolling, closes on Escape and on navigation, and restores focus.
|
|
136
|
+
* Returns a cleanup function.
|
|
137
|
+
*/
|
|
138
|
+
declare const enhanceMobileNavigation: (root: HTMLDetailsElement, options?: MobileNavigationOptions) => (() => void);
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/solid/mobile-navigation/mobile-navigation.d.ts
|
|
141
|
+
interface RootProps extends Omit<JSX$1.DetailsHtmlAttributes<HTMLDetailsElement>, "open">, MobileNavigationOptions {}
|
|
142
|
+
declare const MobileNavigation: {
|
|
143
|
+
Root: ParentComponent<RootProps>;
|
|
144
|
+
Trigger: ParentComponent<JSX$1.HTMLAttributes<HTMLElement>>;
|
|
145
|
+
Content: ParentComponent<JSX$1.HTMLAttributes<HTMLDivElement>>;
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/solid/breadcrumbs/index.d.ts
|
|
149
|
+
declare const Breadcrumbs: {
|
|
150
|
+
Root: ParentComponent<JSX$1.HTMLAttributes<HTMLElement>>;
|
|
151
|
+
List: ParentComponent<JSX$1.OlHTMLAttributes<HTMLOListElement>>;
|
|
152
|
+
Item: ParentComponent<JSX$1.LiHTMLAttributes<HTMLLIElement>>;
|
|
153
|
+
Link: ParentComponent<JSX$1.AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
154
|
+
Label: ParentComponent<JSX$1.HTMLAttributes<HTMLSpanElement>>;
|
|
155
|
+
Separator: ParentComponent<JSX$1.HTMLAttributes<HTMLSpanElement>>;
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/solid/pagination/index.d.ts
|
|
159
|
+
interface LinkProps extends JSX$1.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
160
|
+
direction: "previous" | "next";
|
|
161
|
+
}
|
|
162
|
+
declare const Pagination: {
|
|
163
|
+
Root: ParentComponent<JSX$1.HTMLAttributes<HTMLElement>>;
|
|
164
|
+
Link: ParentComponent<LinkProps>;
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/solid/tabs/tabs.d.ts
|
|
168
|
+
interface RootProps$1 extends Omit<ComponentProps<typeof Tabs$1.Root>, "value" | "defaultValue"> {
|
|
169
|
+
values: string[];
|
|
170
|
+
defaultValue?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Tabs with the same key share their selection, in this page and later pages. A group
|
|
173
|
+
* without the selected value keeps its own selection.
|
|
174
|
+
*/
|
|
175
|
+
syncKey?: string;
|
|
176
|
+
}
|
|
177
|
+
declare const Tabs: {
|
|
178
|
+
Root: ParentComponent<RootProps$1>;
|
|
179
|
+
List: (props: Tabs$1.ListProps) => import("solid-js").JSX.Element;
|
|
180
|
+
Trigger: (props: Tabs$1.TriggerProps) => import("solid-js").JSX.Element;
|
|
181
|
+
Content: (props: Tabs$1.ContentProps) => import("solid-js").JSX.Element;
|
|
182
|
+
Indicator: (props: Tabs$1.IndicatorProps) => import("solid-js").JSX.Element;
|
|
183
|
+
};
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/solid/clipboard/index.d.ts
|
|
186
|
+
interface Clipboard {
|
|
187
|
+
/** `true` after a copy, `false` after a failure, and `undefined` otherwise. */
|
|
188
|
+
status: Accessor<boolean | undefined>;
|
|
189
|
+
/** Copies text; pending text is still written during the click, e.g. text to fetch. */
|
|
190
|
+
copy(text: string | Promise<string>): Promise<void>;
|
|
191
|
+
}
|
|
192
|
+
/** Copies text, and reports the result for a short time. */
|
|
193
|
+
declare const createClipboard: (timeout?: number) => Clipboard;
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/solid/search/create-search.d.ts
|
|
196
|
+
interface SearchOptions<T> {
|
|
197
|
+
search(query: string, signal: AbortSignal): Promise<T>;
|
|
198
|
+
/** Wait after the last input change, in milliseconds. */
|
|
199
|
+
delay?: number;
|
|
200
|
+
}
|
|
201
|
+
interface Search<T> {
|
|
202
|
+
query: Accessor<string>;
|
|
203
|
+
results: Accessor<T | undefined>;
|
|
204
|
+
status: Accessor<SearchStatus>;
|
|
205
|
+
error: Accessor<unknown>;
|
|
206
|
+
setQuery(query: string): void;
|
|
207
|
+
/** Stops the pending search; the last results stay. */
|
|
208
|
+
cancel(): void;
|
|
209
|
+
}
|
|
210
|
+
type SearchStatus = "idle" | "loading" | "done" | "error";
|
|
211
|
+
/**
|
|
212
|
+
* Runs a search after input stops. A new query cancels the previous request, and only the
|
|
213
|
+
* latest response updates the results.
|
|
214
|
+
*/
|
|
215
|
+
declare const createSearch: <T>(options: SearchOptions<T>) => Search<T>;
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/solid/search/create-list-navigation.d.ts
|
|
218
|
+
interface ListNavigationOptions {
|
|
219
|
+
count: Accessor<number>;
|
|
220
|
+
/** Called on Enter with the active index. */
|
|
221
|
+
onSelect(index: number): void;
|
|
222
|
+
}
|
|
223
|
+
interface ListNavigation {
|
|
224
|
+
active: Accessor<number>;
|
|
225
|
+
setActive(index: number): void;
|
|
226
|
+
/** Handles arrow, Home, End, and Enter keys, e.g. on a combobox input. */
|
|
227
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
228
|
+
}
|
|
229
|
+
/** Keyboard navigation for a list whose focus stays on another element. */
|
|
230
|
+
declare const createListNavigation: (options: ListNavigationOptions) => ListNavigation;
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/solid/search/create-answer.d.ts
|
|
233
|
+
interface AnswerTurn<T> {
|
|
234
|
+
question: string;
|
|
235
|
+
answer?: T;
|
|
236
|
+
status: AnswerStatus;
|
|
237
|
+
error?: unknown;
|
|
238
|
+
}
|
|
239
|
+
interface AnswerOptions<T> {
|
|
240
|
+
/**
|
|
241
|
+
* Gets the answer to a question. `turns` has the completed earlier turns, for follow-up
|
|
242
|
+
* history. Call `update` with each partial answer.
|
|
243
|
+
*/
|
|
244
|
+
ask(question: string, turns: Array<AnswerTurn<T>>, signal: AbortSignal, update: (answer: T) => void): Promise<T>;
|
|
245
|
+
}
|
|
246
|
+
interface Answer<T> {
|
|
247
|
+
/** The conversation, oldest first. */
|
|
248
|
+
turns: Accessor<Array<AnswerTurn<T>>>;
|
|
249
|
+
pending: Accessor<boolean>;
|
|
250
|
+
/** Asks a question; earlier completed turns are the history. */
|
|
251
|
+
ask(question: string): void;
|
|
252
|
+
/** Stops the pending answer and removes its turn. */
|
|
253
|
+
cancel(): void;
|
|
254
|
+
/** Stops the pending answer and clears the conversation. */
|
|
255
|
+
reset(): void;
|
|
256
|
+
}
|
|
257
|
+
type AnswerStatus = "loading" | "done" | "error";
|
|
258
|
+
/** A conversation of streamed answers, with cancellation and follow-up questions. */
|
|
259
|
+
declare const createAnswer: <T>(options: AnswerOptions<T>) => Answer<T>;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/solid/search/create-search-palette.d.ts
|
|
262
|
+
interface SearchPaletteItem {
|
|
263
|
+
href: string;
|
|
264
|
+
}
|
|
265
|
+
interface SearchPaletteOptions<TResults, TItem extends SearchPaletteItem, TAnswer> {
|
|
266
|
+
search(query: string, signal: AbortSignal): Promise<TResults>;
|
|
267
|
+
/** The results' items that open with Enter, in order. */
|
|
268
|
+
items(results: TResults): TItem[];
|
|
269
|
+
/** Answers the query as a question. Without it, the palette only searches. */
|
|
270
|
+
ask?: AnswerOptions<TAnswer>["ask"];
|
|
271
|
+
/** Wait after the last input change, in milliseconds. */
|
|
272
|
+
delay?: number;
|
|
273
|
+
/** Elements that open the palette on click. */
|
|
274
|
+
triggerSelector?: string;
|
|
275
|
+
/** URL parameter that opens the palette with a query, e.g. `?q=install`. */
|
|
276
|
+
queryParam?: string;
|
|
277
|
+
/** Maximum length of a query from the URL. */
|
|
278
|
+
maxLength?: number;
|
|
279
|
+
}
|
|
280
|
+
interface SearchPalette<TResults, TItem extends SearchPaletteItem, TAnswer> {
|
|
281
|
+
open: Accessor<boolean>;
|
|
282
|
+
setOpen(open: boolean): void;
|
|
283
|
+
search: Search<TResults>;
|
|
284
|
+
/** Undefined without the `ask` option. */
|
|
285
|
+
answer?: Answer<TAnswer>;
|
|
286
|
+
items: Accessor<TItem[]>;
|
|
287
|
+
/** The query can be asked as a question; the ask row is the list item after the items. */
|
|
288
|
+
canAsk: Accessor<boolean>;
|
|
289
|
+
/** The conversation shows in place of results: the input is empty and there are answers. */
|
|
290
|
+
showingAnswer: Accessor<boolean>;
|
|
291
|
+
navigation: ListNavigation;
|
|
292
|
+
/** Shortcuts use Command, not Ctrl. */
|
|
293
|
+
isApple: Accessor<boolean>;
|
|
294
|
+
/** Asks the query as a question, and clears the input. */
|
|
295
|
+
askQuery(): void;
|
|
296
|
+
/** Goes to an item's page. */
|
|
297
|
+
openItem(item: TItem): void;
|
|
298
|
+
onInputKeyDown(event: KeyboardEvent): void;
|
|
299
|
+
input: Accessor<HTMLInputElement | undefined>;
|
|
300
|
+
inputRef(element: HTMLInputElement): void;
|
|
301
|
+
/**
|
|
302
|
+
* The scrolling element of the results. The active result, marked with a
|
|
303
|
+
* `data-search-result` attribute that holds its index, and new answer text stay in view.
|
|
304
|
+
*/
|
|
305
|
+
resultsRef(element: HTMLElement): void;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The state of a search dialog: search as you type, AI answers with follow-ups, keyboard
|
|
309
|
+
* navigation, the ⌘K or Ctrl+K shortcut, trigger elements, and a query in the URL.
|
|
310
|
+
*/
|
|
311
|
+
declare const createSearchPalette: <TResults, TItem extends SearchPaletteItem, TAnswer = never>(options: SearchPaletteOptions<TResults, TItem, TAnswer>) => SearchPalette<TResults, TItem, TAnswer>;
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/solid/search/highlight.d.ts
|
|
314
|
+
interface MatchPart {
|
|
315
|
+
text: string;
|
|
316
|
+
/** The part matches the query. */
|
|
317
|
+
match: boolean;
|
|
318
|
+
}
|
|
319
|
+
interface MatchPreviewOptions {
|
|
320
|
+
/** Maximum length of the preview, in characters. */
|
|
321
|
+
length?: number;
|
|
322
|
+
/** Characters to keep before the first match. */
|
|
323
|
+
prefix?: number;
|
|
324
|
+
}
|
|
325
|
+
/** The whole query and its words of two or more characters, longest first. */
|
|
326
|
+
declare const getMatchTerms: (query: string) => string[];
|
|
327
|
+
declare const matchesQuery: (text: string, query: string) => boolean;
|
|
328
|
+
/** Splits text into parts that match the query and parts that do not, for highlighting. */
|
|
329
|
+
declare const splitMatches: (text: string, query: string) => MatchPart[];
|
|
330
|
+
/** Cuts the text to start just before the first match of the query. */
|
|
331
|
+
declare const getMatchPreview: (text: string, query: string, options?: MatchPreviewOptions) => string;
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/solid/page-actions/create-page-actions.d.ts
|
|
334
|
+
interface PageActionsOptions {
|
|
335
|
+
/** URL of the page's Markdown alternative. */
|
|
336
|
+
markdown: string;
|
|
337
|
+
/** Time that a copy result shows, in milliseconds. */
|
|
338
|
+
timeout?: number;
|
|
339
|
+
}
|
|
340
|
+
interface PageActions {
|
|
341
|
+
/** The last copy result, for a short time. */
|
|
342
|
+
result: Accessor<CopyResult | undefined>;
|
|
343
|
+
copyLink(): Promise<void>;
|
|
344
|
+
copyMarkdown(): Promise<void>;
|
|
345
|
+
}
|
|
346
|
+
interface CopyResult {
|
|
347
|
+
item: "link" | "markdown";
|
|
348
|
+
success: boolean;
|
|
349
|
+
}
|
|
350
|
+
/** Copies the page URL or its Markdown alternative. */
|
|
351
|
+
declare const createPageActions: (options: PageActionsOptions) => PageActions;
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/solid/scroll/create-scroll-memory.d.ts
|
|
354
|
+
interface ScrollMemoryOptions {
|
|
355
|
+
container: () => HTMLElement | undefined;
|
|
356
|
+
/** Session storage key of the scroll position. */
|
|
357
|
+
key: string;
|
|
358
|
+
/** Kept in view after the position is restored. */
|
|
359
|
+
current?: () => Element | null | undefined;
|
|
360
|
+
}
|
|
361
|
+
/** Keeps the scroll position of a container between pages, and shows the current item. */
|
|
362
|
+
declare const createScrollMemory: (options: ScrollMemoryOptions) => void;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/solid/scroll/create-scroll-edges.d.ts
|
|
365
|
+
interface ScrollEdges {
|
|
366
|
+
/** The page is scrolled away from its top. */
|
|
367
|
+
start: Accessor<boolean>;
|
|
368
|
+
/** More of the page is below the viewport. */
|
|
369
|
+
end: Accessor<boolean>;
|
|
370
|
+
}
|
|
371
|
+
/** Tracks whether the page has content past the top and bottom of the viewport, e.g. for fades. */
|
|
372
|
+
declare const createScrollEdges: () => ScrollEdges;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/solid/scroll/create-page-scrollbar.d.ts
|
|
375
|
+
interface PageScrollbarOptions {
|
|
376
|
+
/** Space between the track ends and the viewport edges, in pixels. */
|
|
377
|
+
inset?: number;
|
|
378
|
+
/** Width of the zone at the right edge where the pointer shows the scrollbar, in pixels. */
|
|
379
|
+
edgeZone?: number;
|
|
380
|
+
minThumbHeight?: number;
|
|
381
|
+
/** Time that the scrollbar stays after scrolling stops, in milliseconds. */
|
|
382
|
+
hideDelay?: number;
|
|
383
|
+
}
|
|
384
|
+
interface PageScrollbar {
|
|
385
|
+
/** The thumb position; undefined when the page does not scroll, or scrolling is locked. */
|
|
386
|
+
thumb: Accessor<PageScrollbarThumb | undefined>;
|
|
387
|
+
/** The page scrolls, or the pointer is near the scrollbar or drags it. */
|
|
388
|
+
visible: Accessor<boolean>;
|
|
389
|
+
/** The pointer is near the scrollbar or drags it, so the scrollbar takes pointer input. */
|
|
390
|
+
interactive: Accessor<boolean>;
|
|
391
|
+
/** Scrolls the page to a click on the track. */
|
|
392
|
+
onTrackPointerDown(event: PointerEvent): void;
|
|
393
|
+
thumbHandlers: PageScrollbarThumbHandlers;
|
|
394
|
+
}
|
|
395
|
+
interface PageScrollbarThumb {
|
|
396
|
+
top: number;
|
|
397
|
+
height: number;
|
|
398
|
+
}
|
|
399
|
+
interface PageScrollbarThumbHandlers {
|
|
400
|
+
onPointerDown(event: PointerEvent): void;
|
|
401
|
+
onPointerMove(event: PointerEvent): void;
|
|
402
|
+
onPointerUp(): void;
|
|
403
|
+
onPointerCancel(): void;
|
|
404
|
+
onLostPointerCapture(): void;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* An overlay scrollbar for the page, for layouts that hide the native one so pages with and
|
|
408
|
+
* without overflow have the same width. It shows while the page scrolls, or when the pointer is
|
|
409
|
+
* near the right edge, and supports dragging and track clicks.
|
|
410
|
+
*/
|
|
411
|
+
declare const createPageScrollbar: (options?: PageScrollbarOptions) => PageScrollbar;
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/solid/tab-indicator/create-tab-indicator.d.ts
|
|
414
|
+
interface TabIndicatorOptions {
|
|
415
|
+
/** Index of the current tab, or -1. */
|
|
416
|
+
current: Accessor<number>;
|
|
417
|
+
}
|
|
418
|
+
interface TabIndicator {
|
|
419
|
+
position: Accessor<TabIndicatorPosition | undefined>;
|
|
420
|
+
/** The positioned wrapper of the indicator; it does not scroll. */
|
|
421
|
+
rootRef(element: HTMLElement): void;
|
|
422
|
+
scrollRef(element: HTMLElement): void;
|
|
423
|
+
tabRef(index: number, element: HTMLElement): void;
|
|
424
|
+
}
|
|
425
|
+
interface TabIndicatorPosition {
|
|
426
|
+
left: number;
|
|
427
|
+
width: number;
|
|
428
|
+
}
|
|
429
|
+
/** Measures an underline for the current tab of a scrollable row, and keeps that tab in view. */
|
|
430
|
+
declare const createTabIndicator: (options: TabIndicatorOptions) => TabIndicator;
|
|
431
|
+
//#endregion
|
|
432
|
+
export { type Answer, type AnswerOptions, type AnswerStatus, type AnswerTurn, Breadcrumbs, type Clipboard, type CopyResult, type ListNavigation, type ListNavigationOptions, type MatchPart, type MatchPreviewOptions, MobileNavigation, type MobileNavigationOptions, type RootProps as MobileNavigationRootProps, NavigationTree, type NavigationTreeItem, type NavigationTreeOptions, type NavigationTree$1 as NavigationTreeState, type PageActions, type PageActionsOptions, type PageScrollbar, type PageScrollbarOptions, type PageScrollbarThumb, type PageScrollbarThumbHandlers, Pagination, type ScrollEdges, type ScrollMemoryOptions, type Search, type SearchOptions, type SearchPalette, type SearchPaletteItem, type SearchPaletteOptions, type SearchStatus, type TabIndicator, type TabIndicatorOptions, type TabIndicatorPosition, TableOfContents, type TableOfContentsGuide, type TableOfContentsGuideOptions, type TableOfContentsGuideRange, type TableOfContentsGuideStroke, type TableOfContentsOptions, type TableOfContents$1 as TableOfContentsState, Tabs, type RootProps$1 as TabsRootProps, createAnswer, createClipboard, createListNavigation, createNavigationTree, createPageActions, createPageScrollbar, createScrollEdges, createScrollMemory, createSearch, createSearchPalette, createTabIndicator, createTableOfContents, createTableOfContentsGuide, enhanceMobileNavigation, getMatchPreview, getMatchTerms, matchesQuery, splitMatches, useTableOfContents };
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@andesine/ui",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Headless documentation components for Andesine Pages",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"README.md",
|
|
12
|
+
"CHANGELOG.md"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
"./solid": {
|
|
16
|
+
"types": "./dist/solid/types/index.d.ts",
|
|
17
|
+
"solid": "./dist/solid/source/index.jsx",
|
|
18
|
+
"browser": "./dist/solid/client/index.js",
|
|
19
|
+
"node": "./dist/solid/server/index.js",
|
|
20
|
+
"default": "./dist/solid/server/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"solid-js": "^1.9.14"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@babel/core": "7.29.7",
|
|
35
|
+
"babel-preset-solid": "1.9.12",
|
|
36
|
+
"publint": "0.3.24",
|
|
37
|
+
"rolldown": "^1.2.2",
|
|
38
|
+
"rolldown-plugin-dts": "^0.28.6",
|
|
39
|
+
"solid-js": "1.9.14",
|
|
40
|
+
"typescript": "6.0.3"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/vriteio/andesine.git",
|
|
45
|
+
"directory": "packages/public/ui"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/vriteio/andesine/tree/andesine/packages/public/ui#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/vriteio/andesine/issues"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"andesine",
|
|
53
|
+
"documentation",
|
|
54
|
+
"headless",
|
|
55
|
+
"solid"
|
|
56
|
+
],
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@ark-ui/solid": "5.38.0"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "rolldown -c rolldown.config.ts",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"lint:package": "publint --strict"
|
|
64
|
+
}
|
|
65
|
+
}
|