@keepkit/ui 0.27.3 → 0.28.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
@@ -107,7 +107,7 @@ const onFeedback = useKeepToastFeedback(toast);
107
107
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
108
108
  ```
109
109
 
110
- v0.27.3では`KeepCollection`の最小構成と高度な操作を確認できる`apps/collection-demo`を追加しました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。
110
+ v0.28.0では、レイアウト領域を消費しないPortalベースのフローティング巡回UIを追加しました。Tailwind CSS v4との統合、ホストテーマ変数との衝突回避、CSS cascade layer対応も引き続き利用できます。
111
111
  Phase 4の状態UIとして`KeepItemStatusBadge`、`KeepStaleNotice`、`KeepPruneStaleButton`、`KeepSyncStatusBanner`、`KeepSyncRecoveryDialog`を利用できます。`import "@keepkit/ui/theme.css"`でテーマCSSを有効にできます。
112
112
 
113
113
  ### Tailwind/shadcnテーマ
@@ -216,7 +216,9 @@ Set `toolbarLayout="grouped"` and `toolbarVariant="panel"` to render host `slots
216
216
  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.
217
217
  `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.
218
218
  `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.
219
+ `KeepTourProvider` / `useKeepTour` manage a session-scoped tour, and `KeepFloatingTour` renders controls in a body portal so the host layout needs no reserved space. Start with `start({ itemIds })`, configure `position`, `offset`, `zIndex`, and routing callbacks. Same-tab state resumes from `sessionStorage`; set `tour={{ sessionKey }}` on `KeepKitProvider` to namespace it.
219
220
  `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.
221
+ `KeepFloatingTour` is a fixed portal-rendered tour control that does not consume page layout space. Use `KeepTourProvider` / `useKeepTour` to start an ordered session with `start({ itemIds })` and configure host routing with `getItemHref`, `getBackHref`, or `onNavigate`.
220
222
  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.
221
223
  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.
222
224
  External detail URLs receive `target="_blank"` and `rel="noreferrer"` defaults. Unavailable cards expose `aria-disabled="true"` and normalized `data-item-status` values, and the sync recovery dialog compares local and remote updated dates and notes side by side.
@@ -245,7 +247,7 @@ const onFeedback = useKeepToastFeedback(toast);
245
247
  <KeepKitProvider storage={storage} onFeedback={onFeedback}>{children}</KeepKitProvider>;
246
248
  ```
247
249
 
248
- v0.27.3 adds `apps/collection-demo` for exploring minimal and advanced `KeepCollection` configurations. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available.
250
+ v0.28.0 adds a portal-rendered floating tour UI that does not consume host layout space. Tailwind CSS v4 integration, host-theme isolation, and cascade-layer support remain available.
249
251
  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.
250
252
 
251
253
  ### Tailwind and shadcn theme
package/dist/index.d.ts CHANGED
@@ -911,6 +911,24 @@ type KeepDisplayStatus = "available" | "expired" | "removed" | "restricted";
911
911
  /** Displays the normalized availability state of a saved item. */
912
912
  declare function KeepItemStatusBadge({ status, label, className, ...props }: KeepItemStatusBadgeProps): react.JSX.Element;
913
913
 
914
+ type KeepFloatingTourProps<TMeta = Record<string, unknown>> = {
915
+ currentId?: string;
916
+ getItemHref?: (item: KeepItem<TMeta>) => string;
917
+ getBackHref?: () => string;
918
+ onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
919
+ onBack?: () => void | Promise<void>;
920
+ position?: "bottom-center" | "bottom-left" | "bottom-right";
921
+ offset?: number | string;
922
+ zIndex?: number;
923
+ className?: string;
924
+ style?: CSSProperties;
925
+ keyboardShortcuts?: boolean;
926
+ showShortcutHint?: boolean;
927
+ children?: ReactNode;
928
+ };
929
+ /** A fixed, portal-rendered tour bar that does not consume host layout space. */
930
+ declare function KeepFloatingTour<TMeta = Record<string, unknown>>({ currentId, getItemHref, getBackHref, onNavigate, onBack, position, offset, zIndex, className, style, keyboardShortcuts, showShortcutHint, }: KeepFloatingTourProps<TMeta>): react.ReactPortal | null;
931
+
914
932
  type KeepShortcutHintProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
915
933
  shortcut: string | readonly string[];
916
934
  separator?: ReactNode;
@@ -963,6 +981,41 @@ type KeepTourBarProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTM
963
981
  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>>;
964
982
  declare const KeepNavigator: typeof KeepTourBar;
965
983
 
984
+ type KeepTourPosition = "bottom-center" | "bottom-left" | "bottom-right";
985
+ type KeepTourPersistenceStatus = "persistent" | "memory";
986
+ type KeepTourStartOptions = {
987
+ itemIds: readonly string[];
988
+ currentId?: string;
989
+ };
990
+ type KeepTourContextValue<TMeta = Record<string, unknown>> = {
991
+ active: boolean;
992
+ itemIds: readonly string[];
993
+ currentId: string | null;
994
+ collapsed: boolean;
995
+ persistenceStatus: KeepTourPersistenceStatus;
996
+ getItemHref?: (item: KeepItem<TMeta>) => string;
997
+ getBackHref?: () => string;
998
+ onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
999
+ start: (options: KeepTourStartOptions) => boolean;
1000
+ end: () => void;
1001
+ collapse: () => void;
1002
+ expand: () => void;
1003
+ goNext: () => KeepItem<TMeta> | null;
1004
+ goPrev: () => KeepItem<TMeta> | null;
1005
+ setCurrentId: (id: string) => void;
1006
+ };
1007
+ type KeepTourProviderProps<TMeta = Record<string, unknown>> = {
1008
+ children?: ReactNode;
1009
+ sessionKey?: string;
1010
+ getItemHref?: (item: KeepItem<TMeta>) => string;
1011
+ getBackHref?: () => string;
1012
+ onNavigate?: (direction: "prev" | "next", item: KeepItem<TMeta>) => void;
1013
+ };
1014
+ declare function KeepTourProvider<TMeta = Record<string, unknown>>({ children, sessionKey, getItemHref, getBackHref, onNavigate, }: KeepTourProviderProps<TMeta>): react.JSX.Element;
1015
+ declare function useKeepTour<TMeta = Record<string, unknown>>(options?: {
1016
+ currentId?: string;
1017
+ }): KeepTourContextValue<TMeta>;
1018
+
966
1019
  type KeepActiveFiltersSummaryProps<TMeta = Record<string, unknown>> = Omit<HTMLAttributes<HTMLElement>, "children"> & {
967
1020
  ref?: Ref<HTMLElement> | {
968
1021
  readonly current: unknown;
@@ -1214,9 +1267,10 @@ declare function KeepThemeProvider({ children, theme, mode, density, radius, acc
1214
1267
 
1215
1268
  type KeepKitProviderProps<TMeta = Record<string, unknown>> = Omit<KeepProviderProps<TMeta>, "children"> & Omit<KeepUiProviderProps<TMeta>, "children"> & Omit<KeepThemeProviderProps, "children"> & {
1216
1269
  children?: ReactNode;
1270
+ tour?: Omit<KeepTourProviderProps<TMeta>, "children">;
1217
1271
  };
1218
1272
  /** Combines the core store, UI labels, and the global live announcer. */
1219
- declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, labelOptions, locale, labelResolver, onFeedback, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
1273
+ declare function KeepKitProvider<TMeta = Record<string, unknown>>({ labels, labelOptions, locale, labelResolver, onFeedback, theme, mode, density, radius, accentColor, highContrast, reducedMotion, variables, className: themeClassName, style: themeStyle, asChild: themeAsChild, tour, children, ...providerProps }: KeepKitProviderProps<TMeta>): react.JSX.Element;
1220
1274
 
1221
1275
  type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOptions$1<TMeta> & Omit<KeepUiProviderProps<TMeta>, "children"> & {
1222
1276
  theme?: KeepThemeName;
@@ -1229,6 +1283,7 @@ type CreateKeepKitOptions<TMeta = Record<string, unknown>> = CreateKeepKitOption
1229
1283
  variables?: KeepThemeVariables;
1230
1284
  themeClassName?: string;
1231
1285
  themeStyle?: KeepThemeProviderProps["style"];
1286
+ tour?: Omit<KeepTourProviderProps<TMeta>, "children">;
1232
1287
  getTitle?: (item: KeepItem<TMeta>) => ReactNode;
1233
1288
  getImageProps?: (item: KeepItem<TMeta>, title: ReactNode) => KeepImageProps | undefined;
1234
1289
  };
@@ -1248,8 +1303,13 @@ type KeepKit<TMeta = Record<string, unknown>> = {
1248
1303
  }) => UseKeepCollectionsResult;
1249
1304
  useNavigator: (options?: UseKeepNavigatorOptions<TMeta>) => UseKeepNavigatorResult<TMeta>;
1250
1305
  useShortcut: (options: KeepShortcutOptions<TMeta>) => void;
1306
+ FloatingTour: ComponentType<KeepFloatingTourProps<TMeta>>;
1307
+ TourProvider: ComponentType<KeepTourProviderProps<TMeta>>;
1308
+ useTour: (options?: {
1309
+ currentId?: string;
1310
+ }) => ReturnType<typeof useKeepTour<TMeta>>;
1251
1311
  };
1252
1312
  /** Create one typed application API for the core and standard UI layer. */
1253
1313
  declare function createKeepKit<TMeta = Record<string, unknown>>(options?: CreateKeepKitOptions<TMeta>): KeepKit<TMeta>;
1254
1314
 
1255
- 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, KeepCollectionCreate, type KeepCollectionCreateProps, type KeepCollectionFeature, KeepCollectionFilter, KeepCollectionManager, type KeepCollectionManagerProps, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, type KeepCollectionSlots, type KeepCollectionToolbarContent, type KeepCollectionToolbarGroup, type KeepCollectionToolbarLayout, type KeepCollectionToolbarVariant, 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, type KeepItemCardVariant, 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 KeepQuickEditorFeature, 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 KeepUiLabelOptions, type KeepUiLabelOptionsMap, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceRegion, type KeepWorkspaceSectionGap, type KeepWorkspaceSlots, type KeepWorkspaceState, type KeepWorkspaceSurface, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync, useUiLabelVisibility };
1315
+ 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, KeepCollectionCreate, type KeepCollectionCreateProps, type KeepCollectionFeature, KeepCollectionFilter, KeepCollectionManager, type KeepCollectionManagerProps, type KeepCollectionOption, type KeepCollectionProps, KeepCollectionSelect, type KeepCollectionSlots, type KeepCollectionToolbarContent, type KeepCollectionToolbarGroup, type KeepCollectionToolbarLayout, type KeepCollectionToolbarVariant, type KeepDisplayStatus, KeepEmptyState, type KeepEmptyStateProps, type KeepEmptyStateVariant, KeepFloatingTour, type KeepFloatingTourProps, 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, type KeepItemCardVariant, 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 KeepQuickEditorFeature, 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 KeepTourContextValue, type KeepTourPersistenceStatus, type KeepTourPosition, KeepTourProvider, type KeepTourProviderProps, type KeepTourShortcutsOptions, type KeepTourStartOptions, type KeepUiFeedbackEvent, type KeepUiLabelContext, type KeepUiLabelKey, type KeepUiLabelOptions, type KeepUiLabelOptionsMap, type KeepUiLabels, type KeepUiLocale, type KeepUiLocaleLabels, KeepUiProvider, type KeepUiProviderProps, KeepUndo, type KeepUndoProps, type KeepUrlAdapter, KeepWorkspace, type KeepWorkspaceModule, type KeepWorkspacePreset, type KeepWorkspaceProps, type KeepWorkspaceRegion, type KeepWorkspaceSectionGap, type KeepWorkspaceSlots, type KeepWorkspaceState, type KeepWorkspaceSurface, type RenderProp, chainedFunction, composeRefs, createKeepKit, createNextPagesRouterAdapter, createSlot, getKeepLocaleLabels, highlightText, isAllSelected, keepThemeNames, mergeProps, toggleSelectAll, useKeepQuickEditor, useKeepToastFeedback, useKeepTour, useKeepTourShortcuts, useKeepUiLabels, useKeepUrlSync, useUiLabelVisibility };