@keepkit/ui 0.15.0 → 0.17.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/README.md +52 -2
- package/dist/index.d.ts +459 -40
- package/dist/index.js +872 -174
- package/dist/index.js.map +1 -1
- package/dist/styles/base.css +5 -0
- package/dist/styles/collection.css +180 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,70 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ReactNode, HTMLAttributes, ComponentType, ImgHTMLAttributes, MouseEvent, HTMLAttributeAnchorTarget, InputHTMLAttributes, FormHTMLAttributes, KeyboardEvent, ButtonHTMLAttributes, SelectHTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
import { KeepItem, ImportItemsResult, KeepListQuery, KeepUrlSyncOptions, KeepItemStatus, KeepSyncConflict, KeepItemInput } from '@keepkit/core/core';
|
|
4
4
|
export { AuthenticatedSyncAuthContext, AuthenticatedSyncKit, AuthenticatedSyncKitOptions, AuthenticatedSyncRequestContext, AuthenticatedSyncTransport, KeepItem, KeepItemInput, KeepListQuery, KeepScope, KeepSyncConflict, KeepSyncResolution, KeepSyncState, KeepSyncStatus, KeepUndoState, KeepUrlSyncOptions, createAuthenticatedSyncKit } from '@keepkit/core/core';
|
|
5
|
-
import { KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepItem, useKeepList, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
|
-
export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepContext, useKeepItem, useKeepList, useKeepShortcut } from '@keepkit/core/react';
|
|
5
|
+
import { KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepItem, useKeepList, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
|
|
6
|
+
export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepContext, useKeepItem, useKeepList, useKeepNavigator, useKeepShortcut } from '@keepkit/core/react';
|
|
7
7
|
export { FallbackStorageAdapter, IndexedDBAdapter, IndexedDBSyncQueueAdapter, LocalStorageAdapter, LocalStorageSyncQueueAdapter, SyncStorageAdapter, createBrowserStorageAdapter, createStorageAdapter } from '@keepkit/core/storage';
|
|
8
8
|
|
|
9
|
+
type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "allTags" | "tags" | "filterTags" | "note" | "saveNote" | "noItems" | "loadingItems" | "errorItems" | "search" | "sort" | "newest" | "oldest" | "savedNewest" | "savedOldest" | "updatedNewest" | "updatedOldest" | "previousPage" | "nextPage" | "pagination" | "page" | "selectItems" | "selectedCount" | "deleteSelected" | "tagsToApply" | "applyTags" | "savedMessage" | "removedMessage" | "restoredMessage" | "syncFailedMessage" | "stalePrunedMessage" | "undo" | "undoAvailable" | "selectionScope" | "currentPage" | "searchResults" | "allItems" | "localVersion" | "remoteVersion" | "updatedAt" | "statusAvailable" | "noteSavedMessage" | "exportData" | "importData" | "importMode" | "merge" | "replace" | "importedCount" | "failedCount" | "storageQuotaError" | "statusExpired" | "statusRemoved" | "statusDeleted" | "statusPrivate" | "statusUnknown" | "retry" | "removeFromList" | "pruneStale" | "retrySync" | "resolveSync" | "keepLocal" | "useServer" | "manualMerge" | "close" | "backupRecovery" | "backupRecoveryDescription" | "syncPending" | "syncSynced" | "syncConflict";
|
|
10
|
+
type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
|
|
11
|
+
type KeepUiLocaleLabels = Record<KeepUiLabelKey, string>;
|
|
12
|
+
|
|
13
|
+
declare const KEEP_BUILT_IN_LOCALES: readonly ["en", "ja", "ko", "zh-Hans", "zh-Hant", "th", "fr", "es", "pt-BR", "it", "de", "ru", "fil", "vi", "id", "ms"];
|
|
14
|
+
type KeepUiLocale = (typeof KEEP_BUILT_IN_LOCALES)[number];
|
|
15
|
+
declare function getKeepLocaleLabels(locale?: string): KeepUiLocaleLabels;
|
|
16
|
+
|
|
17
|
+
type KeepUiLabelContext = {
|
|
18
|
+
locale?: string;
|
|
19
|
+
labels: Readonly<Record<KeepUiLabelKey, string>>;
|
|
20
|
+
customLabels?: KeepUiLabels;
|
|
21
|
+
labelResolver?: (key: KeepUiLabelKey, context: {
|
|
22
|
+
locale?: string;
|
|
23
|
+
}) => string | undefined;
|
|
24
|
+
emitFeedback: <TMeta>(event: KeepUiFeedbackEvent<TMeta>) => void;
|
|
25
|
+
};
|
|
26
|
+
type KeepUiFeedbackBase<TType extends string> = {
|
|
27
|
+
type: TType;
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
30
|
+
type KeepUiFeedbackEvent<TMeta = Record<string, unknown>> = (KeepUiFeedbackBase<"item-saved"> & {
|
|
31
|
+
item: KeepItem<TMeta>;
|
|
32
|
+
}) | (KeepUiFeedbackBase<"item-removed"> & {
|
|
33
|
+
item: KeepItem<TMeta>;
|
|
34
|
+
undo: () => void | Promise<void>;
|
|
35
|
+
undoLabel: string;
|
|
36
|
+
}) | (KeepUiFeedbackBase<"item-restored"> & {
|
|
37
|
+
item?: KeepItem<TMeta>;
|
|
38
|
+
items: KeepItem<TMeta>[];
|
|
39
|
+
}) | KeepUiFeedbackBase<"sync-completed"> | (KeepUiFeedbackBase<"sync-failed"> & {
|
|
40
|
+
error: unknown;
|
|
41
|
+
}) | (KeepUiFeedbackBase<"stale-pruned"> & {
|
|
42
|
+
item?: KeepItem<TMeta>;
|
|
43
|
+
items: KeepItem<TMeta>[];
|
|
44
|
+
undo: () => void | Promise<void>;
|
|
45
|
+
undoLabel: string;
|
|
46
|
+
});
|
|
47
|
+
type KeepUiProviderProps<TMeta = Record<string, unknown>> = {
|
|
48
|
+
labels?: KeepUiLabels;
|
|
49
|
+
locale?: string;
|
|
50
|
+
labelResolver?: KeepUiLabelContext["labelResolver"];
|
|
51
|
+
onFeedback?: (event: KeepUiFeedbackEvent<TMeta>) => void;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
};
|
|
54
|
+
/** Provides one complete locale-aware label source to every UI primitive. */
|
|
55
|
+
declare function KeepUiProvider<TMeta = Record<string, unknown>>({ labels, locale, labelResolver, onFeedback, children, }: KeepUiProviderProps<TMeta>): react.JSX.Element;
|
|
56
|
+
declare function useKeepUiLabels(): KeepUiLabelContext;
|
|
57
|
+
|
|
58
|
+
type KeepToastFeedbackOptions = {
|
|
59
|
+
action?: {
|
|
60
|
+
label: string;
|
|
61
|
+
onClick: () => void;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
type KeepToastHandler = (message: string, options?: KeepToastFeedbackOptions) => unknown;
|
|
65
|
+
/** Adapts KeepKit feedback to Sonner-like toast functions without adding a toast dependency. */
|
|
66
|
+
declare function useKeepToastFeedback<TMeta = Record<string, unknown>>(showToast: KeepToastHandler): (event: KeepUiFeedbackEvent<TMeta>) => void;
|
|
67
|
+
|
|
9
68
|
type KeepBackupProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
10
69
|
filename?: string;
|
|
11
70
|
onExport?: (data: string) => void;
|
|
@@ -15,6 +74,13 @@ type KeepBackupProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTML
|
|
|
15
74
|
declare function KeepBackup<TMeta = Record<string, unknown>>({ filename, onExport, onImported, ...props }: KeepBackupProps<TMeta>): react.JSX.Element;
|
|
16
75
|
|
|
17
76
|
type RenderProp<TState> = (state: TState) => ReactNode;
|
|
77
|
+
type KeepHighlightProps = {
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
query?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Wraps case-insensitive, literal query matches in a style-free mark element. */
|
|
82
|
+
declare function KeepHighlight({ children, query }: KeepHighlightProps): ReactNode;
|
|
83
|
+
declare function highlightText(text: string, query: string): ReactNode;
|
|
18
84
|
type KeepButtonLabels = {
|
|
19
85
|
saved?: ReactNode;
|
|
20
86
|
unsaved?: ReactNode;
|
|
@@ -82,7 +148,7 @@ type KeepButtonProps<TMeta = Record<string, unknown>> = KeepButtonProps$1<TMeta>
|
|
|
82
148
|
iconClassName?: string;
|
|
83
149
|
};
|
|
84
150
|
/** A style-free save toggle with localized labels and the core button's ARIA/asChild behavior. */
|
|
85
|
-
declare function KeepButton<TMeta = Record<string, unknown>>({ labels, icons, iconOnly, showLabel, iconClassName, ...props }: KeepButtonProps<TMeta>): react.JSX.Element;
|
|
151
|
+
declare function KeepButton<TMeta = Record<string, unknown>>({ labels, icons, iconOnly, showLabel, iconClassName, onClick, onToggleError, ...props }: KeepButtonProps<TMeta>): react.JSX.Element;
|
|
86
152
|
|
|
87
153
|
type KeepItemCardState<TMeta = Record<string, unknown>> = {
|
|
88
154
|
item: KeepItem<TMeta>;
|
|
@@ -129,9 +195,317 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
|
|
|
129
195
|
linkComponent?: ComponentType<KeepItemCardLinkProps>;
|
|
130
196
|
linkTargetAttribute?: HTMLAttributeAnchorTarget;
|
|
131
197
|
linkRel?: string;
|
|
198
|
+
highlightQuery?: string;
|
|
132
199
|
};
|
|
133
|
-
|
|
134
|
-
|
|
200
|
+
type KeepItemCardMediaProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
201
|
+
children?: ReactNode;
|
|
202
|
+
fallback?: ReactNode;
|
|
203
|
+
};
|
|
204
|
+
type KeepItemCardContentProps = HTMLAttributes<HTMLDivElement>;
|
|
205
|
+
type KeepItemCardTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, "title"> & {
|
|
206
|
+
as?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
207
|
+
};
|
|
208
|
+
type KeepItemCardTagsProps = HTMLAttributes<HTMLUListElement>;
|
|
209
|
+
type KeepItemCardActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
210
|
+
type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
211
|
+
layout?: KeepLayoutPreset;
|
|
212
|
+
};
|
|
213
|
+
/** A low-dependency item presentation primitive with composable card parts. */
|
|
214
|
+
declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showSavedAt, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
|
|
215
|
+
declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
|
|
216
|
+
declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
|
|
217
|
+
declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitleProps): react.DetailedReactHTMLElement<{
|
|
218
|
+
"data-keep-card-part": string;
|
|
219
|
+
onChange?: react.ChangeEventHandler<HTMLHeadingElement, Element> | undefined;
|
|
220
|
+
onError?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
221
|
+
className?: string | undefined | undefined;
|
|
222
|
+
id?: string | undefined | undefined;
|
|
223
|
+
role?: react.AriaRole | undefined;
|
|
224
|
+
tabIndex?: number | undefined | undefined;
|
|
225
|
+
"aria-label"?: string | undefined | undefined;
|
|
226
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
227
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
228
|
+
style?: react.CSSProperties | undefined;
|
|
229
|
+
onClick?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
230
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
231
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
232
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
233
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
234
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
235
|
+
accessKey?: string | undefined | undefined;
|
|
236
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
237
|
+
autoFocus?: boolean | undefined | undefined;
|
|
238
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
239
|
+
contextMenu?: string | undefined | undefined;
|
|
240
|
+
dir?: string | undefined | undefined;
|
|
241
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
242
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
243
|
+
hidden?: boolean | undefined | undefined;
|
|
244
|
+
lang?: string | undefined | undefined;
|
|
245
|
+
nonce?: string | undefined | undefined;
|
|
246
|
+
slot?: string | undefined | undefined;
|
|
247
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
248
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
249
|
+
radioGroup?: string | undefined | undefined;
|
|
250
|
+
about?: string | undefined | undefined;
|
|
251
|
+
content?: string | undefined | undefined;
|
|
252
|
+
datatype?: string | undefined | undefined;
|
|
253
|
+
inlist?: any;
|
|
254
|
+
prefix?: string | undefined | undefined;
|
|
255
|
+
property?: string | undefined | undefined;
|
|
256
|
+
rel?: string | undefined | undefined;
|
|
257
|
+
resource?: string | undefined | undefined;
|
|
258
|
+
rev?: string | undefined | undefined;
|
|
259
|
+
typeof?: string | undefined | undefined;
|
|
260
|
+
vocab?: string | undefined | undefined;
|
|
261
|
+
autoCorrect?: string | undefined | undefined;
|
|
262
|
+
autoSave?: string | undefined | undefined;
|
|
263
|
+
color?: string | undefined | undefined;
|
|
264
|
+
itemProp?: string | undefined | undefined;
|
|
265
|
+
itemScope?: boolean | undefined | undefined;
|
|
266
|
+
itemType?: string | undefined | undefined;
|
|
267
|
+
itemID?: string | undefined | undefined;
|
|
268
|
+
itemRef?: string | undefined | undefined;
|
|
269
|
+
results?: number | undefined | undefined;
|
|
270
|
+
security?: string | undefined | undefined;
|
|
271
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
272
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
273
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
274
|
+
popoverTarget?: string | undefined | undefined;
|
|
275
|
+
inert?: boolean | undefined | undefined;
|
|
276
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
277
|
+
is?: string | undefined | undefined;
|
|
278
|
+
exportparts?: string | undefined | undefined;
|
|
279
|
+
part?: string | undefined | undefined;
|
|
280
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
281
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
282
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
283
|
+
"aria-braillelabel"?: string | undefined | undefined;
|
|
284
|
+
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
285
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
286
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
287
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
288
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
289
|
+
"aria-colindextext"?: string | undefined | undefined;
|
|
290
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
291
|
+
"aria-controls"?: string | undefined | undefined;
|
|
292
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
293
|
+
"aria-description"?: string | undefined | undefined;
|
|
294
|
+
"aria-details"?: string | undefined | undefined;
|
|
295
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
296
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
297
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
298
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
299
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
300
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
301
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
302
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
303
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
304
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
305
|
+
"aria-level"?: number | undefined | undefined;
|
|
306
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
307
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
308
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
309
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
310
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
311
|
+
"aria-owns"?: string | undefined | undefined;
|
|
312
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
313
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
314
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
315
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
316
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
317
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
318
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
319
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
320
|
+
"aria-rowindextext"?: string | undefined | undefined;
|
|
321
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
322
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
323
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
324
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
325
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
326
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
327
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
328
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
329
|
+
dangerouslySetInnerHTML?: {
|
|
330
|
+
__html: string | TrustedHTML;
|
|
331
|
+
} | undefined | undefined;
|
|
332
|
+
onCopy?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
333
|
+
onCopyCapture?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
334
|
+
onCut?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
335
|
+
onCutCapture?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
336
|
+
onPaste?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
337
|
+
onPasteCapture?: react.ClipboardEventHandler<HTMLHeadingElement> | undefined;
|
|
338
|
+
onCompositionEnd?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
339
|
+
onCompositionEndCapture?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
340
|
+
onCompositionStart?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
341
|
+
onCompositionStartCapture?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
342
|
+
onCompositionUpdate?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
343
|
+
onCompositionUpdateCapture?: react.CompositionEventHandler<HTMLHeadingElement> | undefined;
|
|
344
|
+
onFocus?: react.FocusEventHandler<HTMLHeadingElement> | undefined;
|
|
345
|
+
onFocusCapture?: react.FocusEventHandler<HTMLHeadingElement> | undefined;
|
|
346
|
+
onBlur?: react.FocusEventHandler<HTMLHeadingElement> | undefined;
|
|
347
|
+
onBlurCapture?: react.FocusEventHandler<HTMLHeadingElement> | undefined;
|
|
348
|
+
onChangeCapture?: react.ChangeEventHandler<HTMLHeadingElement, Element> | undefined;
|
|
349
|
+
onBeforeInput?: react.InputEventHandler<HTMLHeadingElement> | undefined;
|
|
350
|
+
onBeforeInputCapture?: react.InputEventHandler<HTMLHeadingElement> | undefined;
|
|
351
|
+
onInput?: react.InputEventHandler<HTMLHeadingElement> | undefined;
|
|
352
|
+
onInputCapture?: react.InputEventHandler<HTMLHeadingElement> | undefined;
|
|
353
|
+
onReset?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
354
|
+
onResetCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
355
|
+
onSubmit?: react.SubmitEventHandler<HTMLHeadingElement> | undefined;
|
|
356
|
+
onSubmitCapture?: react.SubmitEventHandler<HTMLHeadingElement> | undefined;
|
|
357
|
+
onInvalid?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
358
|
+
onInvalidCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
359
|
+
onLoad?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
360
|
+
onLoadCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
361
|
+
onErrorCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
362
|
+
onKeyDown?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
363
|
+
onKeyDownCapture?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
364
|
+
onKeyPress?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
365
|
+
onKeyPressCapture?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
366
|
+
onKeyUp?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
367
|
+
onKeyUpCapture?: react.KeyboardEventHandler<HTMLHeadingElement> | undefined;
|
|
368
|
+
onAbort?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
369
|
+
onAbortCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
370
|
+
onCanPlay?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
371
|
+
onCanPlayCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
372
|
+
onCanPlayThrough?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
373
|
+
onCanPlayThroughCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
374
|
+
onDurationChange?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
375
|
+
onDurationChangeCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
376
|
+
onEmptied?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
377
|
+
onEmptiedCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
378
|
+
onEncrypted?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
379
|
+
onEncryptedCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
380
|
+
onEnded?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
381
|
+
onEndedCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
382
|
+
onLoadedData?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
383
|
+
onLoadedDataCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
384
|
+
onLoadedMetadata?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
385
|
+
onLoadedMetadataCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
386
|
+
onLoadStart?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
387
|
+
onLoadStartCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
388
|
+
onPause?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
389
|
+
onPauseCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
390
|
+
onPlay?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
391
|
+
onPlayCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
392
|
+
onPlaying?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
393
|
+
onPlayingCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
394
|
+
onProgress?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
395
|
+
onProgressCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
396
|
+
onRateChange?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
397
|
+
onRateChangeCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
398
|
+
onSeeked?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
399
|
+
onSeekedCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
400
|
+
onSeeking?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
401
|
+
onSeekingCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
402
|
+
onStalled?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
403
|
+
onStalledCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
404
|
+
onSuspend?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
405
|
+
onSuspendCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
406
|
+
onTimeUpdate?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
407
|
+
onTimeUpdateCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
408
|
+
onVolumeChange?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
409
|
+
onVolumeChangeCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
410
|
+
onWaiting?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
411
|
+
onWaitingCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
412
|
+
onAuxClick?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
413
|
+
onAuxClickCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
414
|
+
onClickCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
415
|
+
onContextMenu?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
416
|
+
onContextMenuCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
417
|
+
onDoubleClick?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
418
|
+
onDoubleClickCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
419
|
+
onDrag?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
420
|
+
onDragCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
421
|
+
onDragEnd?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
422
|
+
onDragEndCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
423
|
+
onDragEnter?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
424
|
+
onDragEnterCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
425
|
+
onDragExit?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
426
|
+
onDragExitCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
427
|
+
onDragLeave?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
428
|
+
onDragLeaveCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
429
|
+
onDragOver?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
430
|
+
onDragOverCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
431
|
+
onDragStart?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
432
|
+
onDragStartCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
433
|
+
onDrop?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
434
|
+
onDropCapture?: react.DragEventHandler<HTMLHeadingElement> | undefined;
|
|
435
|
+
onMouseDown?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
436
|
+
onMouseDownCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
437
|
+
onMouseEnter?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
438
|
+
onMouseLeave?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
439
|
+
onMouseMove?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
440
|
+
onMouseMoveCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
441
|
+
onMouseOut?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
442
|
+
onMouseOutCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
443
|
+
onMouseOver?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
444
|
+
onMouseOverCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
445
|
+
onMouseUp?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
446
|
+
onMouseUpCapture?: react.MouseEventHandler<HTMLHeadingElement> | undefined;
|
|
447
|
+
onSelect?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
448
|
+
onSelectCapture?: react.ReactEventHandler<HTMLHeadingElement> | undefined;
|
|
449
|
+
onTouchCancel?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
450
|
+
onTouchCancelCapture?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
451
|
+
onTouchEnd?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
452
|
+
onTouchEndCapture?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
453
|
+
onTouchMove?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
454
|
+
onTouchMoveCapture?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
455
|
+
onTouchStart?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
456
|
+
onTouchStartCapture?: react.TouchEventHandler<HTMLHeadingElement> | undefined;
|
|
457
|
+
onPointerDown?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
458
|
+
onPointerDownCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
459
|
+
onPointerMove?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
460
|
+
onPointerMoveCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
461
|
+
onPointerUp?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
462
|
+
onPointerUpCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
463
|
+
onPointerCancel?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
464
|
+
onPointerCancelCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
465
|
+
onPointerEnter?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
466
|
+
onPointerLeave?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
467
|
+
onPointerOver?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
468
|
+
onPointerOverCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
469
|
+
onPointerOut?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
470
|
+
onPointerOutCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
471
|
+
onGotPointerCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
472
|
+
onGotPointerCaptureCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
473
|
+
onLostPointerCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
474
|
+
onLostPointerCaptureCapture?: react.PointerEventHandler<HTMLHeadingElement> | undefined;
|
|
475
|
+
onScroll?: react.UIEventHandler<HTMLHeadingElement> | undefined;
|
|
476
|
+
onScrollCapture?: react.UIEventHandler<HTMLHeadingElement> | undefined;
|
|
477
|
+
onScrollEnd?: react.UIEventHandler<HTMLHeadingElement> | undefined;
|
|
478
|
+
onScrollEndCapture?: react.UIEventHandler<HTMLHeadingElement> | undefined;
|
|
479
|
+
onWheel?: react.WheelEventHandler<HTMLHeadingElement> | undefined;
|
|
480
|
+
onWheelCapture?: react.WheelEventHandler<HTMLHeadingElement> | undefined;
|
|
481
|
+
onAnimationStart?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
482
|
+
onAnimationStartCapture?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
483
|
+
onAnimationEnd?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
484
|
+
onAnimationEndCapture?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
485
|
+
onAnimationIteration?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
486
|
+
onAnimationIterationCapture?: react.AnimationEventHandler<HTMLHeadingElement> | undefined;
|
|
487
|
+
onToggle?: react.ToggleEventHandler<HTMLHeadingElement> | undefined;
|
|
488
|
+
onBeforeToggle?: react.ToggleEventHandler<HTMLHeadingElement> | undefined;
|
|
489
|
+
onTransitionCancel?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
490
|
+
onTransitionCancelCapture?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
491
|
+
onTransitionEnd?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
492
|
+
onTransitionEndCapture?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
493
|
+
onTransitionRun?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
494
|
+
onTransitionRunCapture?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
495
|
+
onTransitionStart?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
496
|
+
onTransitionStartCapture?: react.TransitionEventHandler<HTMLHeadingElement> | undefined;
|
|
497
|
+
}, HTMLElement>;
|
|
498
|
+
declare function KeepItemCardTags({ children, ...props }: KeepItemCardTagsProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
499
|
+
declare function KeepItemCardActions({ children, ...props }: KeepItemCardActionsProps): react.JSX.Element;
|
|
500
|
+
declare const KeepItemCard: typeof KeepItemCardRoot & {
|
|
501
|
+
Media: typeof KeepItemCardMedia;
|
|
502
|
+
Content: typeof KeepItemCardContent;
|
|
503
|
+
Title: typeof KeepItemCardTitle;
|
|
504
|
+
Tags: typeof KeepItemCardTags;
|
|
505
|
+
Actions: typeof KeepItemCardActions;
|
|
506
|
+
};
|
|
507
|
+
/** A non-interactive placeholder that preserves the selected card layout while data loads. */
|
|
508
|
+
declare function KeepItemCardSkeleton({ layout, ...props }: KeepItemCardSkeletonProps): react.JSX.Element;
|
|
135
509
|
|
|
136
510
|
type KeepListState<TMeta = Record<string, unknown>> = UseKeepListResult<TMeta>;
|
|
137
511
|
type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
@@ -139,6 +513,9 @@ type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLEl
|
|
|
139
513
|
children?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
140
514
|
renderItem?: (item: KeepItem<TMeta>, state: KeepListState<TMeta>) => ReactNode;
|
|
141
515
|
loading?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
516
|
+
/** Alias for `loading`. When neither is provided, layout-matched skeletons are rendered. */
|
|
517
|
+
renderLoading?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
518
|
+
loadingCount?: number;
|
|
142
519
|
empty?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
143
520
|
error?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
144
521
|
itemCardProps?: Omit<KeepItemCardProps<TMeta>, "item" | "children" | "render">;
|
|
@@ -182,7 +559,7 @@ declare function createNextPagesRouterAdapter(router: KeepPagesRouterLike): Keep
|
|
|
182
559
|
declare function useKeepUrlSync<TMeta = Record<string, unknown>>({ enabled, query, onQueryChange, options, adapter: providedAdapter, }: KeepUrlSyncProps<TMeta>): void;
|
|
183
560
|
|
|
184
561
|
type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "bulkActions";
|
|
185
|
-
type KeepLayoutPreset = "list" | "grid" | "compact";
|
|
562
|
+
type KeepLayoutPreset = "list" | "grid" | "compact" | "auto";
|
|
186
563
|
type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
187
564
|
query?: KeepListQuery<TMeta>;
|
|
188
565
|
pageSize?: number;
|
|
@@ -193,6 +570,9 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
|
|
|
193
570
|
renderItem?: (item: KeepItem<TMeta>, state: KeepListState<TMeta>) => ReactNode;
|
|
194
571
|
itemCardProps?: Omit<KeepItemCardProps<TMeta>, "item" | "children" | "render">;
|
|
195
572
|
loading?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
573
|
+
/** Alias for `loading`. When neither is provided, KeepList renders skeleton cards. */
|
|
574
|
+
renderLoading?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
575
|
+
loadingCount?: number;
|
|
196
576
|
empty?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
197
577
|
error?: ReactNode | RenderProp<KeepListState<TMeta>>;
|
|
198
578
|
fallback?: KeepErrorBoundaryProps["fallback"];
|
|
@@ -223,8 +603,8 @@ type KeepLayoutProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
|
223
603
|
layout?: KeepLayoutPreset;
|
|
224
604
|
children?: ReactNode;
|
|
225
605
|
};
|
|
226
|
-
/** A
|
|
227
|
-
declare function KeepLayout({ layout, children, ...props }: KeepLayoutProps): react.JSX.Element;
|
|
606
|
+
/** A container-aware layout wrapper with a stable preset attribute for host or theme CSS. */
|
|
607
|
+
declare function KeepLayout({ layout, children, onKeyDown, onFocusCapture, ...props }: KeepLayoutProps): react.JSX.Element;
|
|
228
608
|
|
|
229
609
|
type KeepNoteEditorState<TMeta = Record<string, unknown>> = {
|
|
230
610
|
item: KeepItem<TMeta>;
|
|
@@ -251,6 +631,35 @@ type KeepNoteEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribu
|
|
|
251
631
|
/** A controlled-by-default note editor that persists through useKeepItem. */
|
|
252
632
|
declare function KeepNoteEditor<TMeta = Record<string, unknown>>({ item, label, saveLabel, placeholder, debounceMs, onSaved, onSaveError, render, children, asChild, className, ...formProps }: KeepNoteEditorProps<TMeta>): react.JSX.Element;
|
|
253
633
|
|
|
634
|
+
type KeepReorderableItemState = {
|
|
635
|
+
index: number;
|
|
636
|
+
isDragging: boolean;
|
|
637
|
+
dragHandleProps: {
|
|
638
|
+
role: "button";
|
|
639
|
+
tabIndex: 0;
|
|
640
|
+
draggable: true;
|
|
641
|
+
"aria-label": string;
|
|
642
|
+
"aria-grabbed": boolean;
|
|
643
|
+
onDragStart: () => void;
|
|
644
|
+
onDragEnd: () => void;
|
|
645
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
646
|
+
};
|
|
647
|
+
moveUp: () => void;
|
|
648
|
+
moveDown: () => void;
|
|
649
|
+
};
|
|
650
|
+
type KeepReorderableListProps<TItem extends {
|
|
651
|
+
id: string;
|
|
652
|
+
} = KeepItem> = Omit<HTMLAttributes<HTMLUListElement>, "children" | "onChange"> & {
|
|
653
|
+
items: readonly TItem[];
|
|
654
|
+
onReorder: (orderedIds: string[]) => void | Promise<void>;
|
|
655
|
+
renderItem: (item: TItem, state: KeepReorderableItemState) => ReactNode;
|
|
656
|
+
itemLabel?: (item: TItem, index: number) => string;
|
|
657
|
+
};
|
|
658
|
+
/** Accessible drag-and-drop list with keyboard up/down fallback and no styling assumptions. */
|
|
659
|
+
declare function KeepReorderableList<TItem extends {
|
|
660
|
+
id: string;
|
|
661
|
+
} = KeepItem>({ items, onReorder, renderItem, itemLabel, ...props }: KeepReorderableListProps<TItem>): react.JSX.Element;
|
|
662
|
+
|
|
254
663
|
type KeepStaleNoticeProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
255
664
|
item: KeepItem<TMeta>;
|
|
256
665
|
onRetry?: (item: KeepItem<TMeta>) => void | Promise<void>;
|
|
@@ -329,6 +738,41 @@ type KeepTagFilterProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<H
|
|
|
329
738
|
/** An ARIA button group for tag filtering; consumers can connect value to a collection query. */
|
|
330
739
|
declare function KeepTagFilter<TMeta = Record<string, unknown>>({ query, value: controlledValue, defaultValue, onChange, onValueChange, allLabel, ariaLabel, renderTag, render, children, asChild, className, ...rootProps }: KeepTagFilterProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
331
740
|
|
|
741
|
+
type KeepTourShortcutsOptions = {
|
|
742
|
+
onNext: () => void | Promise<void>;
|
|
743
|
+
onPrev: () => void | Promise<void>;
|
|
744
|
+
enabled?: boolean;
|
|
745
|
+
allowInEditable?: boolean;
|
|
746
|
+
preventDefault?: boolean;
|
|
747
|
+
nextKeys?: readonly string[];
|
|
748
|
+
prevKeys?: readonly string[];
|
|
749
|
+
onError?: (error: unknown) => void;
|
|
750
|
+
};
|
|
751
|
+
/** Bind J/]/K/[ (or custom keys) to previous/next tour actions. */
|
|
752
|
+
declare function useKeepTourShortcuts({ onNext, onPrev, enabled, allowInEditable, preventDefault, nextKeys, prevKeys, onError, }: KeepTourShortcutsOptions): void;
|
|
753
|
+
|
|
754
|
+
type KeepTourBarProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
755
|
+
navigation?: UseKeepNavigatorResult<TMeta>;
|
|
756
|
+
currentId?: string;
|
|
757
|
+
initialIndex?: number;
|
|
758
|
+
showProgress?: boolean;
|
|
759
|
+
prevHref?: string;
|
|
760
|
+
nextHref?: string;
|
|
761
|
+
backHref?: string;
|
|
762
|
+
onPrev?: () => void | Promise<void>;
|
|
763
|
+
onNext?: () => void | Promise<void>;
|
|
764
|
+
onBack?: () => void | Promise<void>;
|
|
765
|
+
prevLabel?: string;
|
|
766
|
+
nextLabel?: string;
|
|
767
|
+
backLabel?: string;
|
|
768
|
+
keyboardShortcuts?: boolean;
|
|
769
|
+
shortcutOptions?: Omit<KeepTourShortcutsOptions, "onNext" | "onPrev">;
|
|
770
|
+
progress?: ReactNode;
|
|
771
|
+
};
|
|
772
|
+
/** Headless previous/current/next navigation with optional URL links and keyboard shortcuts. */
|
|
773
|
+
declare function KeepTourBar<TMeta = Record<string, unknown>>({ navigation: providedNavigation, currentId, initialIndex, showProgress, prevHref, nextHref, backHref, onPrev, onNext, onBack, prevLabel, nextLabel, backLabel, keyboardShortcuts, shortcutOptions, progress, ...props }: KeepTourBarProps<TMeta>): react.JSX.Element;
|
|
774
|
+
declare const KeepNavigator: typeof KeepTourBar;
|
|
775
|
+
|
|
332
776
|
type KeepUndoProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
333
777
|
children?: ReactNode;
|
|
334
778
|
label?: ReactNode;
|
|
@@ -435,39 +879,13 @@ type KeepThemeProviderProps = {
|
|
|
435
879
|
/** Scopes KeepKit tokens and opt-in component styles to one subtree. */
|
|
436
880
|
declare function KeepThemeProvider({ children, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, style, className, asChild, ...props }: KeepThemeProviderProps): react.JSX.Element;
|
|
437
881
|
|
|
438
|
-
type
|
|
439
|
-
type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
|
|
440
|
-
type KeepUiLocaleLabels = Record<KeepUiLabelKey, string>;
|
|
441
|
-
|
|
442
|
-
declare const KEEP_BUILT_IN_LOCALES: readonly ["en", "ja", "ko", "zh-Hans", "zh-Hant", "th", "fr", "es", "pt-BR", "it", "de", "ru", "fil", "vi", "id", "ms"];
|
|
443
|
-
type KeepUiLocale = (typeof KEEP_BUILT_IN_LOCALES)[number];
|
|
444
|
-
declare function getKeepLocaleLabels(locale?: string): KeepUiLocaleLabels;
|
|
445
|
-
|
|
446
|
-
type KeepUiLabelContext = {
|
|
447
|
-
locale?: string;
|
|
448
|
-
labels: Readonly<Record<KeepUiLabelKey, string>>;
|
|
449
|
-
customLabels?: KeepUiLabels;
|
|
450
|
-
labelResolver?: (key: KeepUiLabelKey, context: {
|
|
451
|
-
locale?: string;
|
|
452
|
-
}) => string | undefined;
|
|
453
|
-
};
|
|
454
|
-
type KeepUiProviderProps = {
|
|
455
|
-
labels?: KeepUiLabels;
|
|
456
|
-
locale?: string;
|
|
457
|
-
labelResolver?: KeepUiLabelContext["labelResolver"];
|
|
458
|
-
children?: ReactNode;
|
|
459
|
-
};
|
|
460
|
-
/** Provides one complete locale-aware label source to every UI primitive. */
|
|
461
|
-
declare function KeepUiProvider({ labels, locale, labelResolver, children }: KeepUiProviderProps): react.JSX.Element;
|
|
462
|
-
declare function useKeepUiLabels(): KeepUiLabelContext;
|
|
463
|
-
|
|
464
|
-
type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps, "children"> & Omit<KeepThemeProviderProps, "children"> & {
|
|
882
|
+
type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps<TMeta>, "children"> & Omit<KeepThemeProviderProps, "children"> & {
|
|
465
883
|
children?: ReactNode;
|
|
466
884
|
};
|
|
467
885
|
/** Combines the core store, UI labels, and the global live announcer. */
|
|
468
|
-
declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, locale, labelResolver, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
|
|
886
|
+
declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, locale, labelResolver, onFeedback, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
|
|
469
887
|
|
|
470
|
-
type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps
|
|
888
|
+
type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps<TMeta>, "children"> & {
|
|
471
889
|
theme?: KeepThemeName;
|
|
472
890
|
mode?: KeepThemeMode;
|
|
473
891
|
density?: KeepThemeDensity;
|
|
@@ -489,9 +907,10 @@ type KeepKit<TMeta = Record<string, unknown>> = {
|
|
|
489
907
|
useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
|
|
490
908
|
useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
|
|
491
909
|
useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
|
|
910
|
+
useNavigator: (options?: UseKeepNavigatorOptions<TMeta>) => UseKeepNavigatorResult<TMeta>;
|
|
492
911
|
useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
|
|
493
912
|
};
|
|
494
913
|
/** Create one typed application API for the core and standard UI layer. */
|
|
495
914
|
declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
|
|
496
915
|
|
|
497
|
-
export { type CreateKeepKitOptions, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionFeature, type KeepCollectionProps, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepImageProps, KeepItemCard, type KeepItemCardLinkProps, type KeepItemCardProps, type KeepItemCardState, KeepItemCheckbox, type KeepItemCheckboxProps, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListState, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, type KeepPagesRouterLike, KeepPagination, type KeepPaginationProps, type KeepPaginationState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStaleNotice, type KeepStaleNoticeProps, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepSyncRecoveryDialog, type KeepSyncRecoveryDialogProps, KeepSyncStatusBanner, type KeepSyncStatusBannerProps, KeepTagEditor, type KeepTagEditorProps, type KeepTagEditorState, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepThemeDensity, type KeepThemeMode, type KeepThemeName, KeepThemeProvider, type KeepThemeProviderProps, type KeepThemeRadius, type KeepThemeVariables, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, type RenderProp, createKeepKit, createNextPagesRouterAdapter, getKeepLocaleLabels, isAllSelected, keepThemeNames, toggleSelectAll, useKeepUiLabels, useKeepUrlSync };
|
|
916
|
+
export { type CreateKeepKitOptions, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionFeature, type KeepCollectionProps, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionsProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, KeepItemCardSkeleton, type KeepItemCardSkeletonProps, type KeepItemCardState, type KeepItemCardTagsProps, type KeepItemCardTitleProps, KeepItemCheckbox, type KeepItemCheckboxProps, KeepItemStatusBadge, type KeepItemStatusBadgeProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepLayout, type KeepLayoutPreset, type KeepLayoutProps, KeepList, type KeepListProps, type KeepListState, KeepNavigator, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, type KeepPagesRouterLike, KeepPagination, type KeepPaginationProps, type KeepPaginationState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStaleNotice, type KeepStaleNoticeProps, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepSyncRecoveryDialog, type KeepSyncRecoveryDialogProps, KeepSyncStatusBanner, type KeepSyncStatusBannerProps, KeepTagEditor, type KeepTagEditorProps, type KeepTagEditorState, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepThemeDensity, type KeepThemeMode, type KeepThemeName, KeepThemeProvider, type KeepThemeProviderProps, type KeepThemeRadius, type KeepThemeVariables, type KeepToastFeedbackOptions, type KeepToastHandler, KeepTourBar, type KeepTourBarProps, type KeepTourShortcutsOptions, type KeepUiFeedbackEvent, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, type RenderProp, createKeepKit, createNextPagesRouterAdapter, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, toggleSelectAll, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };
|