@kortix/ui 0.15.6 → 0.15.8

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 (226) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +36 -1
  3. package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
  4. package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
  5. package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
  6. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  7. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  8. package/dist/customize/providers/provider-accordion.js +3 -2
  9. package/dist/customize/providers/provider-connect.d.ts +7 -0
  10. package/dist/customize/providers/provider-connect.js +21 -2
  11. package/dist/customize/providers/provider-sheet.js +3 -2
  12. package/dist/customize/sections/gateway-view.d.ts +2 -2
  13. package/dist/customize/sections/gateway-view.js +30 -15
  14. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +3 -1
  15. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
  16. package/dist/customize/sections/view/account-secret-resources-panel.js +8 -5
  17. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  18. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/sections/view/permission-editor.js +1 -1
  21. package/dist/customize/sections/view/review-center-connected.js +15 -3
  22. package/dist/customize/sections/view/subscription-usage.d.ts +269 -17
  23. package/dist/customize/sections/view/subscription-usage.js +197 -54
  24. package/dist/customize/shared/entity/entity-modal.js +8 -10
  25. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  26. package/dist/files/project/components/drive-toolbar.js +1 -1
  27. package/dist/files/project/store/version-store.d.ts +1 -1
  28. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  29. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  30. package/dist/files/renderers/shared/select-compat.js +3 -7
  31. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  32. package/dist/files/viewer/file-preview-modal.js +17 -18
  33. package/dist/i18n/en.d.ts +40 -47
  34. package/dist/i18n/en.js +47 -54
  35. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +5 -0
  36. package/dist/index.js +1 -1
  37. package/dist/internal/account-hub/account-hub-location.js +2 -2
  38. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  39. package/dist/internal/account-hub/use-account-members.js +27 -10
  40. package/dist/internal/auth/auth-primitives.d.ts +27 -0
  41. package/dist/internal/auth/auth-primitives.js +21 -0
  42. package/dist/internal/billing/index.d.ts +1 -0
  43. package/dist/internal/billing/index.js +2 -0
  44. package/dist/internal/billing/use-free-grant-unspent.d.ts +10 -0
  45. package/dist/internal/billing/use-free-grant-unspent.js +20 -0
  46. package/dist/internal/components/agent-mark.d.ts +1 -8
  47. package/dist/internal/components/agent-mark.js +2 -19
  48. package/dist/internal/lib/billing/billing-gate-state.d.ts +20 -0
  49. package/dist/internal/lib/billing/billing-gate-state.js +22 -0
  50. package/dist/internal/lib/error-handler.js +0 -2
  51. package/dist/internal/lib/navigation/modified-click.js +2 -2
  52. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  53. package/dist/internal/lib/pixel-mark.js +3 -34
  54. package/dist/internal/notifications/notification-inbox.js +1 -1
  55. package/dist/internal/stores/active-space-store.d.ts +1 -1
  56. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  57. package/dist/internal/stores/current-account-store.d.ts +1 -1
  58. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  59. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  60. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  61. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  62. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  63. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  64. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  65. package/dist/internal/stores/session-hover-store.js +1 -1
  66. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  67. package/dist/internal/stores/sound-store.d.ts +1 -1
  68. package/dist/internal/stores/tab-store.d.ts +1 -1
  69. package/dist/internal/stores/upgrade-dialog-store.d.ts +0 -2
  70. package/dist/internal/stores/upgrade-dialog-store.js +0 -2
  71. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  72. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  73. package/dist/lib/base-ui-compat.d.ts +149 -0
  74. package/dist/lib/base-ui-compat.js +339 -0
  75. package/dist/lib/portal-container.d.ts +3 -7
  76. package/dist/lib/portal-container.js +5 -3
  77. package/dist/lib/z-stack.d.ts +4 -4
  78. package/dist/lib/z-stack.js +5 -5
  79. package/dist/markdown/setup-links/approval-decision.d.ts +1 -1
  80. package/dist/markdown/setup-links/approval-decision.js +1 -1
  81. package/dist/primitives/accordion.d.ts +36 -5
  82. package/dist/primitives/accordion.js +41 -8
  83. package/dist/primitives/alert-dialog.d.ts +33 -11
  84. package/dist/primitives/alert-dialog.js +41 -19
  85. package/dist/primitives/avatar.d.ts +5 -2
  86. package/dist/primitives/avatar.js +3 -3
  87. package/dist/primitives/badge.js +1 -1
  88. package/dist/primitives/breadcrumb.js +1 -1
  89. package/dist/primitives/button-group.js +3 -3
  90. package/dist/primitives/button.js +1 -1
  91. package/dist/primitives/checkbox.d.ts +14 -5
  92. package/dist/primitives/checkbox.js +24 -9
  93. package/dist/primitives/collapsible.d.ts +16 -4
  94. package/dist/primitives/collapsible.js +18 -7
  95. package/dist/primitives/command-core.d.ts +121 -0
  96. package/dist/primitives/command-core.js +642 -0
  97. package/dist/primitives/command.d.ts +38 -4
  98. package/dist/primitives/command.js +22 -13
  99. package/dist/primitives/context-menu.d.ts +61 -31
  100. package/dist/primitives/context-menu.js +40 -53
  101. package/dist/primitives/dialog.d.ts +48 -10
  102. package/dist/primitives/dialog.js +48 -19
  103. package/dist/primitives/disclosure.d.ts +1 -1
  104. package/dist/primitives/disclosure.js +2 -2
  105. package/dist/primitives/drawer.d.ts +28 -9
  106. package/dist/primitives/drawer.js +42 -18
  107. package/dist/primitives/dropdown-menu.d.ts +55 -33
  108. package/dist/primitives/dropdown-menu.js +46 -82
  109. package/dist/primitives/faded-scroll-area.js +2 -1
  110. package/dist/primitives/hint.js +3 -3
  111. package/dist/primitives/hover-card.d.ts +17 -5
  112. package/dist/primitives/hover-card.js +45 -8
  113. package/dist/primitives/item.js +2 -2
  114. package/dist/primitives/label.d.ts +5 -2
  115. package/dist/primitives/label.js +10 -3
  116. package/dist/primitives/menu-base.d.ts +150 -0
  117. package/dist/primitives/menu-base.js +171 -0
  118. package/dist/primitives/menu-recipe.d.ts +1 -1
  119. package/dist/primitives/menu-recipe.js +2 -7
  120. package/dist/primitives/modal.d.ts +19 -52
  121. package/dist/primitives/modal.js +24 -28
  122. package/dist/primitives/navigation-menu.d.ts +36 -11
  123. package/dist/primitives/navigation-menu.js +31 -12
  124. package/dist/primitives/popover.d.ts +31 -6
  125. package/dist/primitives/popover.js +79 -12
  126. package/dist/primitives/preview-image.d.ts +18 -7
  127. package/dist/primitives/preview-image.js +14 -11
  128. package/dist/primitives/progress.d.ts +4 -2
  129. package/dist/primitives/progress.js +4 -3
  130. package/dist/primitives/project-icon-picker.js +2 -2
  131. package/dist/primitives/radio-group.d.ts +28 -5
  132. package/dist/primitives/radio-group.js +18 -10
  133. package/dist/primitives/scroll-area.d.ts +2 -2
  134. package/dist/primitives/scroll-area.js +8 -3
  135. package/dist/primitives/select.d.ts +55 -12
  136. package/dist/primitives/select.js +93 -36
  137. package/dist/primitives/separator.d.ts +6 -2
  138. package/dist/primitives/separator.js +10 -2
  139. package/dist/primitives/sheet.d.ts +17 -10
  140. package/dist/primitives/sheet.js +19 -22
  141. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  142. package/dist/primitives/slider-native.d.ts +2 -2
  143. package/dist/primitives/slider-native.js +11 -9
  144. package/dist/primitives/slider.d.ts +24 -6
  145. package/dist/primitives/slider.js +26 -24
  146. package/dist/primitives/slot.d.ts +6 -0
  147. package/dist/primitives/slot.js +7 -0
  148. package/dist/primitives/split-sheet.js +1 -1
  149. package/dist/primitives/stepper.js +1 -1
  150. package/dist/primitives/switch.d.ts +16 -3
  151. package/dist/primitives/switch.js +7 -6
  152. package/dist/primitives/tabs.d.ts +36 -20
  153. package/dist/primitives/tabs.js +131 -102
  154. package/dist/primitives/toggle.d.ts +16 -3
  155. package/dist/primitives/toggle.js +8 -3
  156. package/dist/primitives/tooltip.d.ts +24 -5
  157. package/dist/primitives/tooltip.js +32 -10
  158. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  159. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  160. package/dist/session/composer/animated-placeholder.js +1 -1
  161. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  162. package/dist/session/composer/editor/composer-editor.js +1 -1
  163. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  164. package/dist/session/composer/menus/menu-shell.js +1 -1
  165. package/dist/session/composer/menus/mount.js +1 -1
  166. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  167. package/dist/session/header/session-site-header.js +2 -2
  168. package/dist/session/header/subagent-hover-card.js +2 -2
  169. package/dist/session/media/image-preview.js +1 -1
  170. package/dist/session/models/model-selector.d.ts +1 -1
  171. package/dist/session/models/model-selector.js +18 -12
  172. package/dist/session/models/subscription-switcher.d.ts +37 -0
  173. package/dist/session/models/subscription-switcher.js +97 -0
  174. package/dist/session/models/subscription-windows.d.ts +40 -0
  175. package/dist/session/models/subscription-windows.js +86 -0
  176. package/dist/session/overrides/session-overrides-control.js +3 -3
  177. package/dist/session/panel/diff-dialog.js +1 -1
  178. package/dist/session/panel/easy/detail-view.js +3 -3
  179. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  180. package/dist/session/panel/panel-fallback.js +1 -1
  181. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  182. package/dist/session/panel/session-files-explorer.js +1 -1
  183. package/dist/session/prompts/ask-deck.d.ts +14 -2
  184. package/dist/session/prompts/ask-deck.js +6 -2
  185. package/dist/session/thread/session-chat.js +2 -2
  186. package/dist/session/thread/session-context-message-explorer.js +1 -1
  187. package/dist/session/thread/turn-share.js +3 -4
  188. package/dist/session/tool/shared/show-helpers.js +1 -1
  189. package/dist/session/turn/message-time-label.js +1 -1
  190. package/dist/styles.css +1 -1
  191. package/dist/test-utils/intl.d.ts +40 -47
  192. package/dist/workspace/admin/settings-search.js +4 -12
  193. package/dist/workspace/inbox/workspace-inbox.js +11 -2
  194. package/dist/workspace/layout/new-session-create.d.ts +4 -2
  195. package/dist/workspace/layout/new-session-create.js +11 -0
  196. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  197. package/dist/workspace/review/approval-modal.d.ts +6 -6
  198. package/dist/workspace/review/approval-modal.js +10 -14
  199. package/dist/workspace/review/review-center.d.ts +9 -2
  200. package/dist/workspace/review/review-center.js +258 -126
  201. package/dist/workspace/review/review-detail.d.ts +20 -10
  202. package/dist/workspace/review/review-detail.js +39 -44
  203. package/dist/workspace/review/review-meta.d.ts +27 -6
  204. package/dist/workspace/review/review-meta.js +46 -34
  205. package/dist/workspace/sessions/session-row.js +1 -1
  206. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +10 -0
  207. package/dist/workspace/sidebar/footer/project-download-app-nav.js +53 -0
  208. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +2 -1
  209. package/dist/workspace/sidebar/footer/promo-nav-row.js +1 -1
  210. package/dist/workspace/sidebar/project-session-list.js +2 -2
  211. package/dist/workspace/sidebar/project-sidebar.d.ts +6 -1
  212. package/dist/workspace/sidebar/project-sidebar.js +3 -2
  213. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  214. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  215. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  216. package/dist/workspace/sidebar/session-title.js +2 -2
  217. package/dist/workspace/sidebar/workspace-menu-model.d.ts +19 -13
  218. package/dist/workspace/sidebar/workspace-menu-model.js +7 -8
  219. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  220. package/dist/workspace/spaces/space-links.js +1 -1
  221. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  222. package/package.json +16 -35
  223. package/skills/kortix-ui/SKILL.md +1 -1
  224. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
  225. package/dist/customize/sections/view/subscription-usage-tab.d.ts +0 -25
  226. package/dist/customize/sections/view/subscription-usage-tab.js +0 -121
@@ -2,20 +2,26 @@
2
2
  * The rows of the workspace menu (the sidebar's workspace name, Slack's
3
3
  * "Acme ▾"), in order, by group:
4
4
  *
5
- * 1. the workspace header (icon and name);
6
- * 2. the workspace: Invite people · Workspace settings · Switch workspace
7
- * (the list, with the pending-invitation count; Create workspace sits at
8
- * the bottom of that list, beside the workspaces it adds to);
9
- * 3. the person: Inbox (notifications from every workspace, KRTX-1742) ·
10
- * Preferences (Mod+,) · More (Apps and extensions, Appearance, Help,
11
- * Download app: rows a person opens rarely, one level down);
12
- * 4. Leave {name} · Log out.
5
+ * 1. the workspace: Switch workspace (the list, with the pending-invitation
6
+ * count; Create workspace sits at the bottom of that list) · Workspace
7
+ * settings · Invite people · Leave (only for a person who cannot open
8
+ * Workspace settings);
9
+ * 2. the person: Inbox (notifications from every workspace, KRTX-1742) ·
10
+ * Preferences (Mod+,) · Apps and extensions (Chrome, the desktop app,
11
+ * your computer, MCP);
12
+ * 3. Help (docs, support, legal) · Log out.
13
13
  *
14
- * Seven rows at most at the top level: the rows used daily stay in reach,
15
- * and the rest wait one hover away. Each gated row follows the gate its
16
- * target applies, so a row never opens a page that refuses the caller.
14
+ * Flat: one hover deep at most (Switch workspace, Help), never two. No
15
+ * header: the trigger directly above already shows the workspace. Rows that
16
+ * have a better home are not here — Appearance is in Preferences, and
17
+ * Download app is a dismissible row at the foot of the sidebar (and inside
18
+ * Apps and extensions). Leave lives in Workspace settings › Danger zone, which
19
+ * needs `project.settings.write`; a person without that gets Leave here, or
20
+ * they could not leave at all. Each gated row
21
+ * follows the gate its target applies, so a row never opens a page that
22
+ * refuses the caller.
17
23
  */
18
- export type WorkspaceMenuRow = 'header' | 'invite' | 'settings' | 'switch' | 'inbox' | 'preferences' | 'more' | 'leave' | 'logout';
24
+ export type WorkspaceMenuRow = 'switch' | 'settings' | 'invite' | 'leave' | 'inbox' | 'preferences' | 'apps' | 'help' | 'logout';
19
25
  export interface WorkspaceMenuGates {
20
26
  /** `project.members.manage`: the Members section's invite. */
21
27
  canInvite: boolean;
@@ -26,5 +32,5 @@ export interface WorkspaceMenuGates {
26
32
  /** The host serves an Inbox page (`useInboxSummary(...).href` is set). */
27
33
  hasInbox: boolean;
28
34
  }
29
- /** The menu's groups, top to bottom; a separator sits between two non-empty groups. */
35
+ /** The menu's groups, top to bottom; a separator sits between two groups. */
30
36
  export declare function workspaceMenuGroups(gates: WorkspaceMenuGates): WorkspaceMenuRow[][];
@@ -1,14 +1,13 @@
1
- /** The menu's groups, top to bottom; a separator sits between two non-empty groups. */
1
+ /** The menu's groups, top to bottom; a separator sits between two groups. */
2
2
  export function workspaceMenuGroups(gates) {
3
- const groups = [
4
- ['header'],
3
+ return [
5
4
  [
6
- ...(gates.canInvite ? ['invite'] : []),
7
- ...(gates.canOpenSettings ? ['settings'] : []),
8
5
  'switch',
6
+ ...(gates.canOpenSettings ? ['settings'] : []),
7
+ ...(gates.canInvite ? ['invite'] : []),
8
+ ...(gates.canLeave && !gates.canOpenSettings ? ['leave'] : []),
9
9
  ],
10
- [...(gates.hasInbox ? ['inbox'] : []), 'preferences', 'more'],
11
- [...(gates.canLeave ? ['leave'] : []), 'logout'],
10
+ [...(gates.hasInbox ? ['inbox'] : []), 'preferences', 'apps'],
11
+ ['help', 'logout'],
12
12
  ];
13
- return groups.filter((group) => group.length > 0);
14
13
  }
@@ -66,7 +66,7 @@ export function WorkspaceMenuSection({ actions, }) {
66
66
  setSelectedAccountId(row.accountId);
67
67
  };
68
68
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: "p-0.5", children: _jsxs("div", { className: "relative", children: [_jsx(MagnifyingGlassIcon, { className: "text-muted-foreground pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2" }), _jsx(Input, { value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('find'), "aria-label": t('find'),
69
- // A Radix menu runs typeahead on printable keys and moves focus off
69
+ // A menu runs typeahead on printable keys and moves focus off
70
70
  // the field. Stopping propagation keeps the keystrokes here.
71
71
  onKeyDown: (e) => e.stopPropagation(), className: "h-8 pr-2 pl-8 text-sm" })] }) }), _jsx(InvitationsMenuGroup, {}), _jsxs("div", { className: "max-h-[640px] [scrollbar-width:none] overflow-y-auto [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", "data-testid": "switcher-workspaces", children: [directory.loading ? (_jsx("div", { className: "space-y-1 p-1", children: Array.from({ length: 3 }, (_, i) => (_jsx(Skeleton, { className: "h-7 rounded-md" }, i))) })) : visible.length === 0 && query.trim() ? (_jsx("div", { className: "text-muted-foreground px-2 py-3 text-xs", children: t('noMatches') })) : (_jsx(DropdownMenuGroup, { className: "p-0.5", children: visible.map((row) => {
72
72
  if (row.state !== 'active') {
@@ -35,7 +35,7 @@ const URL_MAX = 2048;
35
35
  const TITLE_MAX = 200;
36
36
  /** The URL keys of the search and the filters. */
37
37
  const FILTER_PARAMS = ['q', 'pinned', 'by', 'added'];
38
- /** The radio value of a facet's "Any" row (Radix needs a non-empty value). */
38
+ /** The radio value of a facet's "Any" row (a radio item needs a non-empty value). */
39
39
  const ANY = 'any';
40
40
  /** "example.com/x" becomes "https://example.com/x"; a value with a scheme is kept as typed. */
41
41
  function withScheme(value) {
@@ -24,7 +24,7 @@ const SEARCH_DEBOUNCE_MS = 250;
24
24
  const SEARCH_MIN_CHARS = 2;
25
25
  /** The URL keys of the search and the filters. */
26
26
  const FILTER_PARAMS = ['q', 'status', 'by', 'agent', 'active'];
27
- /** The radio value of a facet's "Any" row (Radix needs a non-empty value). */
27
+ /** The radio value of a facet's "Any" row (a radio item needs a non-empty value). */
28
28
  const ANY = 'any';
29
29
  /** The session list's mark for each Status value, so a row and its filter look the same. */
30
30
  const STATUS_MARK = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortix/ui",
3
- "version": "0.15.6",
3
+ "version": "0.15.8",
4
4
  "description": "Kortix UI: the shared React component library for apps/web, Kortix Apps and SDK hosts. Tailwind v4 classes, themed by CSS variables.",
5
5
  "type": "module",
6
6
  "license": "Elastic-2.0",
@@ -1857,6 +1857,10 @@
1857
1857
  "types": "./dist/primitives/sliding-tab-indicator.d.ts",
1858
1858
  "import": "./dist/primitives/sliding-tab-indicator.js"
1859
1859
  },
1860
+ "./slot": {
1861
+ "types": "./dist/primitives/slot.d.ts",
1862
+ "import": "./dist/primitives/slot.js"
1863
+ },
1860
1864
  "./split-sheet": {
1861
1865
  "types": "./dist/primitives/split-sheet.d.ts",
1862
1866
  "import": "./dist/primitives/split-sheet.js"
@@ -2176,6 +2180,7 @@
2176
2180
  "smoke:install": "node scripts/smoke-install.mjs"
2177
2181
  },
2178
2182
  "dependencies": {
2183
+ "@base-ui/react": "1.9.0",
2179
2184
  "@codemirror/commands": "^6.10.3",
2180
2185
  "@codemirror/lint": "^6.9.5",
2181
2186
  "@codemirror/state": "^6.6.0",
@@ -2197,38 +2202,20 @@
2197
2202
  "@extend-ai/react-docx": "^0.7.5",
2198
2203
  "@extend-ai/react-xlsx": "0.13.4",
2199
2204
  "@glideapps/glide-data-grid": "6.0.4-alpha24",
2200
- "@kortix/llm-catalog": "0.15.6",
2205
+ "@kortix/llm-catalog": "0.15.8",
2201
2206
  "@lezer/highlight": "1.2.3",
2202
2207
  "@paper-design/shaders-react": "^0.0.76",
2203
2208
  "@phosphor-icons/react": "2.1.10",
2204
2209
  "@pierre/diffs": "1.1.22",
2205
- "@radix-ui/react-accordion": "^1.2.11",
2206
- "@radix-ui/react-alert-dialog": "^1.1.11",
2207
- "@radix-ui/react-checkbox": "^1.3.3",
2208
- "@radix-ui/react-collapsible": "^1.1.12",
2209
- "@radix-ui/react-context-menu": "^2.2.16",
2210
- "@radix-ui/react-dialog": "^1.1.15",
2211
- "@radix-ui/react-dropdown-menu": "^2.1.16",
2212
- "@radix-ui/react-label": "^2.1.7",
2213
- "@radix-ui/react-popover": "^1.1.7",
2214
- "@radix-ui/react-portal": "1.1.17",
2215
- "@radix-ui/react-progress": "^1.1.7",
2216
- "@radix-ui/react-scroll-area": "^1.2.4",
2217
- "@radix-ui/react-select": "^2.2.6",
2218
- "@radix-ui/react-separator": "^1.1.7",
2219
- "@radix-ui/react-slider": "^1.3.2",
2220
- "@radix-ui/react-slot": "^1.2.3",
2221
- "@radix-ui/react-switch": "^1.2.6",
2222
- "@radix-ui/react-tabs": "^1.1.8",
2223
- "@radix-ui/react-toggle": "^1.1.10",
2224
- "@radix-ui/react-tooltip": "^1.2.8",
2225
- "@radix-ui/react-visually-hidden": "^1.2.4",
2226
2210
  "@tanstack/react-virtual": "^3.13.12",
2227
2211
  "@tiptap/core": "3.30.5",
2228
2212
  "@tiptap/extension-bubble-menu": "3.30.5",
2213
+ "@tiptap/extension-code": "3.30.5",
2214
+ "@tiptap/extension-code-block": "3.30.5",
2229
2215
  "@tiptap/extension-document": "3.30.5",
2230
2216
  "@tiptap/extension-floating-menu": "3.30.5",
2231
2217
  "@tiptap/extension-hard-break": "3.30.5",
2218
+ "@tiptap/extension-image": "3.30.5",
2232
2219
  "@tiptap/extension-list": "3.30.5",
2233
2220
  "@tiptap/extension-paragraph": "3.30.5",
2234
2221
  "@tiptap/extension-placeholder": "3.30.5",
@@ -2249,7 +2236,6 @@
2249
2236
  "ag-grid-react": "^35.1.0",
2250
2237
  "class-variance-authority": "^0.7.1",
2251
2238
  "clsx": "^2.1.1",
2252
- "cmdk": "^0.2.1",
2253
2239
  "color-bits": "^1.1.0",
2254
2240
  "date-fns": "^3.6.0",
2255
2241
  "diff": "^8.0.3",
@@ -2259,12 +2245,12 @@
2259
2245
  "jszip": "^3.10.1",
2260
2246
  "katex": "^0.18.7",
2261
2247
  "maplibre-gl": "6.12.0",
2248
+ "marked": "^16.4.2",
2262
2249
  "mermaid": "^11.12.0",
2263
2250
  "motion": "^12.40.0",
2264
2251
  "papaparse": "^5.5.2",
2265
2252
  "pdf-lib": "^1.17.1",
2266
2253
  "pptx-react-viewer": "^1.15.0",
2267
- "radix-ui": "^1.6.0",
2268
2254
  "react-day-picker": "^8.10.1",
2269
2255
  "react-i18next": "^17.0.9",
2270
2256
  "react-markdown": "^10.1.0",
@@ -2282,21 +2268,16 @@
2282
2268
  "sql.js": "^1.14.1",
2283
2269
  "streamdown": "^1.6.11",
2284
2270
  "tailwind-merge": "^3.6.0",
2271
+ "turndown": "^7.2.1",
2272
+ "turndown-plugin-gfm": "^1.0.2",
2285
2273
  "unified": "^11.0.5",
2286
2274
  "uqr": "0.1.3",
2287
2275
  "use-intl": "^4.13.4",
2288
- "vaul": "^1.1.2",
2289
- "zustand": "^5.0.3",
2290
- "@tiptap/extension-code": "3.30.5",
2291
- "@tiptap/extension-code-block": "3.30.5",
2292
- "@tiptap/extension-image": "3.30.5",
2293
- "marked": "^16.4.2",
2294
- "turndown": "^7.2.1",
2295
- "turndown-plugin-gfm": "^1.0.2",
2296
- "yaml": "^2.8.2"
2276
+ "yaml": "^2.8.2",
2277
+ "zustand": "^5.0.3"
2297
2278
  },
2298
2279
  "peerDependencies": {
2299
- "@kortix/sdk": "^0.15.6",
2280
+ "@kortix/sdk": "^0.15.8",
2300
2281
  "@tanstack/react-query": "^5.75.2",
2301
2282
  "@types/react": ">=18",
2302
2283
  "react": ">=19",
@@ -51,7 +51,7 @@ A new primitive is the last step: tokens only, a small API, and a section on `/d
51
51
  | A hand-rolled chip `<span>` or a colored banner | `Badge`, `Alert` |
52
52
  | `SectionCard`, `List` / `ListRow` | `Card`, `<ul className="space-y-2">` rows |
53
53
  | `lucide-react` or another icon set | `@phosphor-icons/react`, `*Icon` names, no `weight` prop (only `weight="fill"` for solid status glyphs) |
54
- | A fork or a restyled copy of a component | the component as it ships; theme with tokens (section 6) |
54
+ | A fork of a component, or `@base-ui/react`, `@radix-ui/*`, `cmdk`, `vaul` in a host | the component as it ships, themed with tokens (section 6); `asChild` on its parts, `Slot` from `@kortix/ui/slot` |
55
55
 
56
56
  ## 4. Tokens only
57
57
 
@@ -32,7 +32,7 @@ npm i tw-animate-css tailwind-scrollbar tailwind-scrollbar-hide # Tailwind v4
32
32
  The module entries this guide uses (`session`, `workspace`, `files`, `theme`) need 0.14.4 or later.
33
33
  Inside `kortix-ai/CompanyOS`, use `"workspace:*"`.
34
34
  Without `@openuidev/lang-core`, `vite build` fails with `Missing export` in `@kortix/sdk/dist/genui`.
35
- Name `react@19 react-dom@19`: with an unversioned `react`, npm picks React 18 for `cmdk`'s peer and the install never finishes.
35
+ Name `react@19 react-dom@19`: `@kortix/ui` needs React 19.
36
36
 
37
37
  Server rendering: the entries that render sessions or files (`session`, `composer`, `session-panel`,
38
38
  `workspace`, `files`, `file-viewer`, `markdown`, `genui`, `customize`) import CSS (KaTeX and others)
@@ -1,25 +0,0 @@
1
- import type { AccountSecretResource, SubscriptionUsage } from '@kortix/sdk';
2
- /** The props-only card also lets the design-system preview use synthetic data. */
3
- export declare function SubscriptionUsageCard({ secret, usage, fetching, error, onRefresh, onConnect, showLabel, }: {
4
- secret: AccountSecretResource;
5
- usage: SubscriptionUsage | null;
6
- fetching: boolean;
7
- error: boolean;
8
- onRefresh: () => void;
9
- onConnect?: () => void;
10
- /** Name the login under the provider: two logins of one provider look alike otherwise. */
11
- showLabel?: boolean;
12
- }): import("react").JSX.Element;
13
- /**
14
- * Whether the project has a ChatGPT or Claude subscription login to report on.
15
- * `ready` is false until the answer is known, so a caller can wait instead of
16
- * hiding, then showing, the Usage tab.
17
- */
18
- export declare function useHasSubscriptions(projectId: string, enabled?: boolean): {
19
- ready: boolean;
20
- has: boolean;
21
- };
22
- export declare function SubscriptionUsageTab({ projectId, onConnect, }: {
23
- projectId: string;
24
- onConnect: () => void;
25
- }): import("react").JSX.Element;
@@ -1,121 +0,0 @@
1
- 'use client';
2
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useLocale, useTranslations } from '../../../i18n/index.js';
4
- import { useSubscriptionConnections, useSubscriptionUsage, } from '@kortix/sdk/react';
5
- import { ArrowClockwiseIcon, ChartBarIcon } from '@phosphor-icons/react';
6
- import { usePooledProviderIds } from '../../providers/provider-connect.js';
7
- import { Button } from '../../../primitives/button.js';
8
- import { Badge } from '../../../primitives/badge.js';
9
- import { EmptyState } from '../../../primitives/empty-state.js';
10
- import Loading from '../../../primitives/loading.js';
11
- import { ProviderLogo } from '../../../internal/lib/provider-branding.js';
12
- import { Progress } from '../../../primitives/progress.js';
13
- import { isSubscriptionLogin, shownUsage, formatReset, weeklyModel, usageTone, } from './subscription-usage.js';
14
- const PROVIDER_NAME = {
15
- codex: 'ChatGPT',
16
- 'claude-agent': 'Claude Code',
17
- };
18
- const TONE_BAR = {
19
- ok: 'bg-primary',
20
- near: 'bg-kortix-orange',
21
- critical: 'bg-kortix-red',
22
- limited: 'bg-kortix-red',
23
- };
24
- /** One plan window: its name, how much is used, a bar, and when it resets. */
25
- function UsageWindowMeter({ window, limited, now, lead, }) {
26
- const locale = useLocale();
27
- const t = useTranslations('subscriptionUsage');
28
- const model = weeklyModel(window.id);
29
- const label = window.id === 'five_hour'
30
- ? t('fiveHour')
31
- : window.id === 'weekly'
32
- ? t('weekly')
33
- : model
34
- ? t('weeklyModel', { model })
35
- : window.id.replaceAll('_', ' ');
36
- const expired = Boolean(window.resets_at && Date.parse(window.resets_at) <= now);
37
- const percent = Math.max(0, Math.min(100, Math.round(window.used_percent)));
38
- return (_jsxs("div", { className: "flex flex-col gap-2", children: [lead ? (_jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [_jsxs("span", { className: "text-2xl font-semibold tracking-tight tabular-nums", children: [percent, "%"] }), _jsx("span", { className: "text-xs text-muted-foreground", children: label })] })) : (_jsxs("div", { className: "flex items-baseline justify-between gap-3 text-sm", children: [_jsx("span", { children: label }), _jsxs("span", { className: "tabular-nums font-medium", children: [percent, "%"] })] })), _jsx(Progress, { value: percent, "aria-label": t('meterLabel', { label, percent }), className: "h-1.5 bg-muted", indicatorClassName: expired ? 'bg-muted-foreground' : TONE_BAR[usageTone(window, limited)] }), _jsx("p", { className: "text-xs text-muted-foreground", children: expired
39
- ? t('text9')
40
- : window.resets_at
41
- ? t('resets', { time: formatReset(window.resets_at, now, locale) })
42
- : t('text10') }), model === 'Fable' && (_jsx("p", { className: "text-xs text-muted-foreground", children: t('fableIncluded') }))] }));
43
- }
44
- /** The props-only card also lets the design-system preview use synthetic data. */
45
- export function SubscriptionUsageCard({ secret, usage, fetching, error, onRefresh, onConnect, showLabel = false, }) {
46
- const locale = useLocale();
47
- const t = useTranslations('subscriptionUsage');
48
- const now = Date.now();
49
- const reconnect = Boolean(secret.needs_reauth_at || secret.status === 'undecryptable');
50
- // A rejection in a snapshot whose reset has passed is no current limit.
51
- const rejectionIsCurrent = Boolean(usage?.limited &&
52
- !usage.windows.some((window) => window.resets_at && Date.parse(window.resets_at) <= now));
53
- const exhausted = rejectionIsCurrent ||
54
- Boolean(usage?.windows.some((w) => w.used_percent >= 100 &&
55
- (!w.resets_at || Date.parse(w.resets_at) > now)));
56
- const stale = Boolean(usage && now - Date.parse(usage.observed_at) > 10 * 60_000);
57
- // The badge appears only when something needs attention.
58
- const status = reconnect
59
- ? t('text0')
60
- : !secret.active
61
- ? t('text1')
62
- : error
63
- ? t('text2')
64
- : exhausted
65
- ? t('text4')
66
- : stale
67
- ? t('text5')
68
- : null;
69
- const windows = usage?.windows ?? [];
70
- // The window closest to its limit leads; the rest keep the provider's order.
71
- const lead = windows.reduce((best, window) => !best || window.used_percent > best.used_percent ? window : best, null);
72
- const rest = windows.filter((window) => window !== lead);
73
- return (_jsxs("article", { className: "rounded-md border border-border p-4 flex flex-col gap-4 min-w-0", children: [_jsxs("header", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(ProviderLogo, { providerID: secret.provider_id ?? '', size: "small", tone: "light" }), _jsxs("div", { className: "min-w-0", children: [_jsxs("h3", { className: "text-sm font-medium truncate", children: [PROVIDER_NAME[secret.provider_id ?? ''] ?? secret.label, ' ', _jsx("span", { className: "text-muted-foreground font-normal capitalize", children: secret.provider_account?.plan ?? t('text7') })] }), showLabel && (_jsx("p", { className: "text-xs text-muted-foreground truncate", children: secret.label }))] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [status && (_jsx(Badge, { size: "sm", variant: reconnect || exhausted ? 'warning' : 'secondary', children: status })), reconnect ? (_jsx(Button, { variant: "outline", size: "sm", onClick: onConnect, children: t('reconnect') })) : (_jsx(Button, { variant: "ghost", size: "icon-sm", disabled: fetching || !secret.active, onClick: onRefresh, "aria-label": t('refreshLabel', { label: secret.label }), title: fetching ? t('text15') : t('text16'), children: fetching ? _jsx(Loading, {}) : _jsx(ArrowClockwiseIcon, {}) }))] })] }), lead && usage ? (_jsxs(_Fragment, { children: [_jsx(UsageWindowMeter, { window: lead, limited: usage.limited, now: now, lead: true }), rest.length > 0 && (_jsx("div", { className: "flex flex-col gap-4 border-t border-border pt-4", children: rest.map((window) => (_jsx(UsageWindowMeter, { window: window, limited: usage.limited, now: now }, window.id))) }))] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: fetching ? t('text11') : error ? t('text2') : t('text12') })), usage && (error || stale) && (_jsx("p", { className: "text-xs text-muted-foreground", children: error
74
- ? t('text13')
75
- : t('observed', {
76
- time: new Date(usage.observed_at).toLocaleString(locale, {
77
- month: 'short',
78
- day: 'numeric',
79
- hour: 'numeric',
80
- minute: '2-digit',
81
- }),
82
- }) }))] }));
83
- }
84
- function ConnectedSubscription({ accountId, projectId, secret, onConnect, showLabel, }) {
85
- const live = useSubscriptionUsage(accountId, secret.secret_id, {
86
- projectId,
87
- storage: secret.storage,
88
- enabled: secret.can_use &&
89
- secret.active &&
90
- !secret.needs_reauth_at &&
91
- secret.status !== 'undecryptable',
92
- });
93
- return (_jsx(SubscriptionUsageCard, { secret: {
94
- ...secret,
95
- provider_account: live.data?.provider_account ?? secret.provider_account,
96
- }, usage: shownUsage(live.data?.usage, secret.usage), fetching: live.isFetching, error: live.isError, onRefresh: () => void live.refetch(), onConnect: onConnect, showLabel: showLabel }));
97
- }
98
- /**
99
- * Whether the project has a ChatGPT or Claude subscription login to report on.
100
- * `ready` is false until the answer is known, so a caller can wait instead of
101
- * hiding, then showing, the Usage tab.
102
- */
103
- export function useHasSubscriptions(projectId, enabled = true) {
104
- const pooled = usePooledProviderIds(projectId, enabled);
105
- const resources = useSubscriptionConnections(enabled ? pooled.accountId : null, projectId);
106
- const subscriptions = (resources.data?.subscriptions ?? []).filter((secret) => secret.can_use && isSubscriptionLogin(secret));
107
- const ready = !pooled.isLoading &&
108
- (!pooled.pooledSecretsEnabled || !pooled.accountId || !resources.isLoading);
109
- return { ready, has: subscriptions.length > 0 };
110
- }
111
- export function SubscriptionUsageTab({ projectId, onConnect, }) {
112
- const t = useTranslations('subscriptionUsage');
113
- const pooled = usePooledProviderIds(projectId, true);
114
- const resources = useSubscriptionConnections(pooled.accountId, projectId);
115
- // Every connected ChatGPT and Claude login, side by side.
116
- const subscriptions = (resources.data?.subscriptions ?? []).filter((secret) => secret.can_use && isSubscriptionLogin(secret));
117
- return (_jsxs("section", { className: "@container space-y-6 pb-6", children: [_jsx("h2", { className: "text-lg font-medium", children: t('text17') }), pooled.isLoading || (pooled.accountId && resources.isLoading) ? (_jsx(Loading, {})) : pooled.isError || resources.isError ? (_jsx(EmptyState, { title: t('text19'), description: t('text20'), action: _jsx(Button, { variant: "outline", onClick: () => {
118
- void pooled.refetch();
119
- void resources.refetch();
120
- }, children: t('text21') }) })) : !pooled.pooledSecretsEnabled ? (_jsx(EmptyState, { icon: ChartBarIcon, title: t('disabledTitle'), description: t('disabledDescription') })) : !subscriptions.length ? (_jsx(EmptyState, { icon: ChartBarIcon, title: t('text22'), description: t('text23'), action: _jsx(Button, { variant: "outline", onClick: onConnect, children: t('text24') }) })) : (_jsx("div", { className: "grid grid-flow-dense grid-cols-1 @3xl:grid-cols-2 items-start gap-4", children: subscriptions.map((secret) => (_jsx(ConnectedSubscription, { projectId: projectId, accountId: pooled.accountId, secret: secret, onConnect: onConnect, showLabel: subscriptions.filter((other) => other.provider_id === secret.provider_id).length > 1 }, `${secret.storage}:${secret.secret_id}`))) }))] }));
121
- }