@box/metadata-template-browser 1.16.3

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.
Files changed (177) hide show
  1. package/LICENSE +379 -0
  2. package/README.md +57 -0
  3. package/dist/chunks/types.js +6 -0
  4. package/dist/esm/index.js +4 -0
  5. package/dist/esm/lib/components/breadcrumb-navigation/breadcrumb-navigation.js +51 -0
  6. package/dist/esm/lib/components/breadcrumb-navigation/index.js +4 -0
  7. package/dist/esm/lib/components/breadcrumb-navigation/messages.js +18 -0
  8. package/dist/esm/lib/components/browse-list/browse-list.js +83 -0
  9. package/dist/esm/lib/components/browse-list/index.js +4 -0
  10. package/dist/esm/lib/components/browse-list/messages.js +18 -0
  11. package/dist/esm/lib/components/browser-row/browser-row.js +63 -0
  12. package/dist/esm/lib/components/browser-row/index.js +4 -0
  13. package/dist/esm/lib/components/error-state/error-state.js +32 -0
  14. package/dist/esm/lib/components/error-state/index.js +4 -0
  15. package/dist/esm/lib/components/error-state/messages.js +10 -0
  16. package/dist/esm/lib/components/index.js +24 -0
  17. package/dist/esm/lib/components/load-more-feedback/index.js +6 -0
  18. package/dist/esm/lib/components/load-more-feedback/load-more-error-row.js +44 -0
  19. package/dist/esm/lib/components/load-more-feedback/load-more-loading-row.js +34 -0
  20. package/dist/esm/lib/components/load-more-feedback/messages.js +22 -0
  21. package/dist/esm/lib/components/loader-skeleton/index.js +4 -0
  22. package/dist/esm/lib/components/loader-skeleton/loader-skeleton.js +26 -0
  23. package/dist/esm/lib/components/messages.js +30 -0
  24. package/dist/esm/lib/components/metadata-template-browser-container.js +35 -0
  25. package/dist/esm/lib/components/metadata-template-browser-controller.js +58 -0
  26. package/dist/esm/lib/components/metadata-template-browser-list-box/index.js +4 -0
  27. package/dist/esm/lib/components/metadata-template-browser-list-box/metadata-template-browser-list-box.js +65 -0
  28. package/dist/esm/lib/components/namespace-row/index.js +4 -0
  29. package/dist/esm/lib/components/namespace-row/messages.js +10 -0
  30. package/dist/esm/lib/components/namespace-row/namespace-row.js +32 -0
  31. package/dist/esm/lib/components/search-list/index.js +4 -0
  32. package/dist/esm/lib/components/search-list/messages.js +22 -0
  33. package/dist/esm/lib/components/search-list/search-list.js +76 -0
  34. package/dist/esm/lib/components/template-row/index.js +4 -0
  35. package/dist/esm/lib/components/template-row/messages.js +10 -0
  36. package/dist/esm/lib/components/template-row/template-row.js +70 -0
  37. package/dist/esm/lib/components/virtualized-grid-list/grid-list-load-more-sentinel.js +49 -0
  38. package/dist/esm/lib/components/virtualized-grid-list/index.js +4 -0
  39. package/dist/esm/lib/components/virtualized-grid-list/messages.js +10 -0
  40. package/dist/esm/lib/components/virtualized-grid-list/virtualized-grid-list.js +66 -0
  41. package/dist/esm/lib/constants.js +14 -0
  42. package/dist/esm/lib/contexts/contexts.js +129 -0
  43. package/dist/esm/lib/contexts/hooks.js +46 -0
  44. package/dist/esm/lib/contexts/index.js +17 -0
  45. package/dist/esm/lib/contexts/provider.js +59 -0
  46. package/dist/esm/lib/contexts/reducer.js +180 -0
  47. package/dist/esm/lib/contexts/use-template-browser-actions.js +263 -0
  48. package/dist/esm/lib/hooks/use-is-initial-browse-loading.js +16 -0
  49. package/dist/esm/lib/metadata-template-browser.js +27 -0
  50. package/dist/i18n/bn-IN.js +26 -0
  51. package/dist/i18n/bn-IN.properties +48 -0
  52. package/dist/i18n/da-DK.js +26 -0
  53. package/dist/i18n/da-DK.properties +48 -0
  54. package/dist/i18n/de-DE.js +26 -0
  55. package/dist/i18n/de-DE.properties +48 -0
  56. package/dist/i18n/en-AU.js +26 -0
  57. package/dist/i18n/en-AU.properties +48 -0
  58. package/dist/i18n/en-CA.js +26 -0
  59. package/dist/i18n/en-CA.properties +48 -0
  60. package/dist/i18n/en-GB.js +26 -0
  61. package/dist/i18n/en-GB.properties +48 -0
  62. package/dist/i18n/en-US.js +26 -0
  63. package/dist/i18n/en-US.properties +48 -0
  64. package/dist/i18n/en-x-pseudo.js +26 -0
  65. package/dist/i18n/en-x-pseudo.properties +48 -0
  66. package/dist/i18n/es-419.js +26 -0
  67. package/dist/i18n/es-419.properties +48 -0
  68. package/dist/i18n/es-ES.js +26 -0
  69. package/dist/i18n/es-ES.properties +48 -0
  70. package/dist/i18n/fi-FI.js +26 -0
  71. package/dist/i18n/fi-FI.properties +48 -0
  72. package/dist/i18n/fr-CA.js +26 -0
  73. package/dist/i18n/fr-CA.properties +48 -0
  74. package/dist/i18n/fr-FR.js +26 -0
  75. package/dist/i18n/fr-FR.properties +48 -0
  76. package/dist/i18n/hi-IN.js +26 -0
  77. package/dist/i18n/hi-IN.properties +48 -0
  78. package/dist/i18n/it-IT.js +26 -0
  79. package/dist/i18n/it-IT.properties +48 -0
  80. package/dist/i18n/ja-JP.js +26 -0
  81. package/dist/i18n/ja-JP.properties +48 -0
  82. package/dist/i18n/json/src/lib/components/breadcrumb-navigation/messages.json +1 -0
  83. package/dist/i18n/json/src/lib/components/browse-list/messages.json +1 -0
  84. package/dist/i18n/json/src/lib/components/error-state/messages.json +1 -0
  85. package/dist/i18n/json/src/lib/components/load-more-feedback/messages.json +1 -0
  86. package/dist/i18n/json/src/lib/components/messages.json +1 -0
  87. package/dist/i18n/json/src/lib/components/namespace-row/messages.json +1 -0
  88. package/dist/i18n/json/src/lib/components/search-list/messages.json +1 -0
  89. package/dist/i18n/json/src/lib/components/template-row/messages.json +1 -0
  90. package/dist/i18n/json/src/lib/components/virtualized-grid-list/messages.json +1 -0
  91. package/dist/i18n/ko-KR.js +26 -0
  92. package/dist/i18n/ko-KR.properties +48 -0
  93. package/dist/i18n/nb-NO.js +26 -0
  94. package/dist/i18n/nb-NO.properties +48 -0
  95. package/dist/i18n/nl-NL.js +26 -0
  96. package/dist/i18n/nl-NL.properties +48 -0
  97. package/dist/i18n/pl-PL.js +26 -0
  98. package/dist/i18n/pl-PL.properties +48 -0
  99. package/dist/i18n/pt-BR.js +26 -0
  100. package/dist/i18n/pt-BR.properties +48 -0
  101. package/dist/i18n/ru-RU.js +26 -0
  102. package/dist/i18n/ru-RU.properties +48 -0
  103. package/dist/i18n/sv-SE.js +26 -0
  104. package/dist/i18n/sv-SE.properties +48 -0
  105. package/dist/i18n/tr-TR.js +26 -0
  106. package/dist/i18n/tr-TR.properties +48 -0
  107. package/dist/i18n/zh-CN.js +26 -0
  108. package/dist/i18n/zh-CN.properties +48 -0
  109. package/dist/i18n/zh-TW.js +26 -0
  110. package/dist/i18n/zh-TW.properties +48 -0
  111. package/dist/styles/breadcrumb-navigation.css +1 -0
  112. package/dist/styles/browser-row.css +1 -0
  113. package/dist/styles/grid-list-load-more-sentinel.css +1 -0
  114. package/dist/styles/load-more-error-row.css +1 -0
  115. package/dist/styles/load-more-loading-row.css +1 -0
  116. package/dist/styles/loader-skeleton.css +1 -0
  117. package/dist/styles/metadata-template-browser-container.css +1 -0
  118. package/dist/styles/metadata-template-browser-controller.css +1 -0
  119. package/dist/styles/metadata-template-browser-list-box.css +1 -0
  120. package/dist/styles/virtualized-grid-list.css +1 -0
  121. package/dist/types/index.d.ts +3 -0
  122. package/dist/types/lib/components/breadcrumb-navigation/breadcrumb-navigation.d.ts +12 -0
  123. package/dist/types/lib/components/breadcrumb-navigation/index.d.ts +1 -0
  124. package/dist/types/lib/components/breadcrumb-navigation/messages.d.ts +17 -0
  125. package/dist/types/lib/components/browse-list/browse-list.d.ts +23 -0
  126. package/dist/types/lib/components/browse-list/index.d.ts +2 -0
  127. package/dist/types/lib/components/browse-list/messages.d.ts +17 -0
  128. package/dist/types/lib/components/browser-row/browser-row.d.ts +25 -0
  129. package/dist/types/lib/components/browser-row/index.d.ts +1 -0
  130. package/dist/types/lib/components/error-state/error-state.d.ts +11 -0
  131. package/dist/types/lib/components/error-state/index.d.ts +2 -0
  132. package/dist/types/lib/components/error-state/messages.d.ts +7 -0
  133. package/dist/types/lib/components/index.d.ts +15 -0
  134. package/dist/types/lib/components/load-more-feedback/index.d.ts +2 -0
  135. package/dist/types/lib/components/load-more-feedback/load-more-error-row.d.ts +10 -0
  136. package/dist/types/lib/components/load-more-feedback/load-more-loading-row.d.ts +6 -0
  137. package/dist/types/lib/components/load-more-feedback/messages.d.ts +22 -0
  138. package/dist/types/lib/components/loader-skeleton/index.d.ts +1 -0
  139. package/dist/types/lib/components/loader-skeleton/loader-skeleton.d.ts +5 -0
  140. package/dist/types/lib/components/messages.d.ts +32 -0
  141. package/dist/types/lib/components/metadata-template-browser-container.d.ts +8 -0
  142. package/dist/types/lib/components/metadata-template-browser-controller.d.ts +11 -0
  143. package/dist/types/lib/components/metadata-template-browser-list-box/index.d.ts +1 -0
  144. package/dist/types/lib/components/metadata-template-browser-list-box/metadata-template-browser-list-box.d.ts +6 -0
  145. package/dist/types/lib/components/namespace-row/index.d.ts +2 -0
  146. package/dist/types/lib/components/namespace-row/messages.d.ts +7 -0
  147. package/dist/types/lib/components/namespace-row/namespace-row.d.ts +10 -0
  148. package/dist/types/lib/components/search-list/index.d.ts +2 -0
  149. package/dist/types/lib/components/search-list/messages.d.ts +22 -0
  150. package/dist/types/lib/components/search-list/search-list.d.ts +12 -0
  151. package/dist/types/lib/components/template-row/index.d.ts +2 -0
  152. package/dist/types/lib/components/template-row/messages.d.ts +7 -0
  153. package/dist/types/lib/components/template-row/template-row.d.ts +19 -0
  154. package/dist/types/lib/components/virtualized-grid-list/grid-list-load-more-sentinel.d.ts +15 -0
  155. package/dist/types/lib/components/virtualized-grid-list/index.d.ts +2 -0
  156. package/dist/types/lib/components/virtualized-grid-list/messages.d.ts +7 -0
  157. package/dist/types/lib/components/virtualized-grid-list/virtualized-grid-list.d.ts +37 -0
  158. package/dist/types/lib/constants.d.ts +8 -0
  159. package/dist/types/lib/contexts/contexts.d.ts +47 -0
  160. package/dist/types/lib/contexts/hooks.d.ts +13 -0
  161. package/dist/types/lib/contexts/index.d.ts +7 -0
  162. package/dist/types/lib/contexts/provider.d.ts +14 -0
  163. package/dist/types/lib/contexts/reducer.d.ts +106 -0
  164. package/dist/types/lib/contexts/use-template-browser-actions.d.ts +9 -0
  165. package/dist/types/lib/hooks/use-is-initial-browse-loading.d.ts +7 -0
  166. package/dist/types/lib/metadata-template-browser.d.ts +23 -0
  167. package/dist/types/lib/stories/shared/constants.d.ts +16 -0
  168. package/dist/types/lib/stories/shared/create-mock-event-service.d.ts +2 -0
  169. package/dist/types/lib/stories/shared/create-mock-items-service.d.ts +53 -0
  170. package/dist/types/lib/stories/shared/generate-namespaces.d.ts +6 -0
  171. package/dist/types/lib/stories/shared/generate-templates.d.ts +8 -0
  172. package/dist/types/lib/stories/shared/index.d.ts +8 -0
  173. package/dist/types/lib/stories/shared/paginate-items.d.ts +2 -0
  174. package/dist/types/lib/stories/shared/story-container.d.ts +5 -0
  175. package/dist/types/lib/stories/shared/story-interaction-helpers.d.ts +30 -0
  176. package/dist/types/lib/types.d.ts +116 -0
  177. package/package.json +49 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Renders the namespace path breadcrumb below the search input.
3
+ *
4
+ * Always visible except during active search. At root level shows a single
5
+ * non-interactive "Enterprise" crumb. As the user drills in, parent crumbs
6
+ * become clickable and call `navigateBack` for instant cache-based restoration.
7
+ * The current level (last crumb) is always non-interactive.
8
+ *
9
+ * When the consumer sets `isDisabled`, crumbs are non-interactive (`isInteractive={false}`),
10
+ * navigation is guarded, and the bar uses the same muted styling as disabled list rows.
11
+ */
12
+ export declare function BreadcrumbNavigation(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export { BreadcrumbNavigation } from './breadcrumb-navigation';
@@ -0,0 +1,17 @@
1
+ export declare const messages: {
2
+ breadcrumbAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ enterpriseCrumbLabel: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ truncatedLinksIconAriaLabel: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ };
@@ -0,0 +1,23 @@
1
+ import { Key } from 'react-aria-components';
2
+ import { MetadataNamespace, MetadataTemplate } from '../../types';
3
+ declare enum BrowseItemKind {
4
+ Namespace = "namespace",
5
+ Template = "template"
6
+ }
7
+ export type BrowseItem = {
8
+ id: string;
9
+ kind: BrowseItemKind.Namespace;
10
+ namespace: MetadataNamespace;
11
+ } | {
12
+ id: string;
13
+ kind: BrowseItemKind.Template;
14
+ template: MetadataTemplate;
15
+ };
16
+ export interface BrowseListProps {
17
+ /** Called when a row is activated (click, Enter, Space). */
18
+ readonly onAction: (key: Key) => void;
19
+ /** Set of currently selected template ids for visual highlight. */
20
+ readonly selectedKeys: Set<string>;
21
+ }
22
+ export declare function BrowseList({ onAction, selectedKeys }: BrowseListProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ export { BrowseList } from './browse-list';
2
+ export type { BrowseItem, BrowseListProps } from './browse-list';
@@ -0,0 +1,17 @@
1
+ export declare const messages: {
2
+ listAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ browseErrorBody: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ emptyStateBody: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ };
@@ -0,0 +1,25 @@
1
+ interface BrowserRowProps {
2
+ /** react-aria requires a unique string key for each item in the list */
3
+ readonly id: string;
4
+ /** 16px icon on the left. Omit to render no icon. */
5
+ readonly leadingIcon?: React.ReactNode;
6
+ /** Primary display text — rendered via EllipsizableText */
7
+ readonly title: string;
8
+ /** Optional second line below the title. Used by SearchTemplateRow for breadcrumb path. */
9
+ readonly subtitle?: React.ReactNode;
10
+ /** Trailing slot content. Omit to render nothing. */
11
+ readonly trailingSlot?: React.ReactNode;
12
+ /**
13
+ * When true, the trailing slot is hidden by default and revealed on row hover or focus.
14
+ * Uses CSS :hover / :focus-within — element stays in the DOM so keyboard users can always
15
+ * reach interactive elements inside.
16
+ */
17
+ readonly isTrailingSlotHoverOnly?: boolean;
18
+ }
19
+ /**
20
+ * Generic accessible list row used by `NamespaceRow` and `TemplateRow`.
21
+ * Supports an optional leading icon, primary title, subtitle, and a trailing
22
+ * action slot that can be revealed only on hover/focus.
23
+ */
24
+ export declare function BrowserRow({ id, leadingIcon, title, subtitle, trailingSlot, isTrailingSlotHoverOnly, }: BrowserRowProps): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1 @@
1
+ export { BrowserRow } from './browser-row';
@@ -0,0 +1,11 @@
1
+ export interface ErrorStateProps {
2
+ /** The error message body to display. */
3
+ readonly body: string;
4
+ /** Called when the user clicks the retry button. */
5
+ readonly onRetry: () => void;
6
+ }
7
+ /**
8
+ * Displays an error message and a retry action.
9
+ * Body copy and retry callback are provided by the caller.
10
+ */
11
+ export declare function ErrorState({ body, onRetry }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ErrorState } from './error-state';
2
+ export type { ErrorStateProps } from './error-state';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ retryLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ };
@@ -0,0 +1,15 @@
1
+ export { BreadcrumbNavigation } from './breadcrumb-navigation';
2
+ export { BrowseList } from './browse-list';
3
+ export { SearchList } from './search-list';
4
+ export type { SearchListProps } from './search-list';
5
+ export { ErrorState } from './error-state';
6
+ export { LoaderSkeleton } from './loader-skeleton';
7
+ export { MetadataTemplateBrowserContainer } from './metadata-template-browser-container';
8
+ export { MetadataTemplateBrowserController } from './metadata-template-browser-controller';
9
+ export { MetadataTemplateBrowserListBox } from './metadata-template-browser-list-box';
10
+ export { NamespaceRow } from './namespace-row';
11
+ export type { NamespaceRowProps } from './namespace-row';
12
+ export { TemplateRow } from './template-row';
13
+ export type { TemplateRowProps } from './template-row';
14
+ export { VirtualizedGridList } from './virtualized-grid-list';
15
+ export type { VirtualizedGridListProps } from './virtualized-grid-list';
@@ -0,0 +1,2 @@
1
+ export { LoadMoreErrorRow } from './load-more-error-row';
2
+ export { LoadMoreLoadingRow } from './load-more-loading-row';
@@ -0,0 +1,10 @@
1
+ interface LoadMoreErrorRowProps {
2
+ readonly onRetry: () => void;
3
+ }
4
+ /**
5
+ * An inline error row rendered at the bottom of a `VirtualizedGridList`
6
+ * when a load-more request fails. Provides a retry action without
7
+ * replacing the already-loaded items.
8
+ */
9
+ export declare function LoadMoreErrorRow({ onRetry }: LoadMoreErrorRowProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A single `GridListItem` containing three skeleton rows rendered at the
3
+ * bottom of a `VirtualizedGridList` while more items are being fetched.
4
+ * Announced to assistive technology as a loading state via `aria-busy`.
5
+ */
6
+ export declare function LoadMoreLoadingRow(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ export declare const messages: {
2
+ loadingRowAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ errorIconAriaLabel: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ loadMoreErrorBody: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ retryLabel: {
18
+ defaultMessage: string;
19
+ description: string;
20
+ id: string;
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ export { LoaderSkeleton } from './loader-skeleton';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Placeholder skeleton shown during the initial data fetch.
3
+ * Renders a fixed number of ghost rows; the container clips any overflow.
4
+ */
5
+ export declare function LoaderSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export declare const messages: {
2
+ searchInputPlaceholder: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ searchInputAriaLabel: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ searchInputClearAriaLabel: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ loadingAriaLabel: {
18
+ defaultMessage: string;
19
+ description: string;
20
+ id: string;
21
+ };
22
+ initialEmptyStateBody: {
23
+ defaultMessage: string;
24
+ description: string;
25
+ id: string;
26
+ };
27
+ initialLoadErrorBody: {
28
+ defaultMessage: string;
29
+ description: string;
30
+ id: string;
31
+ };
32
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Browser chrome: search input, breadcrumb, and the list area.
3
+ * Full-area states (load error, empty browse) are owned by
4
+ * `MetadataTemplateBrowserController`. Initial loading keeps search on screen
5
+ * (disabled) and loading confined to the list region; breadcrumbs stay hidden until
6
+ * the first browse completes.
7
+ */
8
+ export declare function MetadataTemplateBrowserContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Root rendering controller for the metadata template browser.
3
+ *
4
+ * Responsibilities:
5
+ * - Triggers `initialLoad` on mount (or when consumer-controlled `isLoading` clears).
6
+ * - Owns the host-sizing wrapper (`div.container`).
7
+ * - Decides which full-area state to show: load error or empty browse. While the
8
+ * initial list is loading, `MetadataTemplateBrowserContainer` stays mounted with
9
+ * search disabled and loading confined to the list region.
10
+ */
11
+ export declare function MetadataTemplateBrowserController(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { MetadataTemplateBrowserListBox } from './metadata-template-browser-list-box';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Container for the list area. During initial browse or consumer loading, renders
3
+ * `LoaderSkeleton` here only. Otherwise renders `BrowseList` (hidden via CSS during
4
+ * search) and `SearchList` when a query is active. Row interactions go through `onAction`.
5
+ */
6
+ export declare function MetadataTemplateBrowserListBox(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { NamespaceRow } from './namespace-row';
2
+ export type { NamespaceRowProps } from './namespace-row';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ navigateAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ };
@@ -0,0 +1,10 @@
1
+ import { MetadataNamespace } from '../../types';
2
+ export interface NamespaceRowProps {
3
+ /** The metadata namespace to display. */
4
+ readonly namespace: MetadataNamespace;
5
+ }
6
+ /**
7
+ * List row representing a metadata namespace. Shows a folder icon and a chevron
8
+ * button to navigate into the namespace.
9
+ */
10
+ export declare function NamespaceRow({ namespace }: NamespaceRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { SearchList } from './search-list';
2
+ export type { SearchListProps } from './search-list';
@@ -0,0 +1,22 @@
1
+ export declare const messages: {
2
+ listAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ emptyStateHeading: {
8
+ defaultMessage: string;
9
+ description: string;
10
+ id: string;
11
+ };
12
+ emptyStateBody: {
13
+ defaultMessage: string;
14
+ description: string;
15
+ id: string;
16
+ };
17
+ searchErrorBody: {
18
+ defaultMessage: string;
19
+ description: string;
20
+ id: string;
21
+ };
22
+ };
@@ -0,0 +1,12 @@
1
+ import { Key } from 'react-aria-components';
2
+ export interface SearchListProps {
3
+ /** Called when a row is activated (click, Enter, Space). */
4
+ readonly onAction: (key: Key) => void;
5
+ /** Set of currently selected template ids for visual highlight. */
6
+ readonly selectedKeys: Set<string>;
7
+ }
8
+ /**
9
+ * Renders the search results area. Shows a loading skeleton, error state,
10
+ * empty state, or the list of matching templates depending on current search state.
11
+ */
12
+ export declare function SearchList({ onAction, selectedKeys }: SearchListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { TemplateRow } from './template-row';
2
+ export type { TemplateRowProps } from './template-row';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ editAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ };
@@ -0,0 +1,19 @@
1
+ import { MetadataTemplate, TemplateRowVariant } from '../../types';
2
+ export interface TemplateRowProps {
3
+ /** The metadata template to display. */
4
+ readonly template: MetadataTemplate;
5
+ /**
6
+ * Controls presentation mode:
7
+ * - `Browse` — shows the metadata icon, hides the breadcrumb path.
8
+ * - `Search` — hides the icon, shows the breadcrumb path from `template.ancestors`.
9
+ * Explicit variant avoids relying on the presence of `ancestors` to infer context.
10
+ */
11
+ readonly variant: TemplateRowVariant;
12
+ /** Called when the edit button is clicked. */
13
+ readonly onEdit: (templateId: string) => void;
14
+ }
15
+ /**
16
+ * List row representing a metadata template. Renders differently based on `variant`:
17
+ * browse shows the metadata icon; search shows the ancestor breadcrumb path as a subtitle.
18
+ */
19
+ export declare function TemplateRow({ template, variant, onEdit }: TemplateRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ interface GridListLoadMoreSentinelProps {
2
+ readonly onLoadMore: () => void;
3
+ readonly scrollContainerRef: React.RefObject<HTMLDivElement>;
4
+ }
5
+ /**
6
+ * A visually hidden sentinel rendered as a `GridListItem` at the end of a
7
+ * `VirtualizedGridList`. Calls `onLoadMore` when the user has scrolled within
8
+ * one container height of the bottom. Uses a scroll event listener on the
9
+ * provided `scrollContainerRef` rather than firing on mount, so it never
10
+ * triggers prematurely during the Virtualizer's initial render pass.
11
+ *
12
+ * Callers must guard against in-flight duplicates (e.g. via `isFetchingMore`).
13
+ */
14
+ export declare function GridListLoadMoreSentinel({ onLoadMore, scrollContainerRef }: GridListLoadMoreSentinelProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ export { VirtualizedGridList } from './virtualized-grid-list';
2
+ export type { VirtualizedGridListProps } from './virtualized-grid-list';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ loadMoreSentinelAriaLabel: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ };
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ import { Key } from 'react-aria-components';
3
+ import { TemplateRowVariant } from '../../types';
4
+ export interface VirtualizedGridListProps<T extends {
5
+ id: string;
6
+ }> {
7
+ /** Accessible label for the underlying `GridList` element. */
8
+ readonly ariaLabel: string;
9
+ /** Flat array of items to render; each must have a stable string `id`. */
10
+ readonly items: T[];
11
+ /** Called with the item `id` when a row is activated (click, Enter, Space). */
12
+ readonly onAction: (key: Key) => void;
13
+ /** Render function that maps a data item to its row element. */
14
+ readonly children: (item: T) => ReactNode;
15
+ /** Called when the user scrolls near the bottom of the list. */
16
+ readonly onLoadMore: () => void;
17
+ /** When true, more pages are available and the load-more sentinel is active. */
18
+ readonly hasMoreItems: boolean;
19
+ /** When true, a skeleton loading row is shown at the bottom of the list. */
20
+ readonly isFetchingMore: boolean;
21
+ /** When non-null, an error row with a retry button is shown at the bottom. */
22
+ readonly loadMoreError: string | null;
23
+ /** Called when the user activates the retry action on the load-more error row. */
24
+ readonly onRetry: () => void;
25
+ /** Set of selected item ids for visual highlight. */
26
+ readonly selectedKeys: Set<string>;
27
+ /** Controls the estimated row height for the virtual layout. Browse rows are single-line; search rows include a subtitle. */
28
+ readonly listType: TemplateRowVariant;
29
+ }
30
+ /**
31
+ * Generic virtualized list built on react-aria `GridList` + `ListLayout`.
32
+ * Renders only the visible rows for performance; requires each item to have
33
+ * a stable string `id`. All interactions (click, Enter, Space) fire `onAction`.
34
+ */
35
+ export declare function VirtualizedGridList<T extends {
36
+ id: string;
37
+ }>({ ariaLabel, items, onAction, children, onLoadMore, hasMoreItems, isFetchingMore, loadMoreError, onRetry, selectedKeys, listType, }: VirtualizedGridListProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FetchResponse, MetadataNamespace, MetadataTemplate } from './types';
2
+ export declare const LOAD_MORE_ERROR_ROW_ID = "LOAD_MORE_ERROR_ROW_ID";
3
+ export declare const LOAD_MORE_LOADING_ROW_ID = "LOAD_MORE_LOADING_ROW_ID";
4
+ export declare const LOAD_MORE_SENTINEL_ID = "LOAD_MORE_SENTINEL_ID";
5
+ export declare const PAGE_SIZE = 200;
6
+ export declare const SEARCH_DEBOUNCE_MS = 500;
7
+ export declare const emptyNamespacesResponse: FetchResponse<MetadataNamespace>;
8
+ export declare const emptyTemplatesResponse: FetchResponse<MetadataTemplate>;
@@ -0,0 +1,47 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { BrowserActionsContextValue, BrowseStateContextValue, ConsumerStateContextValue, EventService, ItemsService, LevelCache, NavigationStateContextValue, SearchStateContextValue, SelectionStateContextValue } from '../types';
3
+ import { BrowserAction, BrowserState } from './reducer';
4
+ /** Holds the current namespace FQN and breadcrumb path for navigation. */
5
+ export declare const NavigationStateContext: import('react').Context<NavigationStateContextValue | null>;
6
+ interface NavigationStateContextProviderProps extends NavigationStateContextValue {
7
+ readonly children: React.ReactNode;
8
+ }
9
+ export declare function NavigationStateContextProvider({ children, namespaceFQN, path, }: Readonly<NavigationStateContextProviderProps>): import("react/jsx-runtime").JSX.Element;
10
+ /** Holds the current page of namespaces and templates, fetch flags, and error state for browse mode. */
11
+ export declare const BrowseStateContext: import('react').Context<BrowseStateContextValue | null>;
12
+ interface BrowseStateContextProviderProps extends BrowseStateContextValue {
13
+ readonly children: React.ReactNode;
14
+ }
15
+ export declare function BrowseStateContextProvider({ children, namespaces, templates, isNamespacesExhausted, namespaceNextMarker, templateNextMarker, isFetching, isFetchingMore, initialLoadError, browseError, loadMoreError, }: Readonly<BrowseStateContextProviderProps>): import("react/jsx-runtime").JSX.Element;
16
+ /** Holds the search input value, debounced query, results, and search-specific fetch/error state. */
17
+ export declare const SearchStateContext: import('react').Context<SearchStateContextValue | null>;
18
+ interface SearchStateContextProviderProps extends SearchStateContextValue {
19
+ readonly children: React.ReactNode;
20
+ }
21
+ export declare function SearchStateContextProvider({ children, searchValue, searchQuery, searchResults, searchNextMarker, isFetchingSearch, searchError, }: Readonly<SearchStateContextProviderProps>): import("react/jsx-runtime").JSX.Element;
22
+ /** Holds the currently selected template ID, or `null` when no template is selected. */
23
+ export declare const SelectionStateContext: import('react').Context<SelectionStateContextValue | null>;
24
+ interface SelectionStateContextProviderProps extends SelectionStateContextValue {
25
+ readonly children: React.ReactNode;
26
+ }
27
+ export declare function SelectionStateContextProvider({ children, selectedTemplateId, }: Readonly<SelectionStateContextProviderProps>): import("react/jsx-runtime").JSX.Element;
28
+ /** Consumer-controlled loading and disabled flags passed from `MetadataTemplateBrowser`. */
29
+ export declare const ConsumerStateContext: import('react').Context<ConsumerStateContextValue | null>;
30
+ export interface ConsumerStateContextProviderProps {
31
+ readonly children: React.ReactNode;
32
+ readonly isLoading?: boolean;
33
+ readonly isDisabled?: boolean;
34
+ }
35
+ export declare function ConsumerStateContextProvider({ children, isLoading, isDisabled, }: Readonly<ConsumerStateContextProviderProps>): import("react/jsx-runtime").JSX.Element;
36
+ /** Exposes all browser action creators (navigate, search, select, retry, etc.) to the component tree. */
37
+ export declare const BrowserActionsContext: import('react').Context<BrowserActionsContextValue | null>;
38
+ interface BrowserActionsContextProviderProps {
39
+ readonly children: React.ReactNode;
40
+ readonly itemsServiceRef: MutableRefObject<ItemsService>;
41
+ readonly eventServiceRef: MutableRefObject<EventService>;
42
+ readonly stateRef: MutableRefObject<BrowserState>;
43
+ readonly dispatch: React.Dispatch<BrowserAction>;
44
+ readonly levelCache: MutableRefObject<Map<string, LevelCache>>;
45
+ }
46
+ export declare function BrowserActionsContextProvider({ children, itemsServiceRef, eventServiceRef, stateRef, dispatch, levelCache, }: Readonly<BrowserActionsContextProviderProps>): import("react/jsx-runtime").JSX.Element;
47
+ export {};
@@ -0,0 +1,13 @@
1
+ import { BrowserActionsContextValue, BrowseStateContextValue, ConsumerStateContextValue, NavigationStateContextValue, SearchStateContextValue, SelectionStateContextValue } from '../types';
2
+ /** Returns the current namespace FQN and breadcrumb path. Must be used inside `MetadataTemplateBrowserProvider`. */
3
+ export declare function useNavigationState(): NavigationStateContextValue;
4
+ /** Returns browse-mode state: namespaces, templates, fetch flags, and error values. Must be used inside `MetadataTemplateBrowserProvider`. */
5
+ export declare function useBrowseState(): BrowseStateContextValue;
6
+ /** Returns search state: input value, debounced query, results, and search-specific fetch/error. Must be used inside `MetadataTemplateBrowserProvider`. */
7
+ export declare function useSearchState(): SearchStateContextValue;
8
+ /** Returns the currently selected template ID (`null` when nothing is selected). Must be used inside `MetadataTemplateBrowserProvider`. */
9
+ export declare function useSelectionState(): SelectionStateContextValue;
10
+ /** Returns consumer-driven `isLoading` / `isDisabled` from `MetadataTemplateBrowser`. Must be used inside `ConsumerStateContextProvider`. */
11
+ export declare function useConsumerState(): ConsumerStateContextValue;
12
+ /** Returns all browser action creators (navigate, search, select, retry, etc.). Must be used inside `MetadataTemplateBrowserProvider`. */
13
+ export declare function useBrowserActions(): BrowserActionsContextValue;
@@ -0,0 +1,7 @@
1
+ export { browserReducer, initialState } from './reducer';
2
+ export type { BrowserAction, BrowserState } from './reducer';
3
+ export { ConsumerStateContext, ConsumerStateContextProvider } from './contexts';
4
+ export type { ConsumerStateContextProviderProps } from './contexts';
5
+ export { MetadataTemplateBrowserProvider } from './provider';
6
+ export type { MetadataTemplateBrowserProviderProps } from './provider';
7
+ export { useBrowserActions, useBrowseState, useConsumerState, useNavigationState, useSearchState, useSelectionState, } from './hooks';
@@ -0,0 +1,14 @@
1
+ import { EventService, ItemsService } from '../types';
2
+ export interface MetadataTemplateBrowserProviderProps {
3
+ readonly children: React.ReactNode;
4
+ readonly namespaceFQN: string;
5
+ readonly itemsService: ItemsService;
6
+ readonly eventService: EventService;
7
+ readonly initialSelectedTemplateId?: string;
8
+ }
9
+ /**
10
+ * Root context provider for the metadata template browser. Initialises the
11
+ * reducer, wraps consumer-provided services in stable refs, and composes all
12
+ * state and actions contexts in a single tree.
13
+ */
14
+ export declare function MetadataTemplateBrowserProvider({ children, namespaceFQN, itemsService, eventService, initialSelectedTemplateId, }: Readonly<MetadataTemplateBrowserProviderProps>): import("react/jsx-runtime").JSX.Element;