@kortix/ui 0.16.1 → 0.16.2

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 (277) hide show
  1. package/dist/_vendor/kortix-shared.js +133 -26
  2. package/dist/_vendor/shared/index.d.ts +1 -0
  3. package/dist/_vendor/shared/space-icon.d.ts +30 -0
  4. package/dist/_vendor/shared/space-slug.d.ts +12 -0
  5. package/dist/access/access/access-dialog.js +2 -2
  6. package/dist/access/share-dialog.d.ts +77 -0
  7. package/dist/access/share-dialog.js +160 -0
  8. package/dist/access/sharing-picker.d.ts +8 -1
  9. package/dist/access/sharing-picker.js +2 -2
  10. package/dist/changes/change-list.js +3 -3
  11. package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
  12. package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
  13. package/dist/customize/providers/provider-sheet.js +17 -7
  14. package/dist/customize/sections/component/manifest-copy-block.js +1 -1
  15. package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
  16. package/dist/customize/sections/component/section-wrapper.js +3 -3
  17. package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
  18. package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/settings/settings-tabs.js +0 -5
  21. package/dist/customize/settings/tabs/general-tab.js +2 -2
  22. package/dist/customize/shared/capability-page-shell.d.ts +2 -2
  23. package/dist/customize/shared/capability-page-shell.js +7 -5
  24. package/dist/customize/shared/capability-scroll-root.js +1 -2
  25. package/dist/customize/shared/catalog/catalog-card.js +1 -1
  26. package/dist/files/project/components/change-requests-panel.js +2 -2
  27. package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
  28. package/dist/files/project/components/checkpoints-panel.js +2 -2
  29. package/dist/files/project/components/drive-explorer.js +2 -2
  30. package/dist/files/project/components/file-breadcrumbs.js +1 -1
  31. package/dist/files/project/components/file-history-popover.js +2 -2
  32. package/dist/files/project/components/file-thumbnail.js +1 -1
  33. package/dist/files/project/components/open-change-request-dialog.js +1 -1
  34. package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
  35. package/dist/files/renderers/show-content-renderer.js +6 -6
  36. package/dist/files/renderers/sqlite-renderer.js +8 -8
  37. package/dist/files/renderers/zip/zip-renderer.js +2 -2
  38. package/dist/files/viewer/file-content-renderer.js +5 -5
  39. package/dist/files/viewer/json-tree-view.js +3 -3
  40. package/dist/i18n/en.d.ts +131 -8
  41. package/dist/i18n/en.js +167 -44
  42. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
  43. package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
  44. package/dist/internal/billing/use-cost-explorer.js +22 -0
  45. package/dist/internal/billing/use-session-costs.d.ts +7 -2
  46. package/dist/internal/billing/use-session-costs.js +6 -0
  47. package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
  48. package/dist/internal/chrome/use-chrome-offered.js +3 -3
  49. package/dist/internal/components/nav-rail.d.ts +1 -20
  50. package/dist/internal/components/nav-rail.js +1 -15
  51. package/dist/internal/layout/project-page-header.d.ts +13 -9
  52. package/dist/internal/layout/project-page-header.js +14 -10
  53. package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
  54. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
  55. package/dist/internal/lib/error-handler.js +0 -9
  56. package/dist/internal/lib/interface-theme-defaults.js +2 -2
  57. package/dist/internal/lib/project-actions.d.ts +4 -5
  58. package/dist/internal/lib/project-actions.js +3 -5
  59. package/dist/internal/lib/project-preamble.d.ts +42 -4
  60. package/dist/internal/lib/project-preamble.js +49 -5
  61. package/dist/internal/lib/web-notifications.js +17 -29
  62. package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
  63. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  64. package/dist/internal/stores/user-preferences-store.d.ts +2 -2
  65. package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
  66. package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
  67. package/dist/lib/routes.d.ts +7 -0
  68. package/dist/lib/routes.js +6 -1
  69. package/dist/markdown/doc-editor/doc-extensions.js +2 -0
  70. package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
  71. package/dist/markdown/doc-editor/doc-paste.js +67 -0
  72. package/dist/markdown/markdown-frontmatter.js +3 -3
  73. package/dist/markdown/markdown-policy.d.ts +1 -1
  74. package/dist/markdown/ordered-list.js +1 -1
  75. package/dist/primitives/context-menu.d.ts +1 -0
  76. package/dist/primitives/definition-list.js +1 -1
  77. package/dist/primitives/dropdown-menu.d.ts +1 -0
  78. package/dist/primitives/emoji-picker.js +1 -1
  79. package/dist/primitives/expandable-search.d.ts +57 -0
  80. package/dist/primitives/expandable-search.js +58 -0
  81. package/dist/primitives/favicon-avatar.js +1 -1
  82. package/dist/primitives/file-tree.d.ts +1 -1
  83. package/dist/primitives/file-tree.js +1 -1
  84. package/dist/primitives/glyph-picker.js +2 -2
  85. package/dist/primitives/input-group.js +1 -1
  86. package/dist/primitives/menu-base.d.ts +10 -0
  87. package/dist/primitives/menu-base.js +7 -2
  88. package/dist/primitives/phone-input.js +1 -1
  89. package/dist/primitives/profile-hover-card.d.ts +28 -0
  90. package/dist/primitives/profile-hover-card.js +22 -0
  91. package/dist/primitives/settings-section-header.d.ts +5 -5
  92. package/dist/primitives/settings-section-header.js +5 -5
  93. package/dist/primitives/sort-menu.d.ts +23 -0
  94. package/dist/primitives/sort-menu.js +54 -0
  95. package/dist/primitives/tabs.js +1 -1
  96. package/dist/primitives/toast-clearance.d.ts +12 -28
  97. package/dist/primitives/toast-clearance.js +23 -45
  98. package/dist/primitives/user-avatar.js +2 -3
  99. package/dist/session/agents/subagent-dialog-content.js +28 -70
  100. package/dist/session/composer/ComposerCard.d.ts +4 -1
  101. package/dist/session/composer/ComposerCard.js +51 -7
  102. package/dist/session/composer/composer-chat-input.js +3 -1
  103. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  104. package/dist/session/composer/composer-toolbar.js +6 -2
  105. package/dist/session/composer/composer-underbar.d.ts +3 -1
  106. package/dist/session/composer/composer-underbar.js +2 -2
  107. package/dist/session/composer/composer.d.ts +12 -0
  108. package/dist/session/composer/composer.js +112 -6
  109. package/dist/session/composer/draft/composer-draft.d.ts +1 -0
  110. package/dist/session/composer/draft/composer-draft.js +10 -2
  111. package/dist/session/composer/draft/draft-uploads.js +13 -2
  112. package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
  113. package/dist/session/composer/draft/use-composer-draft.js +41 -6
  114. package/dist/session/composer/drive-mentions.d.ts +34 -0
  115. package/dist/session/composer/drive-mentions.js +98 -0
  116. package/dist/session/composer/editor/composer-editor.d.ts +3 -0
  117. package/dist/session/composer/editor/composer-editor.js +3 -1
  118. package/dist/session/composer/editor/serialize.js +3 -4
  119. package/dist/session/composer/menus/mention-controller.d.ts +3 -0
  120. package/dist/session/composer/menus/mention-controller.js +5 -0
  121. package/dist/session/composer/menus/mention-menu.d.ts +20 -3
  122. package/dist/session/composer/menus/mention-menu.js +33 -6
  123. package/dist/session/composer/menus/menu-items.d.ts +16 -1
  124. package/dist/session/composer/menus/menu-items.js +21 -1
  125. package/dist/session/composer/submit-latch.d.ts +3 -1
  126. package/dist/session/composer/submit-latch.js +5 -1
  127. package/dist/session/composer/types.d.ts +9 -2
  128. package/dist/session/header/session-changes-indicator.js +1 -1
  129. package/dist/session/header/session-site-header.js +2 -2
  130. package/dist/session/media/sandbox-url-detector.js +3 -3
  131. package/dist/session/models/model-connection-gate.d.ts +5 -0
  132. package/dist/session/models/model-connection-gate.js +12 -3
  133. package/dist/session/models/model-connection-layout.d.ts +7 -0
  134. package/dist/session/models/model-connection-layout.js +7 -0
  135. package/dist/session/models/provider-failure-recovery.js +1 -1
  136. package/dist/session/models/subscription-offer.d.ts +6 -5
  137. package/dist/session/models/subscription-offer.js +6 -6
  138. package/dist/session/panel/advanced/advanced-panel.js +1 -1
  139. package/dist/session/panel/session-detail-panel.js +1 -1
  140. package/dist/session/panel/session-diff-viewer.js +1 -1
  141. package/dist/session/panel/session-files-explorer.js +1 -1
  142. package/dist/session/panel/session-files-panel.js +3 -3
  143. package/dist/session/panel/shared/action-navigator.js +1 -1
  144. package/dist/session/status/provisioning-failure.d.ts +4 -4
  145. package/dist/session/status/provisioning-failure.js +4 -4
  146. package/dist/session/status/session-busy-indicator.js +1 -1
  147. package/dist/session/status/session-error-banner.js +6 -1
  148. package/dist/session/thread/mention-chip.d.ts +1 -1
  149. package/dist/session/thread/mention-segments.d.ts +4 -2
  150. package/dist/session/thread/mention-segments.js +28 -1
  151. package/dist/session/thread/message-parsing.d.ts +11 -0
  152. package/dist/session/thread/message-parsing.js +22 -3
  153. package/dist/session/thread/optimistic-turn.d.ts +4 -2
  154. package/dist/session/thread/optimistic-turn.js +13 -11
  155. package/dist/session/thread/session-chat.js +6 -1
  156. package/dist/session/thread/session-context-message-explorer.js +1 -1
  157. package/dist/session/thread/session-older-autoload.d.ts +2 -3
  158. package/dist/session/thread/session-older-autoload.js +2 -3
  159. package/dist/session/thread/transcript.js +8 -10
  160. package/dist/session/tool/shared/error-and-connector.js +1 -1
  161. package/dist/session/tool/shared/file-list.js +2 -2
  162. package/dist/session/tool/shared/infrastructure-parts.js +1 -1
  163. package/dist/session/tool/shared/infrastructure-preview.js +1 -1
  164. package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
  165. package/dist/session/tool/shared/infrastructure-rows.js +2 -2
  166. package/dist/session/tool/shared/output-block.js +4 -4
  167. package/dist/session/tool/shared/session-helpers.js +3 -3
  168. package/dist/session/tool/shared/structured-output.js +3 -3
  169. package/dist/session/tool/shared/todo-helpers.js +1 -1
  170. package/dist/session/tool/tool-error.js +2 -2
  171. package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
  172. package/dist/session/tool/tools/agent-status-tool.js +1 -1
  173. package/dist/session/tool/tools/apply-patch-tool.js +1 -1
  174. package/dist/session/tool/tools/connector-get-tool.js +1 -1
  175. package/dist/session/tool/tools/connector-list-tool.js +1 -1
  176. package/dist/session/tool/tools/connector-tools.js +1 -1
  177. package/dist/session/tool/tools/edit-tool.js +1 -1
  178. package/dist/session/tool/tools/get-mem-tool.js +1 -1
  179. package/dist/session/tool/tools/glob-tool.js +1 -1
  180. package/dist/session/tool/tools/image-search-tool.js +1 -1
  181. package/dist/session/tool/tools/memory-search-tool.js +1 -1
  182. package/dist/session/tool/tools/memory-tool.js +4 -4
  183. package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
  184. package/dist/session/tool/tools/project-delete-tool.js +1 -1
  185. package/dist/session/tool/tools/project-list-tool.js +1 -1
  186. package/dist/session/tool/tools/pty-read-tool.js +1 -1
  187. package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
  188. package/dist/session/tool/tools/pty-write-tool.js +1 -1
  189. package/dist/session/tool/tools/read-tool.js +1 -1
  190. package/dist/session/tool/tools/removed-connector-tool.js +1 -1
  191. package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
  192. package/dist/session/tool/tools/session-get-tool.js +3 -3
  193. package/dist/session/tool/tools/session-list-background-tool.js +1 -1
  194. package/dist/session/tool/tools/session-read-tool.js +1 -1
  195. package/dist/session/tool/tools/session-search-tool.js +1 -1
  196. package/dist/session/tool/tools/session-spawn-tool.js +1 -1
  197. package/dist/session/tool/tools/skill-tool.js +1 -1
  198. package/dist/session/tool/tools/todo-write-tool.js +1 -1
  199. package/dist/session/tool/tools/web-fetch-tool.js +1 -1
  200. package/dist/session/tool/tools/write-tool.js +1 -1
  201. package/dist/session/turn/activity-file-chips.js +7 -3
  202. package/dist/session/turn/activity-step.js +1 -1
  203. package/dist/session/turn/burst-summary-trigger.js +3 -3
  204. package/dist/session/turn/chain-step-trigger.js +1 -1
  205. package/dist/session/turn/plan-card.js +1 -1
  206. package/dist/session/turn/thought-chain-step.js +1 -1
  207. package/dist/session/turn/turn-work-accordion.js +1 -1
  208. package/dist/session/turn/user-message.js +13 -6
  209. package/dist/session/voice/use-call-card-position.d.ts +30 -0
  210. package/dist/session/voice/use-call-card-position.js +126 -0
  211. package/dist/session/voice/voice-call-card.js +10 -3
  212. package/dist/styles/theme.css +12 -0
  213. package/dist/styles/tokens.css +12 -6
  214. package/dist/styles.css +1 -1
  215. package/dist/terminal/session-terminal-panel.js +1 -1
  216. package/dist/test-utils/intl.d.ts +131 -8
  217. package/dist/workspace/admin/project-admin-dashboard.js +7 -24
  218. package/dist/workspace/calendar/calendar-page.js +1 -1
  219. package/dist/workspace/home/first-chat.d.ts +4 -3
  220. package/dist/workspace/home/first-chat.js +6 -6
  221. package/dist/workspace/home/welcome-body.js +2 -2
  222. package/dist/workspace/index.d.ts +1 -1
  223. package/dist/workspace/index.js +1 -1
  224. package/dist/workspace/layout/project-home.js +9 -3
  225. package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
  226. package/dist/workspace/layout/use-project-home-send.js +6 -2
  227. package/dist/workspace/memory/company-memory-page.js +2 -4
  228. package/dist/workspace/new/github-source.js +0 -1
  229. package/dist/workspace/new/new-workspace-form.d.ts +0 -1
  230. package/dist/workspace/new/new-workspace-form.js +0 -3
  231. package/dist/workspace/new/use-create-workspace.d.ts +1 -1
  232. package/dist/workspace/new/use-create-workspace.js +1 -2
  233. package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
  234. package/dist/workspace/session-spaces/space-detail-page.js +307 -0
  235. package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
  236. package/dist/workspace/session-spaces/space-form-modal.js +92 -0
  237. package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
  238. package/dist/workspace/session-spaces/space-icon.js +52 -0
  239. package/dist/workspace/session-spaces/space-people.d.ts +51 -0
  240. package/dist/workspace/session-spaces/space-people.js +91 -0
  241. package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
  242. package/dist/workspace/session-spaces/space-picker.js +42 -0
  243. package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
  244. package/dist/workspace/session-spaces/space-share-modal.js +93 -0
  245. package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
  246. package/dist/workspace/session-spaces/spaces-page.js +125 -0
  247. package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
  248. package/dist/workspace/sessions/session-owner-filters.js +2 -0
  249. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
  250. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
  251. package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
  252. package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
  253. package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
  254. package/dist/workspace/sidebar/footer/promo-card.js +31 -2
  255. package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
  256. package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
  257. package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
  258. package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
  259. package/dist/workspace/sidebar/project-nav-items.js +3 -8
  260. package/dist/workspace/sidebar/project-session-list.js +19 -12
  261. package/dist/workspace/sidebar/project-sidebar.js +13 -13
  262. package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
  263. package/dist/workspace/sidebar/session-filter-menu.js +19 -13
  264. package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
  265. package/dist/workspace/sidebar/session-group-sections.js +56 -75
  266. package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
  267. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
  268. package/dist/workspace/spaces/space-tabs.d.ts +26 -6
  269. package/dist/workspace/spaces/space-tabs.js +19 -8
  270. package/package.json +27 -31
  271. package/skills/kortix-ui/references/modules.md +2 -2
  272. package/dist/workspace/new/clone-param.d.ts +0 -11
  273. package/dist/workspace/new/clone-param.js +0 -15
  274. package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
  275. package/dist/workspace/new/provision-new-workspace.js +0 -14
  276. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
  277. package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
@@ -40,14 +40,6 @@ interface WorkspaceSettingsRailState {
40
40
  */
41
41
  returnTo: Record<string, string>;
42
42
  setReturnTo: (projectId: string, href: string) => void;
43
- /**
44
- * The project sidebar is docked open on the desktop, so on a settings route
45
- * it shows this rail. The page then hides its own rail: one rail on screen,
46
- * never two. A host without the project sidebar never sets it, so its page
47
- * keeps the rail.
48
- */
49
- sidebarDocked: boolean;
50
- setSidebarDocked: (sidebarDocked: boolean) => void;
51
43
  /**
52
44
  * A settings search result waiting to land: once `section` is on screen,
53
45
  * the page scrolls to `text` and marks it (`useSettingsSearchLanding`).
@@ -4,8 +4,6 @@ export const useWorkspaceSettingsRailStore = create((set) => ({
4
4
  setRail: (rail) => set({ rail }),
5
5
  returnTo: {},
6
6
  setReturnTo: (projectId, href) => set((state) => (state.returnTo[projectId] === href ? state : { returnTo: { ...state.returnTo, [projectId]: href } })),
7
- sidebarDocked: false,
8
- setSidebarDocked: (sidebarDocked) => set({ sidebarDocked }),
9
7
  pendingFind: null,
10
8
  setPendingFind: (pendingFind) => set({ pendingFind }),
11
9
  }));
@@ -67,6 +67,13 @@ export interface UiRoutes {
67
67
  * too, so it never links a page it does not serve.
68
68
  */
69
69
  inbox?: () => string | null;
70
+ /**
71
+ * The workspace's Spaces (session groups, flag `session_groups`), and one
72
+ * space's page. apps/web pages: a host that maps any route links them only
73
+ * when it maps them too.
74
+ */
75
+ sessionSpaces?: (projectId: string) => string | null;
76
+ sessionSpace?: (projectId: string, groupId: string) => string | null;
70
77
  }
71
78
  export declare const defaultUiRoutes: UiRoutes;
72
79
  /**
@@ -19,6 +19,8 @@ const DEFAULT_ROUTES = {
19
19
  // The workspace Review queue has its own page.
20
20
  review: (p) => `/workspaces/${p}/review`,
21
21
  inbox: () => '/inbox',
22
+ sessionSpaces: (p) => `/workspaces/${p}/spaces`,
23
+ sessionSpace: (p, groupId) => `/workspaces/${p}/space/${encodeURIComponent(groupId)}`,
22
24
  };
23
25
  export const defaultUiRoutes = DEFAULT_ROUTES;
24
26
  let routes = DEFAULT_ROUTES;
@@ -34,7 +36,10 @@ export function setUiRoutes(overrides) {
34
36
  const review = overrides.review ?? (overrides.customize ? undefined : DEFAULT_ROUTES.review);
35
37
  // Inbox is apps/web's page: a host that maps any route links it only when it maps `inbox`.
36
38
  const inbox = overrides.inbox ?? (Object.keys(overrides).length === 0 ? DEFAULT_ROUTES.inbox : undefined);
37
- routes = { ...DEFAULT_ROUTES, ...overrides, ...(admin ? { admin } : {}), review, inbox };
39
+ const ownsAll = Object.keys(overrides).length === 0;
40
+ const sessionSpaces = overrides.sessionSpaces ?? (ownsAll ? DEFAULT_ROUTES.sessionSpaces : undefined);
41
+ const sessionSpace = overrides.sessionSpace ?? (ownsAll ? DEFAULT_ROUTES.sessionSpace : undefined);
42
+ routes = { ...DEFAULT_ROUTES, ...overrides, ...(admin ? { admin } : {}), review, inbox, sessionSpaces, sessionSpace };
38
43
  }
39
44
  export function uiRoutes() {
40
45
  return routes;
@@ -31,6 +31,7 @@ import { SafeAttributes, attrBoolean, attrString, attrStringOrNull } from './doc
31
31
  import { LinkEmbed } from './doc-embed.js';
32
32
  import { MarkdownSource, PastedMarkdownSource, RAW_ATTRIBUTE } from './doc-fidelity.js';
33
33
  import { safeNodeView } from './doc-node-view.js';
34
+ import { MarkdownPaste } from './doc-paste.js';
34
35
  // Hosts that render their own node views (the co-editing editor) use the same guards.
35
36
  export { attrBoolean, attrString, attrStringOrNull, safeNodeView };
36
37
  /**
@@ -190,6 +191,7 @@ export function docExtensions({ editable, placeholder, }) {
190
191
  RawMarkdown,
191
192
  MarkdownSource,
192
193
  PastedMarkdownSource,
194
+ MarkdownPaste,
193
195
  SafeAttributes,
194
196
  Placeholder.configure({ placeholder: ({ node }) => placeholder(node) }),
195
197
  ];
@@ -0,0 +1,13 @@
1
+ import { Extension } from '@tiptap/core';
2
+ /**
3
+ * Whether pasted text is written in Markdown. Indented text is not a code
4
+ * block, a bare URL is not a link, and text with HTML in it stays text: it
5
+ * would open as a raw block.
6
+ */
7
+ export declare function isMarkdown(text: string): boolean;
8
+ /**
9
+ * Markdown pasted as text opens as formatting, as it does when typed or when
10
+ * the file opens. Shift+paste and a paste into code keep the text as is, and
11
+ * a clipboard with formatted HTML keeps that HTML.
12
+ */
13
+ export declare const MarkdownPaste: Extension<any, any>;
@@ -0,0 +1,67 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { Plugin, PluginKey } from '@tiptap/pm/state';
3
+ import { Lexer, Marked } from 'marked';
4
+ import { markdownToHtml } from './markdown.js';
5
+ /** What only Markdown spells: a typed `- `, `#### ` or `**…**` turns into these. */
6
+ const FORMATTING = new Set(['heading', 'list', 'blockquote', 'table', 'hr', 'strong', 'em', 'codespan', 'del', 'image']);
7
+ const walker = new Marked();
8
+ /**
9
+ * Whether pasted text is written in Markdown. Indented text is not a code
10
+ * block, a bare URL is not a link, and text with HTML in it stays text: it
11
+ * would open as a raw block.
12
+ */
13
+ export function isMarkdown(text) {
14
+ let markdown = false;
15
+ let html = false;
16
+ walker.walkTokens(Lexer.lex(text), (token) => {
17
+ if (token.type === 'html')
18
+ html = true;
19
+ else if (FORMATTING.has(token.type) ||
20
+ (token.type === 'code' && token.codeBlockStyle !== 'indented') ||
21
+ (token.type === 'link' && token.raw !== token.href))
22
+ markdown = true;
23
+ });
24
+ return markdown && !html;
25
+ }
26
+ /** HTML that carries its own formatting (a web page, another doc), not a code editor's styled lines. */
27
+ const FORMATTED = 'h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre,code,strong,b,em,i,u,s,del,a,img,hr';
28
+ const isFormatted = (html) => new DOMParser().parseFromString(html, 'text/html').querySelector(FORMATTED) !== null;
29
+ /**
30
+ * Markdown pasted as text opens as formatting, as it does when typed or when
31
+ * the file opens. Shift+paste and a paste into code keep the text as is, and
32
+ * a clipboard with formatted HTML keeps that HTML.
33
+ */
34
+ export const MarkdownPaste = Extension.create({
35
+ name: 'markdownPaste',
36
+ addProseMirrorPlugins() {
37
+ // Shift held: ProseMirror's own rule for "paste as plain text" (Shift+Insert is a normal paste).
38
+ let plain = false;
39
+ return [
40
+ new Plugin({
41
+ key: new PluginKey('markdownPaste'),
42
+ props: {
43
+ handleDOMEvents: {
44
+ keydown: (_view, event) => {
45
+ plain = event.shiftKey && event.key !== 'Insert';
46
+ return false;
47
+ },
48
+ keyup: (_view, event) => {
49
+ if (event.key === 'Shift')
50
+ plain = false;
51
+ return false;
52
+ },
53
+ },
54
+ handlePaste: (view, event) => {
55
+ const text = event.clipboardData?.getData('text/plain') ?? '';
56
+ const html = event.clipboardData?.getData('text/html') ?? '';
57
+ if (plain || view.state.selection.$from.parent.type.spec.code || !isMarkdown(text) || (html && isFormatted(html)))
58
+ return false;
59
+ // No event: the converted paste carries no clipboard, so this handler lets it through.
60
+ view.pasteHTML(markdownToHtml(text));
61
+ return true;
62
+ },
63
+ },
64
+ }),
65
+ ];
66
+ },
67
+ });
@@ -105,8 +105,8 @@ function NestedTable({ data }) {
105
105
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
106
106
  const entries = Object.entries(data);
107
107
  if (entries.length === 0)
108
- return _jsx("span", { className: "text-muted-foreground/60", children: "\u2014" });
109
- return (_jsx("div", { className: "inline-flex flex-wrap gap-x-3 gap-y-1", children: entries.map(([k, v]) => (_jsxs(Badge, { size: "sm", variant: "secondary", className: "gap-1", children: [_jsx("span", { className: "text-muted-foreground/70", children: k }), _jsx("span", { className: "text-muted-foreground/30", children: tI18nComplete.raw('text3b9453dad42b') }), _jsx(ScalarValue, { value: v })] }, k))) }));
108
+ return _jsx("span", { className: "text-muted-foreground", children: "\u2014" });
109
+ return (_jsx("div", { className: "inline-flex flex-wrap gap-x-3 gap-y-1", children: entries.map(([k, v]) => (_jsxs(Badge, { size: "sm", variant: "secondary", className: "gap-1", children: [_jsx("span", { className: "text-muted-foreground", children: k }), _jsx("span", { className: "text-muted-foreground", children: tI18nComplete.raw('text3b9453dad42b') }), _jsx(ScalarValue, { value: v })] }, k))) }));
110
110
  }
111
111
  /**
112
112
  * Value cell: capped at `VALUE_COLLAPSED_MAX_H` + fade while collapsed,
@@ -154,5 +154,5 @@ export function MarkdownFrontmatterCard({ data, className, }) {
154
154
  const entries = Object.entries(data);
155
155
  if (entries.length === 0)
156
156
  return null;
157
- return (_jsx("div", { className: cn('not-prose border-border bg-sidebar mb-6 rounded-md border px-4 py-3', className), children: _jsx("div", { className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs leading-relaxed", children: entries.map(([key, value]) => (_jsxs(React.Fragment, { children: [_jsx("span", { className: "text-muted-foreground/70 select-none", children: key }), _jsx(FrontmatterValueBody, { value: value })] }, key))) }) }));
157
+ return (_jsx("div", { className: cn('not-prose border-border bg-sidebar mb-6 rounded-md border px-4 py-3', className), children: _jsx("div", { className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs leading-relaxed", children: entries.map(([key, value]) => (_jsxs(React.Fragment, { children: [_jsx("span", { className: "text-muted-foreground select-none", children: key }), _jsx(FrontmatterValueBody, { value: value })] }, key))) }) }));
158
158
  }
@@ -10,7 +10,7 @@
10
10
  * - `agent` — the project's agent or a project member wrote it: messages,
11
11
  * questions, `show` cards, project files, change-request descriptions.
12
12
  * - `untrusted` — a third party wrote it: scraped pages, tool and connector
13
- * output, marketplace listings from a registry.
13
+ * output.
14
14
  */
15
15
  export type MarkdownTrust = 'trusted' | 'agent' | 'untrusted';
16
16
  /**
@@ -36,5 +36,5 @@ export function MarkdownOrderedList({ children, start, reversed }) {
36
36
  const startOrdinal = parseStart(start);
37
37
  const itemCount = React.Children.toArray(children).filter(React.isValidElement).length;
38
38
  const digits = orderedListMarkerDigits({ start: startOrdinal, itemCount, reversed });
39
- return (_jsx("ol", { start: startOrdinal, reversed: reversed, className: "marker:text-muted-foreground/80 my-4 list-outside list-decimal space-y-1 marker:font-medium marker:tabular-nums first:mt-0 last:mb-0 [&_p]:mb-2 [&_p]:last:mb-0", style: { paddingInlineStart: orderedListGutter(digits) }, children: children }));
39
+ return (_jsx("ol", { start: startOrdinal, reversed: reversed, className: "marker:text-muted-foreground my-4 list-outside list-decimal space-y-1 marker:font-medium marker:tabular-nums first:mt-0 last:mb-0 [&_p]:mb-2 [&_p]:last:mb-0", style: { paddingInlineStart: orderedListGutter(digits) }, children: children }));
40
40
  }
@@ -56,6 +56,7 @@ declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<Omit
56
56
  onCheckedChange?: (checked: boolean) => void;
57
57
  reverse?: boolean;
58
58
  size?: import("./menu-recipe.js").MenuRowSize;
59
+ indicator?: "check" | "checkbox";
59
60
  } & React.RefAttributes<HTMLDivElement>>;
60
61
  declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onSelect"> & {
61
62
  asChild?: boolean;
@@ -22,5 +22,5 @@ export function DefinitionList({ dividers, className, children }) {
22
22
  return (_jsx("dl", { className: cn(dividers && 'divide-border border-border/60 divide-y border-y', className), children: children }));
23
23
  }
24
24
  export function DefinitionRow({ label, labelWidth = 110, children, title }) {
25
- return (_jsxs("div", { className: "flex items-baseline gap-6 py-2.5", children: [_jsx("dt", { className: "text-muted-foreground/70 shrink-0 text-xs font-medium", style: { width: labelWidth }, children: label }), _jsx("dd", { className: "text-foreground/90 min-w-0 flex-1 truncate text-sm", title: title, children: children })] }));
25
+ return (_jsxs("div", { className: "flex items-baseline gap-6 py-2.5", children: [_jsx("dt", { className: "text-muted-foreground shrink-0 text-xs font-medium", style: { width: labelWidth }, children: label }), _jsx("dd", { className: "text-foreground/90 min-w-0 flex-1 truncate text-sm", title: title, children: children })] }));
26
26
  }
@@ -52,6 +52,7 @@ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<Omi
52
52
  onCheckedChange?: (checked: boolean) => void;
53
53
  reverse?: boolean;
54
54
  size?: import("./menu-recipe.js").MenuRowSize;
55
+ indicator?: "check" | "checkbox";
55
56
  } & React.RefAttributes<HTMLDivElement>>;
56
57
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onSelect"> & {
57
58
  asChild?: boolean;
@@ -40,7 +40,7 @@ export function EmojiPicker({ onEmojiSelect, className, emojibaseUrl = '/emojiba
40
40
  // together: a build script cannot import a client component's constants.
41
41
  // `locale` is written out rather than left to frimousse's `en` default so
42
42
  // the coupling is visible at the place someone would change it.
43
- emojibaseUrl: emojibaseUrl, locale: "en", columns: EMOJI_COLUMNS, className: cn('isolate flex h-[388px] w-full flex-col', className), children: [_jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx(Frimousse.Search, { "aria-label": "Search emoji", placeholder: "Search emoji\u2026", className: cn('text-foreground placeholder:text-muted-foreground/70 h-full w-full bg-transparent text-sm outline-none', '[&::-webkit-search-cancel-button]:appearance-none') }) }), _jsxs(Frimousse.Viewport, { className: "relative flex-1 overflow-y-auto outline-none", children: [_jsx(Frimousse.Loading, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center", children: _jsx(Loading, {}) }), _jsx(Frimousse.Empty, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center px-6 text-center text-sm text-balance", children: ({ search }) => _jsxs(_Fragment, { children: ["No emoji for \u201C", search, "\u201D"] }) }), _jsx(Frimousse.List, { "aria-label": "Emoji", className: "pb-1.5 select-none", components: {
43
+ emojibaseUrl: emojibaseUrl, locale: "en", columns: EMOJI_COLUMNS, className: cn('isolate flex h-[388px] w-full flex-col', className), children: [_jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx(Frimousse.Search, { "aria-label": "Search emoji", placeholder: "Search emoji\u2026", className: cn('text-foreground placeholder:text-muted-foreground h-full w-full bg-transparent text-sm outline-none', '[&::-webkit-search-cancel-button]:appearance-none') }) }), _jsxs(Frimousse.Viewport, { className: "relative flex-1 overflow-y-auto outline-none", children: [_jsx(Frimousse.Loading, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center", children: _jsx(Loading, {}) }), _jsx(Frimousse.Empty, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center px-6 text-center text-sm text-balance", children: ({ search }) => _jsxs(_Fragment, { children: ["No emoji for \u201C", search, "\u201D"] }) }), _jsx(Frimousse.List, { "aria-label": "Emoji", className: "pb-1.5 select-none", components: {
44
44
  // In each of these, `className` comes AFTER `{...props}` and merges
45
45
  // `props.className`. All three prop types extend ComponentProps, so
46
46
  // className is in the type; frimousse does not pass one today, but
@@ -0,0 +1,57 @@
1
+ import { type ComponentProps } from 'react';
2
+ import { Button } from './button.js';
3
+ import type { InputProps } from './input.js';
4
+ type ButtonSize = NonNullable<ComponentProps<typeof Button>['size']>;
5
+ type ButtonVariant = NonNullable<ComponentProps<typeof Button>['variant']>;
6
+ type InputSize = NonNullable<InputProps['size']>;
7
+ /**
8
+ * Each preset pairs an icon button and an input of the SAME height, so opening
9
+ * the search never moves the row: `sm` 32px-ish (`size-8` / `h-8`), `md`
10
+ * (`size-9` / `h-9`), `lg` (`size-10` / `h-10`).
11
+ */
12
+ declare const SIZES: {
13
+ readonly sm: {
14
+ readonly button: "icon-base";
15
+ readonly input: "xs";
16
+ };
17
+ readonly md: {
18
+ readonly button: "icon-md";
19
+ readonly input: "sm";
20
+ };
21
+ readonly lg: {
22
+ readonly button: "icon-lg";
23
+ readonly input: "md";
24
+ };
25
+ };
26
+ export type ExpandableSearchSize = keyof typeof SIZES;
27
+ /**
28
+ * A search that takes no room until it is needed: a magnifier icon button
29
+ * that opens into a search input in the same place.
30
+ *
31
+ * - Click (or Enter/Space) opens it and focuses the input.
32
+ * - Escape clears the query, closes it, and gives focus back to the button.
33
+ * - Leaving it empty (blur) closes it; with a query it stays open, so the
34
+ * filter it applies is always visible.
35
+ *
36
+ * Controlled: the host owns `value`. `size` picks a matched button/input pair;
37
+ * `buttonSize` and `inputSize` override either half for a host whose row has
38
+ * its own rhythm.
39
+ */
40
+ export declare function ExpandableSearch({ value, onValueChange, label, placeholder, size, buttonSize, buttonVariant, inputSize, defaultOpen, className, inputClassName, }: {
41
+ value: string;
42
+ onValueChange: (value: string) => void;
43
+ /** The button's and the input's accessible name, e.g. "Search sessions". */
44
+ label: string;
45
+ /** Defaults to `label`. */
46
+ placeholder?: string;
47
+ size?: ExpandableSearchSize;
48
+ buttonSize?: ButtonSize;
49
+ /** The closed icon button's look; `ghost` by default. */
50
+ buttonVariant?: ButtonVariant;
51
+ inputSize?: InputSize;
52
+ defaultOpen?: boolean;
53
+ /** The open input's wrapper: set its width here (default `w-56`). */
54
+ className?: string;
55
+ inputClassName?: string;
56
+ }): import("react").JSX.Element;
57
+ export {};
@@ -0,0 +1,58 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { MagnifyingGlassIcon } from '@phosphor-icons/react';
4
+ import { useRef, useState } from 'react';
5
+ import { cn } from '../lib/utils.js';
6
+ import { Button } from './button.js';
7
+ import { InputGroupSearch, InputGroupSearchClear, InputGroupSearchIcon, InputGroupSearchInput } from './input-group.js';
8
+ /**
9
+ * Each preset pairs an icon button and an input of the SAME height, so opening
10
+ * the search never moves the row: `sm` 32px-ish (`size-8` / `h-8`), `md`
11
+ * (`size-9` / `h-9`), `lg` (`size-10` / `h-10`).
12
+ */
13
+ const SIZES = {
14
+ sm: { button: 'icon-base', input: 'xs' },
15
+ md: { button: 'icon-md', input: 'sm' },
16
+ lg: { button: 'icon-lg', input: 'md' },
17
+ };
18
+ /**
19
+ * A search that takes no room until it is needed: a magnifier icon button
20
+ * that opens into a search input in the same place.
21
+ *
22
+ * - Click (or Enter/Space) opens it and focuses the input.
23
+ * - Escape clears the query, closes it, and gives focus back to the button.
24
+ * - Leaving it empty (blur) closes it; with a query it stays open, so the
25
+ * filter it applies is always visible.
26
+ *
27
+ * Controlled: the host owns `value`. `size` picks a matched button/input pair;
28
+ * `buttonSize` and `inputSize` override either half for a host whose row has
29
+ * its own rhythm.
30
+ */
31
+ export function ExpandableSearch({ value, onValueChange, label, placeholder, size = 'sm', buttonSize, buttonVariant = 'ghost', inputSize, defaultOpen = false, className, inputClassName, }) {
32
+ const [open, setOpen] = useState(defaultOpen);
33
+ const buttonRef = useRef(null);
34
+ const preset = SIZES[size];
35
+ const expanded = open || value.length > 0;
36
+ const close = (refocus) => {
37
+ setOpen(false);
38
+ if (refocus)
39
+ requestAnimationFrame(() => buttonRef.current?.focus());
40
+ };
41
+ if (!expanded) {
42
+ return (_jsx(Button, { ref: buttonRef, type: "button", variant: buttonVariant, size: buttonSize ?? preset.button, "aria-label": label, title: label, onClick: () => setOpen(true), className: "text-muted-foreground hover:text-foreground shrink-0", children: _jsx(MagnifyingGlassIcon, { className: "size-4" }) }));
43
+ }
44
+ return (_jsxs(InputGroupSearch, { className: cn('w-56', className), children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { type: "text", autoFocus: true, autoComplete: "off", size: inputSize ?? preset.input, placeholder: placeholder ?? label, "aria-label": label, value: value, onChange: (event) => onValueChange(event.target.value), onBlur: () => {
45
+ if (!value)
46
+ close(false);
47
+ }, onKeyDown: (event) => {
48
+ if (event.key !== 'Escape')
49
+ return;
50
+ event.preventDefault();
51
+ onValueChange('');
52
+ close(true);
53
+ }, className: inputClassName }), _jsx(InputGroupSearchClear
54
+ // Keep focus in the input: a mousedown on the button would blur it first and close an empty search.
55
+ , {
56
+ // Keep focus in the input: a mousedown on the button would blur it first and close an empty search.
57
+ onMouseDown: (event) => event.preventDefault(), onClick: () => onValueChange('') })] }));
58
+ }
@@ -14,5 +14,5 @@ const SIZE_MAP = {
14
14
  export function FaviconAvatar({ value, size = 'xs', className, alt = '' }) {
15
15
  const sizes = SIZE_MAP[size];
16
16
  const src = faviconUrlForValue(value);
17
- return (_jsxs(Avatar, { "data-slot": "favicon-avatar", className: cn('bg-muted/60 rounded', sizes.avatar, className), children: [src ? (_jsx(AvatarImage, { src: src, alt: alt, className: "outline outline-black/10 dark:outline-white/10" })) : null, _jsx(AvatarFallback, { delayMs: 0, className: "bg-muted/60", children: _jsx(Globe, { className: cn('text-muted-foreground/50', sizes.icon) }) })] }));
17
+ return (_jsxs(Avatar, { "data-slot": "favicon-avatar", className: cn('bg-muted/60 rounded', sizes.avatar, className), children: [src ? (_jsx(AvatarImage, { src: src, alt: alt, className: "outline outline-black/10 dark:outline-white/10" })) : null, _jsx(AvatarFallback, { delayMs: 0, className: "bg-muted/60", children: _jsx(Globe, { className: cn('text-muted-foreground', sizes.icon) }) })] }));
18
18
  }
@@ -27,6 +27,6 @@ export interface FileTreeNavProps {
27
27
  /**
28
28
  * The file rows inside a `FileTree`: one indented button per file, the
29
29
  * selected one on a quiet fill. Shared by the capability entity modal and the
30
- * marketplace item rail so both trees are the same component.
30
+ * eval task view so both trees are the same component.
31
31
  */
32
32
  export declare function FileTreeNav({ nodes, selectedPath, onSelect, label }: FileTreeNavProps): import("react").JSX.Element | null;
@@ -16,7 +16,7 @@ export function FileTree({ title, children, className }) {
16
16
  /**
17
17
  * The file rows inside a `FileTree`: one indented button per file, the
18
18
  * selected one on a quiet fill. Shared by the capability entity modal and the
19
- * marketplace item rail so both trees are the same component.
19
+ * eval task view so both trees are the same component.
20
20
  */
21
21
  export function FileTreeNav({ nodes, selectedPath, onSelect, label }) {
22
22
  if (nodes.length === 0)
@@ -71,7 +71,7 @@ export function GlyphPicker({ color, selected, onColorChange, onGlyphSelect, cla
71
71
  return (_jsxs("div", { style: glyphStyle(resolved), className: cn('isolate flex h-[388px] w-full flex-col', className), children: [customOpen ? (_jsx(CustomColor, { color: isCustom ? resolved : presetHex(resolved), onChange: onColorChange, onClose: () => setCustomOpen(false) })) : (_jsxs("div", { className: "border-border flex h-12 shrink-0 items-center justify-between border-b px-4", children: [PROJECT_GLYPH_COLORS.map((preset) => {
72
72
  const selected = preset === resolved;
73
73
  return (_jsx("button", { type: "button", "data-swatch": preset, "aria-pressed": selected, "aria-label": `Colour: ${preset}`, onClick: () => onColorChange(preset), style: selected ? { '--glyph': `var(--glyph-solid-${preset})` } : undefined, className: cn(DOT, SWATCH[preset], selected && DOT_SELECTED), children: selected ? _jsx(CheckIcon, { weight: "bold", className: "size-3 text-white" }) : null }, preset));
74
- }), _jsx("span", { "aria-hidden": true, className: "bg-border h-5 w-px" }), _jsx("button", { type: "button", "data-swatch": "custom", "aria-pressed": isCustom, "aria-label": "Custom colour", onClick: () => setCustomOpen(true), className: cn(DOT, RAINBOW, isCustom && 'ring-foreground ring-offset-popover ring-[1.5px] ring-offset-2') })] })), _jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx("input", { type: "search", "aria-label": "Search icons", placeholder: "Search icons\u2026", value: search, onChange: (event) => setSearch(event.target.value), className: "text-foreground placeholder:text-muted-foreground/70 h-full w-full bg-transparent text-sm outline-none [&::-webkit-search-cancel-button]:appearance-none" }) }), _jsx("div", { className: "relative flex-1 overflow-y-auto px-3 pb-3 select-none", children: groups.length > 0 ? (groups.map((group) => (_jsxs("section", { "aria-label": group.label, children: [_jsx("h3", { className: "text-muted-foreground px-1 pt-3 pb-1.5 text-xs font-medium", children: group.label }), _jsx("div", { className: "grid grid-cols-10", children: group.names.map((name) => {
74
+ }), _jsx("span", { "aria-hidden": true, className: "bg-border h-5 w-px" }), _jsx("button", { type: "button", "data-swatch": "custom", "aria-pressed": isCustom, "aria-label": "Custom colour", onClick: () => setCustomOpen(true), className: cn(DOT, RAINBOW, isCustom && 'ring-foreground ring-offset-popover ring-[1.5px] ring-offset-2') })] })), _jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx("input", { type: "search", "aria-label": "Search icons", placeholder: "Search icons\u2026", value: search, onChange: (event) => setSearch(event.target.value), className: "text-foreground placeholder:text-muted-foreground h-full w-full bg-transparent text-sm outline-none [&::-webkit-search-cancel-button]:appearance-none" }) }), _jsx("div", { className: "relative flex-1 overflow-y-auto px-3 pb-3 select-none", children: groups.length > 0 ? (groups.map((group) => (_jsxs("section", { "aria-label": group.label, children: [_jsx("h3", { className: "text-muted-foreground px-1 pt-3 pb-1.5 text-xs font-medium", children: group.label }), _jsx("div", { className: "grid grid-cols-10", children: group.names.map((name) => {
75
75
  const Glyph = glyphComponent(name);
76
76
  if (!Glyph)
77
77
  return null;
@@ -153,7 +153,7 @@ function CustomColor({ color, onChange, onClose, }) {
153
153
  };
154
154
  const square = useDrag((x, y) => commit({ h: hsv.h, s: x, v: 1 - y }));
155
155
  const rail = useDrag((_, y) => commit({ ...hsv, h: y * 360 }));
156
- return (_jsxs("div", { className: "border-border shrink-0 border-b px-4 pt-3 pb-4", children: [_jsxs("div", { className: "mb-3 flex items-center gap-3", children: [_jsx("span", { "aria-hidden": true, className: "size-6 shrink-0 rounded-full", style: { background: hex } }), _jsxs("label", { className: "flex min-w-0 flex-1 items-center gap-2.5 text-sm", children: [_jsx("span", { className: "text-muted-foreground/80", children: "HEX" }), _jsx("span", { className: "text-foreground", children: "#" }), _jsx("input", { "aria-label": "Hex colour", value: draft, maxLength: 6, spellCheck: false, onChange: (event) => {
156
+ return (_jsxs("div", { className: "border-border shrink-0 border-b px-4 pt-3 pb-4", children: [_jsxs("div", { className: "mb-3 flex items-center gap-3", children: [_jsx("span", { "aria-hidden": true, className: "size-6 shrink-0 rounded-full", style: { background: hex } }), _jsxs("label", { className: "flex min-w-0 flex-1 items-center gap-2.5 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "HEX" }), _jsx("span", { className: "text-foreground", children: "#" }), _jsx("input", { "aria-label": "Hex colour", value: draft, maxLength: 6, spellCheck: false, onChange: (event) => {
157
157
  const next = event.target.value.replace(/[^0-9a-f]/gi, '').toUpperCase();
158
158
  setDraft(next);
159
159
  const value = normalizeProjectGlyphColor(`#${next}`);
@@ -65,7 +65,7 @@ function InputGroupSearchIcon({ className, ...props }) {
65
65
  return (_jsx("div", { "data-slot": "input-group-search-icon", "aria-hidden": "true", className: cn('text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 [&_svg:not([class*="size-"])]:size-4', className), ...props }));
66
66
  }
67
67
  function InputGroupSearchInput({ className, variant = 'transparent', size = 'md', ...props }) {
68
- return (_jsx(Input, { "data-slot": "input-group-search-control", variant: variant, size: size, className: cn('peer placeholder:text-muted-foreground/60 pl-9', className), ...props }));
68
+ return (_jsx(Input, { "data-slot": "input-group-search-control", variant: variant, size: size, className: cn('peer placeholder:text-muted-foreground pl-9', className), ...props }));
69
69
  }
70
70
  function InputGroupSearchClear({ className, variant = 'ghost', size = 'icon', ...props }) {
71
71
  return (_jsx(Button, { type: "button", variant: variant, size: size, "aria-label": "Clear", "data-slot": "input-group-search-clear", className: cn('absolute top-1/2 right-2 size-6 -translate-y-1/2 rounded-sm opacity-0 peer-focus:opacity-100', className), ...props, children: _jsx(Close, { className: "text-muted-foreground size-4" }) }));
@@ -82,6 +82,11 @@ export type MenuCheckboxItemProps = Omit<RowBaseProps, 'onChange'> & {
82
82
  onCheckedChange?: (checked: boolean) => void;
83
83
  reverse?: boolean;
84
84
  size?: MenuRowSize;
85
+ /**
86
+ * `check` (default): a check on picked rows only. `checkbox`: a box on every
87
+ * row, ticked when picked, for a list where several can be on at once.
88
+ */
89
+ indicator?: 'check' | 'checkbox';
85
90
  };
86
91
  export declare function makeMenuCheckboxItem(slotName?: string): React.ForwardRefExoticComponent<Omit<RowBaseProps, "onChange"> & {
87
92
  checked?: boolean | "indeterminate";
@@ -89,6 +94,11 @@ export declare function makeMenuCheckboxItem(slotName?: string): React.ForwardRe
89
94
  onCheckedChange?: (checked: boolean) => void;
90
95
  reverse?: boolean;
91
96
  size?: MenuRowSize;
97
+ /**
98
+ * `check` (default): a check on picked rows only. `checkbox`: a box on every
99
+ * row, ticked when picked, for a list where several can be on at once.
100
+ */
101
+ indicator?: "check" | "checkbox";
92
102
  } & React.RefAttributes<HTMLDivElement>>;
93
103
  export type MenuRadioItemProps = RowBaseProps & {
94
104
  value: string;
@@ -12,6 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
12
12
  * accepts `onCloseAutoFocus` and the dismiss handlers.
13
13
  */
14
14
  import { Menu as MenuPrimitive } from '@base-ui/react/menu';
15
+ import { Checkbox } from './checkbox.js';
15
16
  import { CheckIcon as Check, CaretRightIcon as ChevronRight } from '@phosphor-icons/react';
16
17
  import * as React from 'react';
17
18
  import { asChildRender, checkedState, composeRefs, DismissProvider, FLOATING_LAYER_ATTR, focusProps, openState, radixPositionVars, splitPosition, stateRender, useDismissContent, useDismissRoot, useNativeButton, } from '../lib/base-ui-compat.js';
@@ -92,7 +93,7 @@ export function makeMenuItem(slotName) {
92
93
  return Item;
93
94
  }
94
95
  export function makeMenuCheckboxItem(slotName) {
95
- const CheckboxItem = React.forwardRef(({ className, children, checked, defaultChecked, onCheckedChange, reverse, size = 'sm', disabled, textValue, onSelect, onClick, asChild: _asChild, ...props }, ref) => {
96
+ const CheckboxItem = React.forwardRef(({ className, children, checked, defaultChecked, onCheckedChange, reverse, size = 'sm', indicator = 'check', disabled, textValue, onSelect, onClick, asChild: _asChild, ...props }, ref) => {
96
97
  const handleClick = useSelectHandler(onSelect, onClick, disabled);
97
98
  return (_jsxs(MenuPrimitive.CheckboxItem, { ref: ref, "data-slot": slotName,
98
99
  // The check sits in the row's leading slot (absolute, so an unchecked row
@@ -100,7 +101,11 @@ export function makeMenuCheckboxItem(slotName) {
100
101
  // `MENU_INSET` — the same x as an `inset` item or an icon row's label.
101
102
  className: cn(menuRow(size, 'default'), reverse ? MENU_INSET_END : MENU_INSET, className), checked: checked === undefined ? undefined : checked === true, defaultChecked: defaultChecked, onCheckedChange: onCheckedChange ? (next) => onCheckedChange(next) : undefined, disabled: disabled, label: textValue,
102
103
  // Radix closes the menu when a checkbox row is picked; Base UI keeps it open.
103
- closeOnClick: true, ...props, onClick: handleClick, render: stateRender('div', (s) => checked === 'indeterminate' ? 'indeterminate' : checkedState(s)), children: [_jsx("span", { className: cn(MENU_INDICATOR, 'absolute', reverse ? 'right-2' : 'left-2'), children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(Check, { className: MENU_INDICATOR_ICON }) }) }), children] }));
104
+ closeOnClick: true, ...props, onClick: handleClick, render: stateRender('div', (s) => checked === 'indeterminate' ? 'indeterminate' : checkedState(s)), children: [_jsx("span", { className: cn(MENU_INDICATOR, 'absolute', reverse ? 'right-2' : 'left-2'), children: indicator === 'checkbox' ? (
105
+ // Drawn, not a second control: the row is the checkbox (role, keyboard, click).
106
+ _jsx(Checkbox, { checked: checked ?? false, tabIndex: -1, "aria-hidden": true,
107
+ // Fills the 15px indicator slot: the form checkbox is 18px.
108
+ className: "pointer-events-none size-4 rounded-[calc(var(--radius)-6px)] [&_svg]:size-3" })) : (_jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(Check, { className: MENU_INDICATOR_ICON }) })) }), children] }));
104
109
  });
105
110
  CheckboxItem.displayName = 'MenuCheckboxItem';
106
111
  return CheckboxItem;
@@ -50,7 +50,7 @@ const CountrySelectOption = ({ country, countryName, selectedCountry, onChange,
50
50
  onChange(country);
51
51
  onSelectComplete();
52
52
  };
53
- return (_jsxs(CommandItem, { className: "gap-2", onSelect: handleSelect, value: `${countryName} +${RPNInput.getCountryCallingCode(country)} ${country}`, children: [_jsx(FlagComponent, { country: country, countryName: countryName }), _jsx("span", { className: "flex-1 text-sm", children: countryName }), _jsx("span", { className: "text-foreground/50 text-sm", children: `+${RPNInput.getCountryCallingCode(country)}` }), _jsx(CheckIcon, { className: cn('ml-auto size-4', country === selectedCountry ? 'opacity-100' : 'opacity-0') })] }));
53
+ return (_jsxs(CommandItem, { className: "gap-2", onSelect: handleSelect, value: `${countryName} +${RPNInput.getCountryCallingCode(country)} ${country}`, children: [_jsx(FlagComponent, { country: country, countryName: countryName }), _jsx("span", { className: "flex-1 text-sm", children: countryName }), _jsx("span", { className: "text-muted-foreground text-sm", children: `+${RPNInput.getCountryCallingCode(country)}` }), _jsx(CheckIcon, { className: cn('ml-auto size-4', country === selectedCountry ? 'opacity-100' : 'opacity-0') })] }));
54
54
  };
55
55
  const FlagComponent = ({ country, countryName, }) => {
56
56
  const Flag = flags[country];
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from 'react';
2
+ /** A person as every Kortix list knows them: an id, and whatever profile the API has. */
3
+ export interface ProfilePerson {
4
+ userId: string;
5
+ /** Display name from their profile; null or absent when they set none. */
6
+ name?: string | null;
7
+ email?: string | null;
8
+ avatarUrl?: string | null;
9
+ }
10
+ /** The best label for a person: their name, else their email, else `fallback`. */
11
+ export declare function profileLabel(person: ProfilePerson, fallback?: string): string;
12
+ /**
13
+ * Hover a person, see who they are: their picture, name and email, plus an
14
+ * optional `detail` line the host owns (a role, "Created this space").
15
+ *
16
+ * The trigger is the host's own markup (`children`), so a row, an avatar or a
17
+ * name can open it. Keyboard focus opens it too. The card is not animated:
18
+ * it opens into the path the pointer already travels (hover-card.tsx).
19
+ */
20
+ export declare function ProfileHoverCard({ person, detail, children, side, align, className, }: {
21
+ person: ProfilePerson;
22
+ /** One short line under the profile, such as "Created this space". */
23
+ detail?: ReactNode;
24
+ children: ReactNode;
25
+ side?: 'top' | 'right' | 'bottom' | 'left';
26
+ align?: 'start' | 'center' | 'end';
27
+ className?: string;
28
+ }): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from '../lib/utils.js';
4
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from './hover-card.js';
5
+ import { UserAvatar } from './user-avatar.js';
6
+ /** The best label for a person: their name, else their email, else `fallback`. */
7
+ export function profileLabel(person, fallback = 'Unknown') {
8
+ return person.name?.trim() || person.email?.trim() || fallback;
9
+ }
10
+ /**
11
+ * Hover a person, see who they are: their picture, name and email, plus an
12
+ * optional `detail` line the host owns (a role, "Created this space").
13
+ *
14
+ * The trigger is the host's own markup (`children`), so a row, an avatar or a
15
+ * name can open it. Keyboard focus opens it too. The card is not animated:
16
+ * it opens into the path the pointer already travels (hover-card.tsx).
17
+ */
18
+ export function ProfileHoverCard({ person, detail, children, side = 'left', align = 'start', className, }) {
19
+ const label = profileLabel(person);
20
+ const email = person.email?.trim() || null;
21
+ return (_jsxs(HoverCard, { openDelay: 300, closeDelay: 100, children: [_jsx(HoverCardTrigger, { asChild: true, children: children }), _jsxs(HoverCardContent, { side: side, align: align, sideOffset: 8, animated: false, className: cn('w-64 p-3', className), children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [_jsx(UserAvatar, { email: email ?? '', name: person.name ?? email ?? label, avatarUrl: person.avatarUrl, colorKey: person.userId, size: "lg", className: "size-9" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground truncate text-sm leading-tight font-medium", children: label }), email && email !== label ? _jsx("p", { className: "text-muted-foreground truncate text-xs leading-tight", children: email }) : null] })] }), detail ? _jsx("div", { className: "text-muted-foreground border-border mt-3 border-t pt-3 text-xs", children: detail }) : null] })] }));
22
+ }
@@ -14,12 +14,12 @@ export declare function SettingsSectionHeader({ title, description, action, clas
14
14
  export declare const SettingsPageTitleProvider: import("react").Provider<string | null>;
15
15
  export declare function useSettingsPageTitle(): string | null;
16
16
  /**
17
- * Every Workspace settings page's column: one gutter and one top offset, left
18
- * aligned, so the title sits at the same x and y on every section. A page sets
19
- * only its own max width inside it (`max-w-2xl` a form, `max-w-5xl` a library,
20
- * none a table).
17
+ * Every Workspace settings page's column: one gutter and one top offset. A
18
+ * page sets only its own max width on the column's child (`max-w-2xl` a form,
19
+ * `max-w-5xl` a library, none a table); `[&>*]:mx-auto` centers that child in
20
+ * the pane. The text stays left aligned.
21
21
  */
22
- export declare const SETTINGS_PAGE_COLUMN_CLASS = "w-full px-4 pt-12 pb-20 sm:px-12";
22
+ export declare const SETTINGS_PAGE_COLUMN_CLASS = "w-full px-4 pt-12 pb-20 sm:px-12 [&>*]:mx-auto";
23
23
  /**
24
24
  * The one page-title rung of Workspace settings: the brand's section page
25
25
  * title (`typography.md`, Roles). `text-2xl` is the detail-view rung.
@@ -25,12 +25,12 @@ export function useSettingsPageTitle() {
25
25
  return useContext(SettingsPageTitleContext);
26
26
  }
27
27
  /**
28
- * Every Workspace settings page's column: one gutter and one top offset, left
29
- * aligned, so the title sits at the same x and y on every section. A page sets
30
- * only its own max width inside it (`max-w-2xl` a form, `max-w-5xl` a library,
31
- * none a table).
28
+ * Every Workspace settings page's column: one gutter and one top offset. A
29
+ * page sets only its own max width on the column's child (`max-w-2xl` a form,
30
+ * `max-w-5xl` a library, none a table); `[&>*]:mx-auto` centers that child in
31
+ * the pane. The text stays left aligned.
32
32
  */
33
- export const SETTINGS_PAGE_COLUMN_CLASS = 'w-full px-4 pt-12 pb-20 sm:px-12';
33
+ export const SETTINGS_PAGE_COLUMN_CLASS = 'w-full px-4 pt-12 pb-20 sm:px-12 [&>*]:mx-auto';
34
34
  /**
35
35
  * The one page-title rung of Workspace settings: the brand's section page
36
36
  * title (`typography.md`, Roles). `text-2xl` is the detail-view rung.
@@ -0,0 +1,23 @@
1
+ export interface SortOption<T extends string> {
2
+ value: T;
3
+ label: string;
4
+ }
5
+ /**
6
+ * A list page's sort: one outline icon button (the size of `ExpandableSearch`'s
7
+ * closed button) that opens the orders as radio rows. The tooltip and the
8
+ * accessible name say the order in use, e.g. "Sort: Last activity".
9
+ */
10
+ export declare function SortMenu<T extends string>({ value, onValueChange, options, label, }: {
11
+ value: T;
12
+ onValueChange: (value: T) => void;
13
+ options: SortOption<T>[];
14
+ /** The button's name for the current order, e.g. "Sort: Name". */
15
+ label: string;
16
+ }): import("react").JSX.Element;
17
+ /**
18
+ * The order a viewer picked last on one page, kept in this browser only
19
+ * (`storageKey`). The server and the first render use `fallback`, so the HTML
20
+ * matches; blocked storage, or an order the page no longer offers, also gives
21
+ * `fallback`.
22
+ */
23
+ export declare function useStoredSort<T extends string>(storageKey: string, orders: readonly T[], fallback: T): [T, (next: T) => void];