@keepkit/ui 0.23.2 → 0.25.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
@@ -31,7 +31,7 @@ export function SavedArticle({ article }: { article: Meta & { id: string } }) {
31
31
  }
32
32
  ```
33
33
 
34
- すべてのプリミティブは`data-state`を公開し、処理中は`data-loading="true"`、無効時は`data-disabled="true"`になります。`@keepkit/ui/theme.css`を読み込むと、標準の枠、面色、影、フォーカス表示と装飾アイコンが有効になります。個別の操作は`data-keep-action`で選択でき、`--keep-icon-size`、`--keep-control-gap`、`--keep-shadow`、`--keep-success`、`--keep-warning`で調整できます。CSSを読み込まないheadless利用と`KeepButton icons`による差し替えは維持されます。
34
+ すべてのプリミティブは`data-state`を公開し、処理中は`data-loading="true"`、無効時は`data-disabled="true"`になります。`@keepkit/ui/theme.css`を読み込むと、標準の枠、面色、影、フォーカス表示と装飾アイコンが有効になります。通常の削除・一括削除・stale削除は薄い赤の枠線と文字色、hover時の淡い面色で表示し、強い赤の塗りつぶしは確認が必要なエラー状態に限定します。個別の操作は`data-keep-action`で選択でき、`--keep-icon-size`、`--keep-control-gap`、`--keep-shadow`、`--keep-success`、`--keep-warning`で調整できます。CSSを読み込まないheadless利用と`KeepButton icons`による差し替えは維持されます。
35
35
 
36
36
  ```tsx
37
37
  import "@keepkit/ui/theme.css";
@@ -57,10 +57,19 @@ function SavedArticles() {
57
57
  ```
58
58
 
59
59
  `keep.Collection`は検索、ソート、ページング、loading / empty / error、ARIA live通知を標準で提供します。検索は既定で300msデバウンスされます。`features={{ tagFilter: true, bulkActions: true }}`でタグフィルターと一括操作も有効にできます。個別の`KeepList`、`KeepSearchInput`、`KeepSortSelect`、`KeepPagination`、`KeepItemCheckbox`、`KeepTagEditor`などは高度なレイアウト用に利用できます。`KeepBulkActions`はrender propsで操作UIを差し替えられ、`isAllSelected` / `toggleSelectAll`で表示中アイテムを一括操作できます。`KeepNoteEditor`は既定300msのデバウンス保存に対応し、`debounceMs={0}`でフォーム送信のみへ戻せます。通知領域だけを明示的に置く場合は`KeepAnnouncer`(`KeepAnnouncements`のalias)を使えます。
60
+ `KeepWorkspace`はこれらのプリミティブを一つにまとめ、`basic`、`standard`、`management`、`sync`のプリセットを提供します。`createKeepKit()`を利用する場合は同じ実装を`keep.Workspace`から型付きで利用できます。`modules`、`slots`、子コンポーネントごとのpropsで部分的に差し替えられます。
61
+
62
+ ```tsx
63
+ const keep = createKeepKit<ArticleMeta>({ storage, locale: "ja" });
64
+
65
+ <keep.Provider>
66
+ <keep.Workspace preset="sync" collectionProps={{ layout: "auto" }} />
67
+ </keep.Provider>;
68
+ ```
60
69
  一覧の標準カードで必要な機能だけを有効化する場合は、`features={{ pin: true, archive: true, tags: false }}`を指定できます。`pin` / `archive` はカード操作ボタン、`tags` はカード内のタグ表示を切り替えます。タグフィルターは`tagFilter`、タグ編集は`KeepTagEditor`で個別に制御でき、`itemCardProps`の明示指定が`features`より優先されます。
61
70
  `KeepCollection`は検索語と選択タグを`KeepActiveFiltersSummary`のチップとして表示し、個別解除と「すべての条件をクリア」を提供します。`activeFilters`でこの領域を差し替えられます。標準の`KeepList` / `KeepCollection`は、全件0件の`empty-storage`と絞り込み結果0件の`empty-filtered`を区別し、後者では`onClearFilters`付きの解除ボタンを表示します。
62
71
  `KeepItemCard`は`href`、`onOpen`、`linkTarget`、`linkComponent`に対応し、保存アイテムから詳細ページへ遷移できます。非公開・期限切れ等の`status`を持つアイテムは自動的にリンクを無効化します。`KeepBackup`はJSONのエクスポート、merge / replaceインポート、結果件数、容量エラー表示を提供します。
63
- `KeepTourBar`(alias: `KeepNavigator`)は進行度、前へ・次へ、一覧へ戻る操作をURLまたはコールバックで提供します。前後ボタンには隣接アイテム名のプレビューが付き、`getItemTitle`で表示名を差し替えられます。`keyboardShortcuts`を指定するとJ/Kまたは]/[で巡回でき、`useKeepTourShortcuts`ではキーと動作を個別に差し替えられます。`KeepReorderableList`はドラッグ操作と矢印キーによる並び替えを提供し、ドラッグ中の挿入位置を表示します。
72
+ `KeepTourBar`(alias: `KeepNavigator`)は進行度、前へ・次へ、一覧へ戻る操作をURLまたはコールバックで提供します。`getItemHref`、`getBackHref`、`onNavigate`でホストのルーティングを注入できます。前後ボタンには隣接アイテム名のプレビューが付き、`getItemTitle`で表示名を差し替えられます。`keyboardShortcuts`を指定するとJ/Kまたは]/[で巡回でき、`useKeepTourShortcuts`ではキーと動作を個別に差し替えられます。`KeepReorderableList`はドラッグ操作と矢印キーによる並び替えを提供し、ドラッグ中の挿入位置を表示します。`KeepCollection reorderable`ではこの導線と標準Undoを差し替えなしで利用できます。
64
73
  `KeepShortcutHint`はセマンティックな`<kbd>`バッジを表示します。`KeepTourBar showShortcutHint`は前へ/次へのキーを、`KeepNoteEditor showShortcutHint`は`Ctrl+Enter`を標準ボタン内に表示します。`mergeProps` / `createSlot`は`asChild`でclassName、style、ARIA属性、イベント、子と親のrefを合成し、`composeRefs`はcallback refとobject refをまとめる共通基盤です。フィルターチップは削除後に隣接チップへ戻り、ArrowLeft / ArrowRightで移動できます。
65
74
  `KeepList`や`KeepCollection`のカードは検索語を大文字小文字を区別せず`<mark class="keep-highlight" data-highlight="true">`で表示します。単体の`KeepItemCard`では`highlightQuery`、任意のテキストでは`KeepHighlight`を使えます。`KeepItemCard.Media`は読み込み状態を`data-media-status`で公開し、失敗時は`fallback`または標準SVGへ切り替わります。
66
75
  テーマCSSではハイライト用の`--keep-highlight-bg` / `--keep-highlight-fg`(ライト/ダーク対応)、タイトル2行・メモプレビュー3行の制限、メディアの固定アスペクト比を適用します。`KeepItemStatusBadge`は状態ラベルに加えてチェック・時計・進入禁止・鍵のSVGアイコンを表示し、状態ごとの形状とトーンを組み合わせます。個別の状態スタイルは`@keepkit/ui/styles/status.css`からも読み込めます。
@@ -94,7 +103,7 @@ const onFeedback = useKeepToastFeedback(toast);
94
103
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
95
104
  ```
96
105
 
97
- v0.23.2では一覧の標準カードでピン留め・アーカイブ・タグ表示を個別に切り替えられるようにしました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。保存直後の`KeepSavePopover`自動編集、`KeepQuickEditorState.saveStatus`、`KeepItemCard.Save` / `KeepItemCard.Remove`、管理モード向け`KeepBulkActions`、通知からのコレクション再訪導線も引き続き利用できます。
106
+ v0.25.0では`KeepWorkspace`と型付きの`keep.Workspace`を追加しました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。保存直後の`KeepSavePopover`自動編集、`KeepQuickEditorState.saveStatus`、`KeepItemCard.Save` / `KeepItemCard.Remove`、管理モード向け`KeepBulkActions`、通知からのコレクション再訪導線も引き続き利用できます。
98
107
  Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
99
108
 
100
109
  ### Tailwind/shadcnテーマ
@@ -185,12 +194,21 @@ function SavedArticles() {
185
194
  ```
186
195
 
187
196
  `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 and exposes `isAllSelected` / `toggleSelectAll` for visible-item selection. `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.
197
+ `KeepWorkspace` composes these primitives into `basic`, `standard`, `management`, and `sync` presets. `createKeepKit()` exposes the same implementation as a typed `keep.Workspace`. Override individual areas through `modules`, `slots`, and child-component props.
198
+
199
+ ```tsx
200
+ const keep = createKeepKit<ArticleMeta>({ storage, locale: "en" });
201
+
202
+ <keep.Provider>
203
+ <keep.Workspace preset="sync" collectionProps={{ layout: "auto" }} />
204
+ </keep.Provider>;
205
+ ```
188
206
  Enable only the standard card features you need with `features={{ pin: true, archive: true, tags: false }}`. `pin` and `archive` toggle card action buttons, while `tags` controls tag display inside cards. Tag filtering remains independently controlled by `tagFilter`, tag editing by `KeepTagEditor`, and explicit `itemCardProps` values take precedence over `features`.
189
207
  `KeepCollection` renders the current search and tag filters as `KeepActiveFiltersSummary` chips with individual removal and a “Clear all filters” action. Replace that area with the `activeFilters` slot. Default `KeepList` / `KeepCollection` output distinguishes `empty-storage` from `empty-filtered`; the filtered state includes a reset button when `onClearFilters` is provided.
190
208
 
191
- The opt-in theme adds neutral borders, surfaces, shadows, focus treatment, and decorative action icons without changing accessible names. Target individual controls with `data-keep-action`, or override `--keep-icon-size`, `--keep-control-gap`, `--keep-shadow`, `--keep-success`, and `--keep-warning`. Consumers that omit the CSS keep the headless markup, and `KeepButton icons` continues to take precedence over the built-in icon.
209
+ The opt-in theme adds neutral borders, surfaces, shadows, focus treatment, and decorative action icons without changing accessible names. Regular remove, bulk-delete, and stale-prune actions use a subtle red outline and text with a light hover surface; solid red is reserved for error states that need confirmation. Target individual controls with `data-keep-action`, or override `--keep-icon-size`, `--keep-control-gap`, `--keep-shadow`, `--keep-success`, and `--keep-warning`. Consumers that omit the CSS keep the headless markup, and `KeepButton icons` continues to take precedence over the built-in icon.
192
210
  `KeepItemCard` accepts `href`, `onOpen`, `linkTarget`, and `linkComponent` for detail-page navigation. Links are disabled for unavailable `status` values such as private or expired. `KeepBackup` provides JSON export, merge/replace import, result counts, and quota-error messaging.
193
- `KeepTourBar` (aliased as `KeepNavigator`) provides progress, previous/next, and return-to-list actions through URLs or callbacks. Adjacent item titles are previewed below the navigation labels; customize them with `getItemTitle`. Set `keyboardShortcuts` for J/K or ]/[ tour navigation, or use `useKeepTourShortcuts` for custom bindings. `KeepReorderableList` supports drag and keyboard reordering and shows the active insertion position.
211
+ `KeepTourBar` (aliased as `KeepNavigator`) provides progress, previous/next, and return-to-list actions through URLs or callbacks. Inject host routing with `getItemHref`, `getBackHref`, and `onNavigate`. Adjacent item titles are previewed below the navigation labels; customize them with `getItemTitle`. Set `keyboardShortcuts` for J/K or ]/[ tour navigation, or use `useKeepTourShortcuts` for custom bindings. `KeepReorderableList` supports drag and keyboard reordering and shows the active insertion position; `KeepCollection reorderable` includes that path and standard undo without a slot replacement.
194
212
  `KeepShortcutHint` renders semantic `<kbd>` badges. `KeepTourBar showShortcutHint` displays the previous/next keys, while `KeepNoteEditor showShortcutHint` displays `Ctrl+Enter` in the save button. `mergeProps` / `createSlot` compose className, style, ARIA, events, and child/parent refs for `asChild` slots; `composeRefs` combines callback and object refs. Filter chips restore focus to an adjacent chip after removal and support ArrowLeft / ArrowRight navigation.
195
213
  Cards rendered by `KeepList` and `KeepCollection` highlight case-insensitive search matches with `<mark class="keep-highlight" data-highlight="true">`. Use `highlightQuery` on a standalone `KeepItemCard` or `KeepHighlight` for arbitrary text. `KeepItemCard.Media` exposes its loading state through `data-media-status` and replaces failed images with `fallback` or the built-in SVG placeholder.
196
214
  The theme defines WCAG-oriented `--keep-highlight-bg` / `--keep-highlight-fg` pairs for light and dark modes, clamps titles to two lines and memo previews to three, and reserves a stable media aspect ratio. `KeepItemStatusBadge` combines visible status text with check, clock, ban, or lock SVG icons; import `@keepkit/ui/styles/status.css` when using the status styles independently.
@@ -219,7 +237,7 @@ const onFeedback = useKeepToastFeedback(toast);
219
237
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
220
238
  ```
221
239
 
222
- In v0.23.2, standard card pinning, archiving, and tag display can be enabled independently. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available. `KeepSavePopover` post-save editing, `KeepQuickEditorState.saveStatus`, `KeepItemCard.Save` / `KeepItemCard.Remove`, management-mode `KeepBulkActions`, and notification-driven return to the collection remain available.
240
+ v0.25.0 adds `KeepWorkspace` and the typed `keep.Workspace`. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available. `KeepSavePopover` post-save editing, `KeepQuickEditorState.saveStatus`, `KeepItemCard.Save` / `KeepItemCard.Remove`, management-mode `KeepBulkActions`, and notification-driven return to the collection remain available.
223
241
  Phase 4 adds `KeepItemStatusBadge`, `KeepStaleNotice`, `KeepPruneStaleButton`, `KeepSyncStatusBanner`, and `KeepSyncRecoveryDialog` for unavailable items, sync failures, conflict resolution, and backup recovery. Import `@keepkit/ui/theme.css` or `@keepkit/ui/tailwind.css` for the opt-in theme layer.
224
242
 
225
243
  ### Tailwind and shadcn theme
@@ -268,8 +286,8 @@ Framework-neutral APIs remain available from `@keepkit/core/core`, low-level Rea
268
286
 
269
287
  ## Archive, pin, collections, and quick save editing
270
288
 
271
- The UI package exports `KeepArchiveButton`, `KeepPinButton`, `KeepCollectionSelect`, `KeepCollectionFilter`, `KeepSavePopover`, `KeepQuickEditor`, and `useKeepQuickEditor`. Buttons expose `aria-pressed`, `data-archived`/`data-pinned`, and `data-keep-action`. Collection labels default to IDs and can be overridden with `collectionLabels`. Enable `features={{ collectionFilter: true }}` on `KeepCollection` to include the collection filter. `KeepSavePopover` wraps `KeepButton`, opens after a new save, labels and focuses its dialog, flushes pending edits before closing, and restores focus to the trigger. Its quick editor debounces note, tags, and collection updates by 300ms and exposes `saveStatus`. Set `showSaveButton={false}` when visible save status should replace the submit button. `KeepItemCard.Save` and `KeepItemCard.Remove` let compound cards place those actions alongside `Pin` and `Archive` without replacing the default card API.
289
+ The UI package exports `KeepArchiveButton`, `KeepArchiveScopeSelect`, `KeepPinButton`, `KeepCollectionSelect`, `KeepCollectionFilter`, `KeepSavePopover`, `KeepQuickEditor`, and `useKeepQuickEditor`. `KeepCollection archiveScope="active" | "archived" | "all"` provides a localized scope selector and URL synchronization; `reorderable` provides standard drag/keyboard ordering and undo. Buttons expose `aria-pressed`, `data-archived`/`data-pinned`, and `data-keep-action`. Collection labels default to IDs and can be overridden with `collectionLabels`. `KeepItemCard showEditButton` opens the standard QuickEditor dialog and `editSlot` customizes its content. Enable `features={{ collectionFilter: true }}` on `KeepCollection` to include the collection filter. `KeepSavePopover` wraps `KeepButton`, opens after a new save, labels and focuses its dialog, flushes pending edits before closing, and restores focus to the trigger. Its quick editor debounces note, tags, and collection updates by 300ms and exposes `saveStatus`. Set `showSaveButton={false}` when visible save status should replace the submit button. `KeepItemCard.Save` and `KeepItemCard.Remove` let compound cards place those actions alongside `Pin` and `Archive` without replacing the default card API.
272
290
 
273
291
  ## アーカイブ・ピン留め・コレクション・保存直後編集
274
292
 
275
- UI パッケージは `KeepArchiveButton`、`KeepPinButton`、`KeepCollectionSelect`、`KeepCollectionFilter`、`KeepSavePopover`、`KeepQuickEditor`、`useKeepQuickEditor` を公開します。ボタンは `aria-pressed`、`data-archived` / `data-pinned`、`data-keep-action` を出力します。コレクション名は既定で ID を表示し、`collectionLabels` で置換できます。`KeepCollection` に `features={{ collectionFilter: true }}` を指定するとフィルターを統合できます。`KeepSavePopover` は `KeepButton` を内部 trigger とし、新規保存後にdialogへフォーカスし、閉じる前に未保存編集をflushしてtriggerへフォーカスを戻します。クイックエディターはメモ・タグ・コレクションを一時状態として扱い、既定300msで保存し、`saveStatus`で状態を公開します。自動保存だけを表示する場合は`showSaveButton={false}`を指定します。compound cardでは`KeepItemCard.Save` / `Remove`を`Pin` / `Archive`と同じ操作領域に配置できます。
293
+ UI パッケージは `KeepArchiveButton`、`KeepArchiveScopeSelect`、`KeepPinButton`、`KeepCollectionSelect`、`KeepCollectionFilter`、`KeepSavePopover`、`KeepQuickEditor`、`useKeepQuickEditor` を公開します。`KeepCollection archiveScope="active" | "archived" | "all"` はローカライズされたスコープ選択とURL同期を、`reorderable` は標準のドラッグ/キーボード並び替えとUndoを提供します。ボタンは `aria-pressed`、`data-archived` / `data-pinned`、`data-keep-action` を出力します。`KeepItemCard showEditButton` は標準QuickEditor dialogを開き、`editSlot`で内容を差し替えられます。コレクション名は既定で ID を表示し、`collectionLabels` で置換できます。`KeepCollection` に `features={{ collectionFilter: true }}` を指定するとフィルターを統合できます。`KeepSavePopover` は `KeepButton` を内部 trigger とし、新規保存後にdialogへフォーカスし、閉じる前に未保存編集をflushしてtriggerへフォーカスを戻します。クイックエディターはメモ・タグ・コレクションを一時状態として扱い、既定300msで保存し、`saveStatus`で状態を公開します。自動保存だけを表示する場合は`showSaveButton={false}`を指定します。compound cardでは`KeepItemCard.Save` / `Remove`を`Pin` / `Archive`と同じ操作領域に配置できます。
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, ComponentType, Ref, RefCallback, ReactElement, InputHTMLAttributes, FormHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeAnchorTarget, KeyboardEvent, SelectHTMLAttributes, CSSProperties } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, ComponentType, Ref, RefCallback, ReactElement, InputHTMLAttributes, FormHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeAnchorTarget, SelectHTMLAttributes, KeyboardEvent, CSSProperties } from 'react';
3
3
  import { KeepListQuery, KeepUrlSyncOptions, KeepItemInput, ImportItemsResult, KeepItem, KeepItemStatus, KeepSyncConflict } 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 { useKeepItem, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, 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';
5
+ import { useKeepItem, KeepButtonProps as KeepButtonProps$1, UseKeepListResult, KeepErrorBoundaryProps, UseKeepNavigatorResult, CreateKeepKitOptions as CreateKeepKitOptions$1, KeepProviderProps, useKeepContext, useKeepList, UseKeepCollectionsResult, UseKeepNavigatorOptions, KeepShortcutOptions } from '@keepkit/core/react';
6
+ export { KeepButtonState, KeepContextValue, KeepErrorBoundary, KeepErrorBoundaryProps, KeepProvider, KeepProviderProps, KeepShortcutOptions, useKeepCollections, 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
9
  type KeepUrlAdapter = {
@@ -275,6 +275,9 @@ type KeepItemCardProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HT
275
275
  showSaveButton?: boolean;
276
276
  showPinButton?: boolean;
277
277
  showArchiveButton?: boolean;
278
+ showEditButton?: boolean;
279
+ onEdit?: (item: KeepItem<TMeta>) => void;
280
+ editSlot?: (item: KeepItem<TMeta>, close: () => void) => ReactNode;
278
281
  saveButtonLabels?: KeepButtonLabels;
279
282
  asChild?: boolean;
280
283
  href?: string | ((item: KeepItem<TMeta>) => string | undefined);
@@ -299,7 +302,7 @@ type KeepItemCardSkeletonProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
299
302
  layout?: KeepLayoutPreset;
300
303
  };
301
304
  /** A low-dependency item presentation primitive with composable card parts. */
302
- declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showSavedAt, collectionLabels, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, showPinButton, showArchiveButton, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
305
+ declare function KeepItemCardRoot<TMeta = Record<string, unknown>>({ item, title, getTitle, getImageProps, imageComponent: ImageComponent, renderImage, renderTags, showTags, showSavedAt, collectionLabels, imageAlt, render, children, removeLabel, onRemoveError, onRemoved, onRetry, showSaveButton, showPinButton, showArchiveButton, showEditButton, onEdit, editSlot, saveButtonLabels, asChild, href: hrefOption, onOpen, linkTarget, linkComponent: LinkComponent, linkTargetAttribute, linkRel, highlightQuery, className, ...rootProps }: KeepItemCardProps<TMeta>): react.JSX.Element;
303
306
  declare function KeepItemCardMedia({ children, fallback, ...props }: KeepItemCardMediaProps): react.JSX.Element;
304
307
  declare function KeepItemCardContent({ children, ...props }: KeepItemCardContentProps): react.JSX.Element;
305
308
  declare function KeepItemCardTitle({ as, children, ...props }: KeepItemCardTitleProps): react.DetailedReactHTMLElement<{
@@ -618,6 +621,15 @@ declare const KeepItemCard: typeof KeepItemCardRoot & {
618
621
  /** A non-interactive placeholder that preserves the selected card layout while data loads. */
619
622
  declare function KeepItemCardSkeleton({ layout, ...props }: KeepItemCardSkeletonProps): react.JSX.Element;
620
623
 
624
+ type KeepArchiveScope = "active" | "archived" | "all";
625
+ type KeepArchiveScopeSelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange"> & {
626
+ value?: KeepArchiveScope;
627
+ defaultValue?: KeepArchiveScope;
628
+ onValueChange?: (value: KeepArchiveScope) => void;
629
+ };
630
+ /** A localized active/archived/all selector for a KeepCollection query. */
631
+ declare function KeepArchiveScopeSelect({ value: controlledValue, defaultValue, onValueChange, "aria-label": ariaLabel, ...props }: KeepArchiveScopeSelectProps): react.JSX.Element;
632
+
621
633
  type KeepListState<TMeta = Record<string, unknown>> = UseKeepListResult<TMeta>;
622
634
  type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
623
635
  ref?: Ref<HTMLElement> | {
@@ -635,6 +647,8 @@ type KeepListProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLEl
635
647
  onClearFilters?: () => void;
636
648
  itemCardProps?: Omit<KeepItemCardProps<TMeta>, "item" | "children" | "render">;
637
649
  layout?: KeepLayoutPreset;
650
+ reorderable?: boolean;
651
+ onReorder?: (orderedIds: string[]) => void | Promise<void>;
638
652
  asChild?: boolean;
639
653
  fallback?: KeepErrorBoundaryProps["fallback"];
640
654
  onBoundaryError?: KeepErrorBoundaryProps["onError"];
@@ -651,6 +665,12 @@ type KeepCollectionProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<
651
665
  layout?: KeepLayoutPreset;
652
666
  urlSync?: boolean | KeepUrlSyncOptions;
653
667
  urlAdapter?: KeepUrlAdapter;
668
+ /** Enables the built-in active/archived/all scope selector and query state. */
669
+ archiveScope?: KeepArchiveScope;
670
+ onArchiveScopeChange?: (scope: KeepArchiveScope) => void;
671
+ /** Enables the built-in drag and keyboard reorder list. */
672
+ reorderable?: boolean;
673
+ onReorder?: (items: KeepItem<TMeta>[]) => void | Promise<void>;
654
674
  features?: Partial<Record<KeepCollectionFeature, boolean>>;
655
675
  collectionLabels?: Record<string, string>;
656
676
  renderItem?: (item: KeepItem<TMeta>, state: KeepListState<TMeta>) => ReactNode;
@@ -748,7 +768,7 @@ type KeepTagEditorProps<TMeta = Record<string, unknown>> = Omit<FormHTMLAttribut
748
768
  /** Edits one item's normalized tag set; Enter adds and Backspace removes the last tag. */
749
769
  declare function KeepTagEditor<TMeta = Record<string, unknown>>({ item, availableTags, onSaved, onSaveError, render, ...props }: KeepTagEditorProps<TMeta>): react.JSX.Element;
750
770
 
751
- type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "archive" | "unarchive" | "archived" | "pin" | "unpin" | "pinned" | "collection" | "allCollections" | "filterCollections" | "uncategorized" | "saveWithNote" | "editSavedItem" | "unsavedChanges" | "allTags" | "tags" | "filterTags" | "activeFilters" | "clearFilters" | "clearAllFilters" | "removeFilter" | "noFilteredItems" | "noFilteredItemsDescription" | "emptyStorageDescription" | "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";
771
+ type KeepUiLabelKey = "save" | "saved" | "remove" | "loading" | "saving" | "syncing" | "error" | "archive" | "unarchive" | "archived" | "pin" | "unpin" | "pinned" | "collection" | "allCollections" | "filterCollections" | "uncategorized" | "saveWithNote" | "editSavedItem" | "unsavedChanges" | "allTags" | "tags" | "filterTags" | "activeFilters" | "clearFilters" | "clearAllFilters" | "removeFilter" | "noFilteredItems" | "noFilteredItemsDescription" | "emptyStorageDescription" | "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" | "archiveScope" | "archiveScopeActive" | "archiveScopeArchived" | "archiveScopeAll" | "undoReorder";
752
772
  type KeepUiLabels = Partial<Record<KeepUiLabelKey, string>>;
753
773
  type KeepUiLocaleLabels = Record<KeepUiLabelKey, string>;
754
774
 
@@ -846,6 +866,9 @@ type KeepTourBarProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTM
846
866
  prevHref?: string;
847
867
  nextHref?: string;
848
868
  backHref?: string;
869
+ getItemHref?: (item: KeepItem<TMeta>) => string;
870
+ getBackHref?: () => string;
871
+ onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
849
872
  onPrev?: () => void | Promise<void>;
850
873
  onNext?: () => void | Promise<void>;
851
874
  onBack?: () => void | Promise<void>;
@@ -861,7 +884,7 @@ type KeepTourBarProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTM
861
884
  asChild?: boolean;
862
885
  };
863
886
  /** Headless previous/current/next navigation with optional URL links and keyboard shortcuts. */
864
- declare function KeepTourBar<TMeta = Record<string, unknown>>({ navigation: providedNavigation, currentId, initialIndex, showProgress, prevHref, nextHref, backHref, onPrev, onNext, onBack, prevLabel, nextLabel, backLabel, keyboardShortcuts, showShortcutHint, shortcutOptions, progress, getItemTitle, children, asChild, ...props }: KeepTourBarProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
887
+ declare function KeepTourBar<TMeta = Record<string, unknown>>({ navigation: providedNavigation, currentId, initialIndex, showProgress, prevHref, nextHref, backHref, getItemHref, getBackHref, onNavigate, onPrev, onNext, onBack, prevLabel, nextLabel, backLabel, keyboardShortcuts, showShortcutHint, shortcutOptions, progress, getItemTitle, children, asChild, ...props }: KeepTourBarProps<TMeta>): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
865
888
  declare const KeepNavigator: typeof KeepTourBar;
866
889
 
867
890
  type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
@@ -1041,6 +1064,39 @@ type KeepSyncStatusBannerProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
1041
1064
  /** Announces synchronization failures and exposes retry or conflict-recovery entry points. */
1042
1065
  declare function KeepSyncStatusBanner({ onRetry, onResolveConflicts, children, className, ...props }: KeepSyncStatusBannerProps): react.JSX.Element | null;
1043
1066
 
1067
+ type KeepWorkspacePreset = "basic" | "standard" | "management" | "sync";
1068
+ type KeepWorkspaceModule = "syncStatus" | "undo" | "recovery" | "backup" | "stalePrune";
1069
+ type KeepWorkspaceState = {
1070
+ preset: KeepWorkspacePreset;
1071
+ modules: Readonly<Record<KeepWorkspaceModule, boolean>>;
1072
+ recoveryOpen: boolean;
1073
+ setRecoveryOpen: (open: boolean) => void;
1074
+ };
1075
+ type KeepWorkspaceContent = ReactNode | RenderProp<KeepWorkspaceState>;
1076
+ type KeepWorkspaceSlots = {
1077
+ before?: KeepWorkspaceContent;
1078
+ syncStatus?: KeepWorkspaceContent;
1079
+ collection?: KeepWorkspaceContent;
1080
+ actions?: KeepWorkspaceContent;
1081
+ undo?: KeepWorkspaceContent;
1082
+ recovery?: KeepWorkspaceContent;
1083
+ after?: KeepWorkspaceContent;
1084
+ };
1085
+ type KeepWorkspaceProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
1086
+ preset?: KeepWorkspacePreset;
1087
+ modules?: Partial<Record<KeepWorkspaceModule, boolean>>;
1088
+ collectionProps?: KeepCollectionProps<TMeta>;
1089
+ syncStatusProps?: KeepSyncStatusBannerProps;
1090
+ recoveryProps?: KeepSyncRecoveryDialogProps<TMeta>;
1091
+ backupProps?: KeepBackupProps<TMeta>;
1092
+ undoProps?: KeepUndoProps;
1093
+ stalePruneProps?: KeepPruneStaleButtonProps;
1094
+ slots?: KeepWorkspaceSlots;
1095
+ children?: KeepWorkspaceContent;
1096
+ };
1097
+ /** Composes the standard collection, management, and sync primitives into one customizable workspace. */
1098
+ declare function KeepWorkspace<TMeta = Record<string, unknown>>({ preset, modules, collectionProps, syncStatusProps, recoveryProps, backupProps, undoProps, stalePruneProps, slots, children, className, ...props }: KeepWorkspaceProps<TMeta>): react.JSX.Element;
1099
+
1044
1100
  declare const keepThemeNames: readonly ["default", "ocean", "forest", "sunset", "lavender", "compact", "minimal", "rounded", "high-contrast", "dark"];
1045
1101
  type KeepThemeName = (typeof keepThemeNames)[number];
1046
1102
  type KeepThemeMode = "light" | "dark" | "system";
@@ -1098,13 +1154,18 @@ type KeepKit<TMeta = Record<string, unknown>> = {
1098
1154
  Button: ComponentType<KeepButtonProps<TMeta>>;
1099
1155
  Backup: ComponentType<KeepBackupProps<TMeta>>;
1100
1156
  Collection: ComponentType<KeepCollectionProps<TMeta>>;
1157
+ Workspace: ComponentType<KeepWorkspaceProps<TMeta>>;
1101
1158
  useContext: () => ReturnType<typeof useKeepContext<TMeta>>;
1102
1159
  useItem: (item?: KeepItemInput<TMeta>) => ReturnType<typeof useKeepItem<TMeta>>;
1103
1160
  useList: (query?: KeepListQuery<TMeta>) => ReturnType<typeof useKeepList<TMeta>>;
1161
+ useCollections: (options?: {
1162
+ targetType?: string;
1163
+ orderBy?: "name" | "count";
1164
+ }) => UseKeepCollectionsResult;
1104
1165
  useNavigator: (options?: UseKeepNavigatorOptions<TMeta>) => UseKeepNavigatorResult<TMeta>;
1105
1166
  useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
1106
1167
  };
1107
1168
  /** Create one typed application API for the core and standard UI layer. */
1108
1169
  declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
1109
1170
 
1110
- export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionControlProps, type KeepCollectionFeature, KeepCollectionFilter, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, 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, KeepPinButton, type KeepPinButtonProps, type KeepPinButtonState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, KeepQuickEditor, type KeepQuickEditorProps, type KeepQuickEditorState, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSavePopover, type KeepSavePopoverProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepShortcutHint, type KeepShortcutHintProps, 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, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };
1171
+ export { type CreateKeepKitOptions, KeepActiveFiltersSummary, type KeepActiveFiltersSummaryProps, type KeepActiveFiltersSummaryState, KeepAnnouncements, type KeepAnnouncementsProps, KeepAnnouncer, KeepArchiveButton, type KeepArchiveButtonProps, type KeepArchiveButtonState, type KeepArchiveScope, KeepArchiveScopeSelect, type KeepArchiveScopeSelectProps, KeepBackup, type KeepBackupProps, KeepBulkActions, type KeepBulkActionsProps, type KeepBulkActionsState, KeepButton, type KeepButtonIcon, type KeepButtonIconProps, type KeepButtonIcons, type KeepButtonLabels, type KeepButtonProps, KeepCollection, type KeepCollectionControlProps, type KeepCollectionFeature, KeepCollectionFilter, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepHighlight, type KeepHighlightProps, type KeepImageProps, KeepItemCard, type KeepItemCardActionSlotProps, type KeepItemCardActionsProps, type KeepItemCardBadgeProps, type KeepItemCardContentProps, type KeepItemCardLinkProps, type KeepItemCardMediaProps, type KeepItemCardProps, type KeepItemCardRemoveProps, type KeepItemCardSaveProps, 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, KeepPinButton, type KeepPinButtonProps, type KeepPinButtonState, KeepPruneStaleButton, type KeepPruneStaleButtonProps, KeepQuickEditor, type KeepQuickEditorProps, type KeepQuickEditorState, type KeepReorderableItemState, KeepReorderableList, type KeepReorderableListProps, KeepSavePopover, type KeepSavePopoverProps, KeepSearchInput, type KeepSearchInputProps, type KeepSelectionScope, KeepShortcutHint, type KeepShortcutHintProps, 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, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceSlots, type KeepWorkspaceState, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync };