@keepkit/ui 0.5.0 → 0.7.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 CHANGED
@@ -32,7 +32,7 @@ function SavedArticles() {
32
32
  }
33
33
  ```
34
34
 
35
- `keep.Collection`は検索、ソート、ページング、loading / empty / error、ARIA live通知を標準で提供します。`features={{ tagFilter: true, bulkActions: true }}`でタグフィルターと一括操作も有効にできます。個別の`KeepList`、`KeepSearchInput`、`KeepSortSelect`、`KeepPagination`などは高度なレイアウト用に利用できます。
35
+ `keep.Collection`は検索、ソート、ページング、loading / empty / error、ARIA live通知を標準で提供します。検索は既定で300msデバウンスされます。`features={{ tagFilter: true, bulkActions: true }}`でタグフィルターと一括操作も有効にできます。個別の`KeepList`、`KeepSearchInput`、`KeepSortSelect`、`KeepPagination`、`KeepItemCheckbox`、`KeepTagEditor`などは高度なレイアウト用に利用できます。`KeepBulkActions`はrender propsで操作UIを差し替えられます。`KeepNoteEditor`は既定300msのデバウンス保存に対応し、`debounceMs={0}`でフォーム送信のみへ戻せます。通知領域だけを明示的に置く場合は`KeepAnnouncer`(`KeepAnnouncements`のalias)を使えます。
36
36
 
37
37
  一覧のqueryは次の形式に統一されています。
38
38
 
@@ -81,7 +81,7 @@ function SavedArticles() {
81
81
  }
82
82
  ```
83
83
 
84
- `keep.Collection` includes search, sorting, pagination, loading/empty/error states, and polite live announcements. Enable `features={{ tagFilter: true, bulkActions: true }}` for tag filtering and bulk operations. Use the individual `KeepList`, `KeepSearchInput`, `KeepSortSelect`, and `KeepPagination` primitives when you need a custom layout.
84
+ `keep.Collection` includes search, sorting, pagination, loading/empty/error states, and polite live announcements. Search is debounced by 300ms by default. Enable `features={{ tagFilter: true, bulkActions: true }}` for tag filtering and bulk operations. Use the individual `KeepList`, `KeepSearchInput`, `KeepSortSelect`, `KeepPagination`, `KeepItemCheckbox`, and `KeepTagEditor` primitives when you need a custom layout. `KeepBulkActions` supports render props for replacing its operation UI. `KeepNoteEditor` auto-saves dirty notes after 300ms by default; set `debounceMs={0}` to use form submission only. Mount `KeepAnnouncer` (`KeepAnnouncements` alias) when you need the live region explicitly.
85
85
 
86
86
  Collection queries use one canonical shape: `targetType`, `tags`, `search`, `sort`, `pagination`, `filter`, and `savedBetween`. Saved item inputs contain only `id`, `meta`, `targetType`, `note`, and `tags`; KeepKit owns persistence timestamps.
87
87
 
package/dist/index.d.ts CHANGED
@@ -1,50 +1,11 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, ImgHTMLAttributes, HTMLAttributes, ComponentType, ReactElement, FormHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes } from 'react';
3
- import { KeepItem, KeepListQuery, KeepItemInput } from '@keepkit/core/core';
2
+ import { ReactNode, HTMLAttributes, ImgHTMLAttributes, ComponentType, InputHTMLAttributes, FormHTMLAttributes, SelectHTMLAttributes } from 'react';
3
+ import { KeepListQuery, KeepItem, KeepItemInput } from '@keepkit/core/core';
4
4
  export { KeepItem, KeepItemInput, KeepListQuery, KeepSyncStatus } from '@keepkit/core/core';
5
- import { CreateKeepKitOptions as CreateKeepKitOptions$1, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepProviderProps, useKeepContext, useKeepItem, KeepShortcutOptions } from '@keepkit/core/react';
6
- export { KeepContextValue, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepContext, useKeepItem, useKeepList, useKeepShortcut } from '@keepkit/core/react';
5
+ import { KeepButtonProps as KeepButtonProps$1, UseKeepListResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepItem, useKeepList, KeepShortcutOptions } from '@keepkit/core/react';
6
+ export { KeepButtonState, KeepContextValue, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepContext, useKeepItem, useKeepList, 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" | "filterTags" | "note" | "saveNote" | "noItems" | "loadingItems" | "errorItems" | "search" | "sort" | "newest" | "oldest" | "previousPage" | "nextPage" | "pagination" | "page" | "selectItems" | "selectedCount" | "deleteSelected" | "tagsToApply" | "applyTags" | "savedMessage" | "removedMessage" | "noteSavedMessage";
10
- type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
11
- type KeepUiLabelContext = {
12
- locale?: string;
13
- labels: Readonly<Record<KeepUiLabelKey, string>>;
14
- labelResolver?: (key: KeepUiLabelKey, context: {
15
- locale?: string;
16
- }) => string | undefined;
17
- };
18
- type KeepUiProviderProps = {
19
- labels?: KeepUiLabels;
20
- locale?: string;
21
- labelResolver?: KeepUiLabelContext["labelResolver"];
22
- children?: ReactNode;
23
- };
24
- /** Provides one locale-aware label source to every UI primitive. */
25
- declare function KeepUiProvider({ labels, locale, labelResolver, children }: KeepUiProviderProps): react.JSX.Element;
26
- type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps, "children"> & {
27
- children?: ReactNode;
28
- };
29
- /** Combines the core store and UI labels into the default application provider. */
30
- declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, locale, labelResolver, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
31
- declare function useKeepUiLabels(): KeepUiLabelContext;
32
-
33
- type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps, "children"> & {
34
- getTitle?: (item: KeepItem<TMeta>) => ReactNode;
35
- getImageProps?: (item: KeepItem<TMeta>, title: ReactNode) => KeepImageProps | undefined;
36
- };
37
- type KeepKit<TMeta = Record<string, unknown>> = {
38
- Provider: ComponentType<KeepKitProviderProps<TMeta>>;
39
- Button: ComponentType<KeepButtonProps<TMeta>>;
40
- Collection: ComponentType<KeepCollectionProps<TMeta>>;
41
- useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
42
- useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
43
- useList: (query?: KeepListQuery<TMeta>) => UseKeepListResult<TMeta>;
44
- useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
45
- };
46
- /** Create one typed application API for the core and the standard UI layer. */
47
- declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
48
9
  type RenderProp<TState> = (state: TState) => ReactNode;
49
10
  type KeepButtonLabels = {
50
11
  saved?: ReactNode;
@@ -54,11 +15,39 @@ type KeepButtonLabels = {
54
15
  savedAriaLabel?: string;
55
16
  unsavedAriaLabel?: string;
56
17
  };
18
+
19
+ type KeepBulkActionsState<TMeta = Record<string, unknown>> = {
20
+ items: KeepItem<TMeta>[];
21
+ selectedIds: string[];
22
+ selectedCount: number;
23
+ allSelected: boolean;
24
+ tagsInput: string;
25
+ setTagsInput: (value: string) => void;
26
+ toggle: (id: string) => void;
27
+ toggleAll: () => void;
28
+ remove: () => Promise<void>;
29
+ updateTags: () => Promise<void>;
30
+ isMutating: boolean;
31
+ };
32
+ type KeepBulkActionsProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
33
+ query?: KeepListQuery<TMeta>;
34
+ selectedIds?: string[];
35
+ defaultSelectedIds?: string[];
36
+ onSelectedIdsChange?: (ids: string[]) => void;
37
+ renderItem?: (item: KeepItem<TMeta>, selected: boolean) => ReactNode;
38
+ onCompleted?: (action: "remove" | "tags", ids: string[]) => void;
39
+ render?: RenderProp<KeepBulkActionsState<TMeta>>;
40
+ children?: ReactNode | RenderProp<KeepBulkActionsState<TMeta>>;
41
+ };
42
+ /** Selects visible items and performs one storage operation for the whole selection. */
43
+ declare function KeepBulkActions<TMeta = Record<string, unknown>>({ query, selectedIds: controlledSelectedIds, defaultSelectedIds, onSelectedIdsChange, renderItem, onCompleted, render, children, ...props }: KeepBulkActionsProps<TMeta>): react.JSX.Element;
44
+
57
45
  type KeepButtonProps<TMeta = Record<string, unknown>> = KeepButtonProps$1<TMeta> & {
58
46
  labels?: KeepButtonLabels;
59
47
  };
60
48
  /** A style-free save toggle with localized labels and the core button's ARIA/asChild behavior. */
61
49
  declare function KeepButton<TMeta = Record<string, unknown>>({ labels, ...props }: KeepButtonProps<TMeta>): react.JSX.Element;
50
+
62
51
  type KeepItemCardState<TMeta = Record<string, unknown>> = {
63
52
  item: KeepItem<TMeta>;
64
53
  isSaved: boolean;
@@ -88,7 +77,8 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
88
77
  asChild?: boolean;
89
78
  };
90
79
  /** A low-dependency item presentation primitive. The default markup can be replaced with render props. */
91
- declare function KeepItemCard<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, showSaveButton, saveButtonLabels, asChild, className, ...rootProps }: KeepItemCardProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
80
+ declare function KeepItemCard<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, showSaveButton, saveButtonLabels, asChild, className, ...rootProps }: KeepItemCardProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
81
+
92
82
  type KeepListState<TMeta = Record<string, unknown>> = UseKeepListResult<TMeta>;
93
83
  type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
94
84
  query?: KeepListQuery<TMeta>;
@@ -101,7 +91,8 @@ type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLEl
101
91
  asChild?: boolean;
102
92
  };
103
93
  /** A list primitive with built-in loading, empty, error, and removal states. */
104
- declare function KeepList<TMeta = Record<string, unknown>>({ query, children, renderItem, loading, empty, error: errorContent, itemCardProps, asChild, className, ...rootProps }: KeepListProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
94
+ declare function KeepList<TMeta = Record<string, unknown>>({ query, children, renderItem, loading, empty, error: errorContent, itemCardProps, asChild, className, ...rootProps }: KeepListProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
95
+
105
96
  type KeepCollectionFeature = "search" | "sort" | "pagination" | "tagFilter" | "bulkActions";
106
97
  type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
107
98
  query?: KeepListQuery<TMeta>;
@@ -115,27 +106,16 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
115
106
  };
116
107
  /** A batteries-included collection with query controls and accessible status feedback. */
117
108
  declare function KeepCollection<TMeta = Record<string, unknown>>({ query, pageSize, features, renderItem, itemCardProps, loading, empty, error, className, ...rootProps }: KeepCollectionProps<TMeta>): react.JSX.Element;
118
- type KeepTagFilterState = {
119
- tags: string[];
120
- tagCounts: Record<string, number>;
121
- value?: string;
122
- select: (tag?: string) => void;
123
- };
124
- type KeepTagFilterProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children" | "onChange"> & {
125
- query?: KeepListQuery<TMeta>;
126
- value?: string;
127
- defaultValue?: string;
128
- onChange?: (tag?: string) => void;
129
- onValueChange?: (tag?: string) => void;
130
- allLabel?: ReactNode;
131
- ariaLabel?: string;
132
- renderTag?: (tag: string, count: number, selected: boolean) => ReactNode;
133
- render?: RenderProp<KeepTagFilterState>;
134
- children?: ReactNode | RenderProp<KeepTagFilterState>;
135
- asChild?: boolean;
109
+
110
+ type KeepItemCheckboxProps<TMeta = Record<string, unknown>> = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "checked" | "defaultChecked" | "onChange"> & {
111
+ item: KeepItem<TMeta>;
112
+ checked?: boolean;
113
+ label?: ReactNode;
114
+ onCheckedChange?: (checked: boolean) => void;
136
115
  };
137
- /** An ARIA button group for tag filtering; consumers can connect value to a collection query. */
138
- declare function KeepTagFilter<TMeta = Record<string, unknown>>({ query, value: controlledValue, defaultValue, onChange, onValueChange, allLabel, ariaLabel, renderTag, render, children, asChild, className, ...rootProps }: KeepTagFilterProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
116
+ /** A reusable accessible selection checkbox for a saved item. */
117
+ declare function KeepItemCheckbox<TMeta = Record<string, unknown>>({ item, checked, label, onCheckedChange, "aria-label": ariaLabel, ...props }: KeepItemCheckboxProps<TMeta>): react.JSX.Element;
118
+
139
119
  type KeepNoteEditorState<TMeta = Record<string, unknown>> = {
140
120
  item: KeepItem<TMeta>;
141
121
  note: string;
@@ -150,6 +130,8 @@ type KeepNoteEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribu
150
130
  label?: ReactNode;
151
131
  saveLabel?: ReactNode;
152
132
  placeholder?: string;
133
+ /** Automatically save dirty notes after this delay; set to 0 to disable auto-save. */
134
+ debounceMs?: number;
153
135
  onSaved?: (note?: string) => void;
154
136
  onSaveError?: (error: unknown) => void;
155
137
  render?: RenderProp<KeepNoteEditorState<TMeta>>;
@@ -157,14 +139,55 @@ type KeepNoteEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribu
157
139
  asChild?: boolean;
158
140
  };
159
141
  /** A controlled-by-default note editor that persists through useKeepItem. */
160
- declare function KeepNoteEditor<TMeta = Record<string, unknown>>({ item, label, saveLabel, placeholder, onSaved, onSaveError, render, children, asChild, className, ...formProps }: KeepNoteEditorProps<TMeta>): react.JSX.Element;
142
+ declare function KeepNoteEditor<TMeta = Record<string, unknown>>({ item, label, saveLabel, placeholder, debounceMs, onSaved, onSaveError, render, children, asChild, className, ...formProps }: KeepNoteEditorProps<TMeta>): react.JSX.Element;
143
+
144
+ type KeepTagEditorState = {
145
+ tags: string[];
146
+ setTags: (tags: string[]) => void;
147
+ save: () => Promise<void>;
148
+ isSaving: boolean;
149
+ };
150
+ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttributes<HTMLFormElement>, "children" | "onSubmit"> & {
151
+ item: KeepItem<TMeta>;
152
+ availableTags?: string[];
153
+ onSaved?: (tags?: string[]) => void;
154
+ onSaveError?: (error: unknown) => void;
155
+ render?: RenderProp<KeepTagEditorState>;
156
+ };
157
+ /** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
158
+ declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
159
+
160
+ type KeepTagFilterState = {
161
+ tags: string[];
162
+ tagCounts: Record<string, number>;
163
+ value?: string;
164
+ select: (tag?: string) => void;
165
+ };
166
+ type KeepTagFilterProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children" | "onChange"> & {
167
+ query?: KeepListQuery<TMeta>;
168
+ value?: string;
169
+ defaultValue?: string;
170
+ onChange?: (tag?: string) => void;
171
+ onValueChange?: (tag?: string) => void;
172
+ allLabel?: ReactNode;
173
+ ariaLabel?: string;
174
+ renderTag?: (tag: string, count: number, selected: boolean) => ReactNode;
175
+ render?: RenderProp<KeepTagFilterState>;
176
+ children?: ReactNode | RenderProp<KeepTagFilterState>;
177
+ asChild?: boolean;
178
+ };
179
+ /** An ARIA button group for tag filtering; consumers can connect value to a collection query. */
180
+ 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>>;
181
+
161
182
  type KeepSearchInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> & {
162
183
  value?: string;
163
184
  defaultValue?: string;
185
+ /** Delay before notifying consumers; set to 0 to disable debouncing. */
186
+ debounceMs?: number;
164
187
  onValueChange?: (value: string) => void;
165
188
  };
166
- /** A controlled/uncontrolled search field for wiring into KeepListQuery.search. */
167
- declare function KeepSearchInput({ value: controlledValue, defaultValue, onValueChange, "aria-label": ariaLabel, placeholder, ...props }: KeepSearchInputProps): react.JSX.Element;
189
+ /** A controlled/uncontrolled search field with a small built-in debounce. */
190
+ declare function KeepSearchInput({ value: controlledValue, defaultValue, debounceMs, onValueChange, "aria-label": ariaLabel, placeholder, ...props }: KeepSearchInputProps): react.JSX.Element;
168
191
  type KeepSortValue = "savedAt:desc" | "savedAt:asc" | "updatedAt:desc" | "updatedAt:asc";
169
192
  type KeepSortSelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange"> & {
170
193
  value?: KeepSortValue;
@@ -173,43 +196,22 @@ type KeepSortSelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "value"
173
196
  };
174
197
  /** Emits a normalized sort descriptor that can be passed directly to useKeepList. */
175
198
  declare function KeepSortSelect({ value: controlledValue, defaultValue, onValueChange, "aria-label": ariaLabel, children, ...props }: KeepSortSelectProps): react.JSX.Element;
176
- type KeepPaginationProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
199
+ type KeepPaginationState = {
200
+ page: number;
201
+ pageCount: number;
202
+ goToPage: (page: number) => void;
203
+ };
204
+ type KeepPaginationProps = Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
177
205
  totalCount: number;
178
206
  pageSize: number;
179
207
  page?: number;
208
+ maxPageButtons?: number;
180
209
  onPageChange?: (page: number, offset: number) => void;
181
- render?: RenderProp<{
182
- page: number;
183
- pageCount: number;
184
- goToPage: (page: number) => void;
185
- }>;
186
- };
187
- /** A small accessible pagination control using one-based pages and zero-based offsets. */
188
- declare function KeepPagination({ totalCount, pageSize, page, onPageChange, render, ...props }: KeepPaginationProps): react.JSX.Element;
189
- type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttributes<HTMLFormElement>, "children" | "onSubmit"> & {
190
- item: KeepItem<TMeta>;
191
- availableTags?: string[];
192
- onSaved?: (tags?: string[]) => void;
193
- onSaveError?: (error: unknown) => void;
194
- render?: RenderProp<{
195
- tags: string[];
196
- setTags: (tags: string[]) => void;
197
- save: () => Promise<void>;
198
- isSaving: boolean;
199
- }>;
200
- };
201
- /** Edits one item's normalized tag set and exposes a render-prop escape hatch. */
202
- declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
203
- type KeepBulkActionsProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
204
- query?: KeepListQuery<TMeta>;
205
- selectedIds?: string[];
206
- defaultSelectedIds?: string[];
207
- onSelectedIdsChange?: (ids: string[]) => void;
208
- renderItem?: (item: KeepItem<TMeta>, selected: boolean) => ReactNode;
209
- onCompleted?: (action: "remove" | "tags", ids: string[]) => void;
210
+ render?: (state: KeepPaginationState) => ReactNode;
210
211
  };
211
- /** Selects visible items and performs one storage operation for the whole selection. */
212
- declare function KeepBulkActions<TMeta = Record<string, unknown>>({ query, selectedIds: controlledSelectedIds, defaultSelectedIds, onSelectedIdsChange, renderItem, onCompleted, ...props }: KeepBulkActionsProps<TMeta>): react.JSX.Element;
212
+ /** Accessible pagination with previous/next controls and numbered page buttons. */
213
+ declare function KeepPagination({ totalCount, pageSize, page, maxPageButtons, onPageChange, render, ...props }: KeepPaginationProps): react.JSX.Element;
214
+
213
215
  type KeepEmptyStateProps = Omit<HTMLAttributes<HTMLElement>, "children" | "title"> & {
214
216
  title?: ReactNode;
215
217
  description?: ReactNode;
@@ -218,7 +220,7 @@ type KeepEmptyStateProps = Omit<HTMLAttributes<HTMLElement>, "children" | "title
218
220
  asChild?: boolean;
219
221
  };
220
222
  /** A style-free, reusable empty collection state. */
221
- declare function KeepEmptyState({ title, description, action, children, asChild, className, ...rootProps }: KeepEmptyStateProps): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
223
+ declare function KeepEmptyState({ title, description, action, children, asChild, className, ...rootProps }: KeepEmptyStateProps): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
222
224
  type KeepStatusValue = "idle" | "empty" | "loading" | "saving" | "syncing" | "error";
223
225
  type KeepStatusLabels = Partial<Record<KeepStatusValue, ReactNode>>;
224
226
  type KeepStatusState<TMeta = Record<string, unknown>> = {
@@ -235,11 +237,54 @@ type KeepStatusProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTML
235
237
  asChild?: boolean;
236
238
  };
237
239
  /** Presents provider loading, mutation, synchronization, empty, and error states accessibly. */
238
- declare function KeepStatus<TMeta = Record<string, unknown>>({ status, labels, children, render, asChild, className, ...rootProps }: KeepStatusProps<TMeta>): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
240
+ declare function KeepStatus<TMeta = Record<string, unknown>>({ status, labels, children, render, asChild, className, ...rootProps }: KeepStatusProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
239
241
  type KeepAnnouncementsProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
240
242
  messages?: Partial<Record<"save" | "remove" | "note", string>>;
241
243
  };
242
244
  /** Announces successful save, remove, and note operations in a polite live region. */
243
245
  declare function KeepAnnouncements<TMeta = Record<string, unknown>>({ messages, ...props }: KeepAnnouncementsProps): react.JSX.Element;
246
+ /** Singular alias for applications that mount one announcer explicitly. */
247
+ declare const KeepAnnouncer: typeof KeepAnnouncements;
248
+
249
+ type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "allTags" | "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" | "noteSavedMessage";
250
+ type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
251
+ type KeepUiLabelContext = {
252
+ locale?: string;
253
+ labels: Readonly<Record<KeepUiLabelKey, string>>;
254
+ labelResolver?: (key: KeepUiLabelKey, context: {
255
+ locale?: string;
256
+ }) => string | undefined;
257
+ };
258
+ type KeepUiProviderProps = {
259
+ labels?: KeepUiLabels;
260
+ locale?: string;
261
+ labelResolver?: KeepUiLabelContext["labelResolver"];
262
+ children?: ReactNode;
263
+ };
264
+ /** Provides one locale-aware label source to every UI primitive. */
265
+ declare function KeepUiProvider({ labels, locale, labelResolver, children }: KeepUiProviderProps): react.JSX.Element;
266
+ declare function useKeepUiLabels(): KeepUiLabelContext;
267
+
268
+ type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps, "children"> & {
269
+ children?: ReactNode;
270
+ };
271
+ /** Combines the core store, UI labels, and the global live announcer. */
272
+ declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, locale, labelResolver, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
273
+
274
+ type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps, "children"> & {
275
+ getTitle?: (item: KeepItem<TMeta>) => ReactNode;
276
+ getImageProps?: (item: KeepItem<TMeta>, title: ReactNode) => KeepImageProps | undefined;
277
+ };
278
+ type KeepKit<TMeta = Record<string, unknown>> = {
279
+ Provider: ComponentType<KeepKitProviderProps<TMeta>>;
280
+ Button: ComponentType<KeepButtonProps<TMeta>>;
281
+ Collection: ComponentType<KeepCollectionProps<TMeta>>;
282
+ useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
283
+ useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
284
+ useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
285
+ useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
286
+ };
287
+ /** Create one typed application API for the core and standard UI layer. */
288
+ declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
244
289
 
245
- export { type CreateKeepKitOptions, KeepAnnouncements, type KeepAnnouncementsProps, KeepBulkActions, type KeepBulkActionsProps, KeepButton, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionFeature, type KeepCollectionProps, KeepEmptyState, type KeepEmptyStateProps, type KeepImageProps, KeepItemCard, type KeepItemCardProps, type KeepItemCardState, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepList, type KeepListProps, type KeepListState, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, KeepPagination, type KeepPaginationProps, KeepSearchInput, type KeepSearchInputProps, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepTagEditor, type KeepTagEditorProps, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabels, KeepUiProvider, type KeepUiProviderProps, type RenderProp, createKeepKit, useKeepUiLabels };
290
+ export { type CreateKeepKitOptions, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionFeature, type KeepCollectionProps, KeepEmptyState, type KeepEmptyStateProps, type KeepImageProps, KeepItemCard, type KeepItemCardProps, type KeepItemCardState, KeepItemCheckbox, type KeepItemCheckboxProps, type KeepKit, KeepKitProvider, type KeepKitProviderProps, KeepList, type KeepListProps, type KeepListState, KeepNoteEditor, type KeepNoteEditorProps, type KeepNoteEditorState, KeepPagination, type KeepPaginationProps, type KeepPaginationState, KeepSearchInput, type KeepSearchInputProps, KeepSortSelect, type KeepSortSelectProps, type KeepSortValue, KeepStatus, type KeepStatusLabels, type KeepStatusProps, type KeepStatusState, type KeepStatusValue, KeepTagEditor, type KeepTagEditorProps, type KeepTagEditorState, KeepTagFilter, type KeepTagFilterProps, type KeepTagFilterState, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabels, KeepUiProvider, type KeepUiProviderProps, type RenderProp, createKeepKit, useKeepUiLabels };