@parallelworks/ui 0.40.1 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +25 -0
  2. package/dist/ai/adapter/memoryStore.js +7 -0
  3. package/dist/ai/adapter/mock/mockAdapter.js +52 -17
  4. package/dist/ai/adapter/openai/createOpenAIStream.js +1 -1
  5. package/dist/ai/adapter/openai/index.d.ts +1 -1
  6. package/dist/ai/adapter/openai/sse.d.ts +8 -2
  7. package/dist/ai/adapter/openai/sse.js +40 -4
  8. package/dist/ai/adapter/openai/wire.d.ts +6 -0
  9. package/dist/ai/components/AllocationSelector.d.ts +3 -4
  10. package/dist/ai/components/AllocationSelector.js +37 -33
  11. package/dist/ai/components/AttachmentManager.js +7 -7
  12. package/dist/ai/components/AttachmentUpload.js +5 -5
  13. package/dist/ai/components/BranchNavigator.js +1 -1
  14. package/dist/ai/components/ChatEmptyState.js +2 -2
  15. package/dist/ai/components/ChatInput.js +10 -8
  16. package/dist/ai/components/ChatLayout.js +4 -5
  17. package/dist/ai/components/ChatMessage.js +12 -12
  18. package/dist/ai/components/ChatMessageList.js +9 -9
  19. package/dist/ai/components/ChatSidebar.js +8 -9
  20. package/dist/ai/components/ChatThread.js +4 -4
  21. package/dist/ai/components/ComposerChrome.d.ts +2 -2
  22. package/dist/ai/components/ComposerChrome.js +3 -6
  23. package/dist/ai/components/DragOverlay.js +2 -2
  24. package/dist/ai/components/ModelSelector.d.ts +5 -3
  25. package/dist/ai/components/ModelSelector.js +102 -339
  26. package/dist/ai/components/PastedText.js +11 -11
  27. package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
  28. package/dist/ai/components/ProviderIssueBanner.js +34 -16
  29. package/dist/ai/components/Reasoning.js +4 -4
  30. package/dist/ai/components/ShareDialog.js +43 -35
  31. package/dist/ai/components/SlashMenu.d.ts +12 -2
  32. package/dist/ai/components/SlashMenu.js +29 -13
  33. package/dist/ai/components/agent/ActivityLine.js +3 -3
  34. package/dist/ai/components/agent/AgentMessageParts.js +20 -20
  35. package/dist/ai/components/agent/PermissionPicker.js +13 -11
  36. package/dist/ai/components/conversationActions.d.ts +4 -6
  37. package/dist/ai/components/conversationActions.js +9 -13
  38. package/dist/ai/core/ChatProvider.js +4 -4
  39. package/dist/ai/core/config.js +1 -1
  40. package/dist/ai/core/parts.d.ts +5 -0
  41. package/dist/ai/core/parts.js +28 -1
  42. package/dist/ai/core/providerIssues.d.ts +7 -0
  43. package/dist/ai/core/providerIssues.js +9 -1
  44. package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
  45. package/dist/ai/core/useKeyboardShortcuts.js +8 -2
  46. package/dist/ai/index.d.ts +0 -1
  47. package/dist/ai/index.js +1 -2
  48. package/dist/ai/strings.d.ts +19 -0
  49. package/dist/ai/strings.js +18 -1
  50. package/dist/ai/ui/Avatar.js +5 -5
  51. package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
  52. package/dist/ai/ui/ConversationSidebar.js +6 -7
  53. package/dist/ai/ui/Markdown.js +3 -3
  54. package/dist/ai/ui/Notice.js +6 -6
  55. package/dist/ai/ui/chip.d.ts +4 -0
  56. package/dist/ai/ui/chip.js +8 -0
  57. package/dist/ai/ui/sidebar.d.ts +6 -5
  58. package/dist/ai/ui/sidebar.js +39 -43
  59. package/dist/components/ActionMenu.d.ts +13 -0
  60. package/dist/components/ActionMenu.js +30 -0
  61. package/dist/components/Avatar.js +6 -6
  62. package/dist/components/Breadcrumbs.js +1 -1
  63. package/dist/components/Button.js +10 -10
  64. package/dist/components/Callout.js +2 -2
  65. package/dist/components/Card.js +3 -3
  66. package/dist/components/Combobox.d.ts +66 -0
  67. package/dist/components/Combobox.js +393 -0
  68. package/dist/components/ConfirmModal.js +11 -11
  69. package/dist/components/ContextMenu.d.ts +23 -0
  70. package/dist/components/ContextMenu.js +89 -0
  71. package/dist/components/CopyToClipboard.js +2 -2
  72. package/dist/components/CreateModal.d.ts +17 -36
  73. package/dist/components/CreateModal.js +97 -259
  74. package/dist/components/DescriptionList.js +8 -8
  75. package/dist/components/Filter.js +2 -2
  76. package/dist/components/FilterPill.js +2 -2
  77. package/dist/components/HoverCard.d.ts +14 -0
  78. package/dist/components/HoverCard.js +33 -0
  79. package/dist/components/IconButton.d.ts +5 -5
  80. package/dist/components/IconButton.js +18 -22
  81. package/dist/components/InfoTip.d.ts +15 -0
  82. package/dist/components/InfoTip.js +60 -0
  83. package/dist/components/Input.js +5 -5
  84. package/dist/components/LetterBadge.js +2 -2
  85. package/dist/components/Loader.js +3 -3
  86. package/dist/components/Markdown.js +1 -1
  87. package/dist/components/MarkdownImpl.js +2 -2
  88. package/dist/components/Menu.d.ts +33 -0
  89. package/dist/components/Menu.js +86 -0
  90. package/dist/components/MenuEntries.d.ts +56 -0
  91. package/dist/components/MenuEntries.js +123 -0
  92. package/dist/components/Modal.d.ts +29 -0
  93. package/dist/components/Modal.js +47 -0
  94. package/dist/components/Overview.js +11 -10
  95. package/dist/components/PageHeader.d.ts +10 -16
  96. package/dist/components/PageHeader.js +69 -95
  97. package/dist/components/Pagination.js +5 -5
  98. package/dist/components/Provider.d.ts +5 -11
  99. package/dist/components/Provider.js +11 -14
  100. package/dist/components/Radio.d.ts +8 -0
  101. package/dist/components/Radio.js +16 -0
  102. package/dist/components/SectionHeader.js +2 -2
  103. package/dist/components/SegmentedControl.d.ts +6 -5
  104. package/dist/components/SegmentedControl.js +34 -30
  105. package/dist/components/Select.d.ts +27 -0
  106. package/dist/components/Select.js +78 -0
  107. package/dist/components/SettingModeOption.d.ts +5 -8
  108. package/dist/components/SettingModeOption.js +10 -12
  109. package/dist/components/SettingRow.js +4 -4
  110. package/dist/components/SettingsCard.js +4 -4
  111. package/dist/components/SettingsGroup.js +2 -2
  112. package/dist/components/Sort.js +1 -1
  113. package/dist/components/StatusBadge.js +7 -7
  114. package/dist/components/StatusIcons.js +4 -4
  115. package/dist/components/Switch.d.ts +22 -0
  116. package/dist/components/Switch.js +28 -0
  117. package/dist/components/Table.js +11 -11
  118. package/dist/components/Tooltip.d.ts +24 -20
  119. package/dist/components/Tooltip.js +58 -76
  120. package/dist/components/floating.d.ts +14 -0
  121. package/dist/components/floating.js +21 -0
  122. package/dist/components/search.d.ts +2 -0
  123. package/dist/components/search.js +14 -0
  124. package/dist/editor/Editor.js +1 -1
  125. package/dist/editor/EditorField.js +16 -21
  126. package/dist/editor/FormCodePanel.js +19 -19
  127. package/dist/editor/Monaco.js +3 -3
  128. package/dist/file-explorer/FileExplorer.js +77 -81
  129. package/dist/file-explorer/FileExplorerContext.js +2 -2
  130. package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
  131. package/dist/file-explorer/FilePreview/Inline.js +1 -1
  132. package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
  133. package/dist/file-explorer/FilePreview/Viewer.js +8 -8
  134. package/dist/file-explorer/FilePreview/index.d.ts +1 -1
  135. package/dist/file-explorer/FilePreview/index.js +49 -83
  136. package/dist/file-explorer/FileRow.d.ts +4 -3
  137. package/dist/file-explorer/FileRow.js +32 -38
  138. package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
  139. package/dist/file-explorer/FileRowsWindow.js +4 -4
  140. package/dist/file-explorer/FileTable.d.ts +3 -2
  141. package/dist/file-explorer/FileTable.js +3 -3
  142. package/dist/file-explorer/LoadMoreRow.js +1 -1
  143. package/dist/file-explorer/TreeView.js +11 -16
  144. package/dist/file-explorer/helpers.js +11 -12
  145. package/dist/file-explorer/toasts.js +11 -11
  146. package/dist/form/FieldGroup.d.ts +11 -0
  147. package/dist/form/FieldGroup.js +36 -0
  148. package/dist/form/FieldWrapper.js +4 -4
  149. package/dist/form/Fields/BooleanField.js +23 -33
  150. package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
  151. package/dist/form/Fields/CheckboxGroupField.js +9 -13
  152. package/dist/form/Fields/ColorField.d.ts +1 -2
  153. package/dist/form/Fields/ColorField.js +6 -11
  154. package/dist/form/Fields/DropdownField.d.ts +3 -13
  155. package/dist/form/Fields/DropdownField.js +40 -27
  156. package/dist/form/Fields/DurationField.d.ts +1 -2
  157. package/dist/form/Fields/DurationField.js +25 -32
  158. package/dist/form/Fields/LabelField.js +2 -2
  159. package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
  160. package/dist/form/Fields/MultiDropdownField.js +31 -22
  161. package/dist/form/Fields/NumberField.d.ts +1 -1
  162. package/dist/form/Fields/NumberField.js +65 -35
  163. package/dist/form/Fields/ObjectField.d.ts +1 -1
  164. package/dist/form/Fields/ObjectField.js +12 -43
  165. package/dist/form/Fields/RadioField.d.ts +1 -1
  166. package/dist/form/Fields/RadioField.js +30 -41
  167. package/dist/form/Fields/RangeField.d.ts +1 -2
  168. package/dist/form/Fields/RangeField.js +23 -16
  169. package/dist/form/Fields/StringField.d.ts +1 -2
  170. package/dist/form/Fields/StringField.js +58 -26
  171. package/dist/form/Fields/TextAreaField.js +12 -10
  172. package/dist/form/Form.d.ts +30 -48
  173. package/dist/form/Form.js +306 -412
  174. package/dist/form/FormLayout.js +9 -9
  175. package/dist/form/Wizard/WizardContainer.d.ts +1 -4
  176. package/dist/form/Wizard/WizardContainer.js +40 -56
  177. package/dist/form/Wizard/WizardNavigation.js +1 -1
  178. package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
  179. package/dist/form/Wizard/WizardStepContent.js +11 -16
  180. package/dist/form/Wizard/WizardStepIndicator.js +6 -6
  181. package/dist/form/Wizard/types.d.ts +0 -14
  182. package/dist/form/fieldRegistry.d.ts +1 -1
  183. package/dist/form/fieldRegistry.js +6 -6
  184. package/dist/form/formEditing.js +1 -1
  185. package/dist/form/index.d.ts +5 -4
  186. package/dist/form/index.js +6 -7
  187. package/dist/form/types/fieldComponentTypes.d.ts +8 -10
  188. package/dist/form/useChoiceField.d.ts +20 -0
  189. package/dist/form/useChoiceField.js +49 -0
  190. package/dist/form/useFieldValue.d.ts +7 -0
  191. package/dist/form/useFieldValue.js +20 -0
  192. package/dist/form/useParsedOpts.d.ts +3 -1
  193. package/dist/form/useParsedOpts.js +12 -17
  194. package/dist/form/utils/dependentOptions.d.ts +8 -4
  195. package/dist/form/utils/dependentOptions.js +25 -17
  196. package/dist/form/utils/fieldItems.d.ts +10 -0
  197. package/dist/form/utils/fieldItems.js +11 -0
  198. package/dist/form/utils/fieldPath.d.ts +10 -0
  199. package/dist/form/utils/fieldPath.js +20 -0
  200. package/dist/form/utils/shareEqual.d.ts +6 -0
  201. package/dist/form/utils/shareEqual.js +38 -0
  202. package/dist/graph/AnnotationBanner.js +8 -8
  203. package/dist/graph/Collapse.d.ts +1 -0
  204. package/dist/graph/Collapse.js +6 -27
  205. package/dist/graph/Connectors.js +5 -5
  206. package/dist/graph/DependencyGraph.js +20 -19
  207. package/dist/graph/GraphEditor.js +30 -41
  208. package/dist/graph/GraphEditorDialogs.js +17 -17
  209. package/dist/graph/GraphNode.js +1 -1
  210. package/dist/graph/InputDialog.js +19 -22
  211. package/dist/graph/InputsEditor.js +58 -66
  212. package/dist/graph/JobSummary.js +42 -39
  213. package/dist/graph/MatrixGroup.js +1 -1
  214. package/dist/graph/ProblemsButton.js +18 -19
  215. package/dist/graph/Reveal.js +1 -1
  216. package/dist/graph/ShortcutsButton.js +15 -18
  217. package/dist/graph/SuggestionInput.d.ts +5 -10
  218. package/dist/graph/SuggestionInput.js +14 -18
  219. package/dist/graph/ToolbarPopover.d.ts +11 -6
  220. package/dist/graph/ToolbarPopover.js +35 -67
  221. package/dist/graph/TreeView.js +24 -37
  222. package/dist/graph/WorkflowSettingsDialog.js +4 -4
  223. package/dist/graph/editorChrome.js +13 -12
  224. package/dist/graph/editorFields.js +29 -29
  225. package/dist/graph/editorPrimitives.d.ts +1 -1
  226. package/dist/graph/editorPrimitives.js +10 -7
  227. package/dist/graph/editorRows.js +103 -97
  228. package/dist/graph/fieldProblems.js +2 -2
  229. package/dist/graph/graphEditorState.d.ts +4 -3
  230. package/dist/graph/inputRefs.js +9 -9
  231. package/dist/graph/settingsViews.js +6 -7
  232. package/dist/graph/stepWith.js +6 -6
  233. package/dist/index.d.ts +14 -15
  234. package/dist/index.js +15 -14
  235. package/dist/list/ActionToolbar.d.ts +6 -14
  236. package/dist/list/ActionToolbar.js +48 -96
  237. package/dist/list/ListPage.d.ts +6 -12
  238. package/dist/list/ListPage.js +46 -29
  239. package/dist/list/ListPager.js +4 -4
  240. package/dist/list/ListTable.js +5 -5
  241. package/dist/list/ListViewControls.d.ts +5 -4
  242. package/dist/list/ListViewControls.js +177 -267
  243. package/dist/list/UserHoverCard.d.ts +3 -17
  244. package/dist/list/UserHoverCard.js +21 -45
  245. package/dist/list/index.d.ts +3 -4
  246. package/dist/list/index.js +3 -4
  247. package/dist/list/listSearch.js +12 -11
  248. package/dist/list/rowMenu.d.ts +63 -0
  249. package/dist/list/rowMenu.js +134 -0
  250. package/dist/logviewer/LogViewer.js +26 -26
  251. package/dist/styles.css +1 -1
  252. package/package.json +7 -13
  253. package/dist/ai/ui/Dropdown.d.ts +0 -31
  254. package/dist/ai/ui/Dropdown.js +0 -110
  255. package/dist/components/AddMenu.d.ts +0 -18
  256. package/dist/components/AddMenu.js +0 -46
  257. package/dist/components/BareModal.d.ts +0 -17
  258. package/dist/components/BareModal.js +0 -77
  259. package/dist/components/CollapsiblePanel.d.ts +0 -27
  260. package/dist/components/CollapsiblePanel.js +0 -77
  261. package/dist/components/Dropdown.d.ts +0 -28
  262. package/dist/components/Dropdown.js +0 -355
  263. package/dist/components/Listbox.d.ts +0 -21
  264. package/dist/components/Listbox.js +0 -119
  265. package/dist/components/MultiSelect.d.ts +0 -22
  266. package/dist/components/MultiSelect.js +0 -168
  267. package/dist/components/SwitchToggle.d.ts +0 -15
  268. package/dist/components/SwitchToggle.js +0 -57
  269. package/dist/components/SwitchToggleSmall.d.ts +0 -6
  270. package/dist/components/SwitchToggleSmall.js +0 -14
  271. package/dist/components/Toggle.d.ts +0 -6
  272. package/dist/components/Toggle.js +0 -20
  273. package/dist/components/dropdownUtils.d.ts +0 -37
  274. package/dist/components/dropdownUtils.js +0 -99
  275. package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
  276. package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
  277. package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
  278. package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
  279. package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
  280. package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
  281. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
  282. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
  283. package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
  284. package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
  285. package/dist/form/SpecialTypes/index.d.ts +0 -3
  286. package/dist/list/HoverCard.d.ts +0 -24
  287. package/dist/list/HoverCard.js +0 -73
  288. package/dist/list/RowContextMenu.d.ts +0 -127
  289. package/dist/list/RowContextMenu.js +0 -515
@@ -1,15 +1,15 @@
1
- import { TooltipInfo } from "./Tooltip.js";
2
- import cx from "classnames";
1
+ import { InfoTip } from "./InfoTip.js";
2
+ import { clsx } from "clsx";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
4
  import React from "react";
4
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/DescriptionList.tsx
6
6
  function DescriptionListItem({ label, children, tooltip, className, ...props }) {
7
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("dt", {
8
- className: cx("text-[13px] leading-6 col-span-1 font-normal flex gap-1", className),
7
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("dt", {
8
+ className: clsx("text-[13px] leading-6 col-span-1 font-normal flex gap-1", className),
9
9
  children: [/* @__PURE__ */ jsx("span", {
10
10
  className: "min-w-0 truncate",
11
11
  children: label
12
- }), tooltip && /* @__PURE__ */ jsx(TooltipInfo, {
12
+ }), tooltip && /* @__PURE__ */ jsx(InfoTip, {
13
13
  className: "pr-2",
14
14
  text: tooltip
15
15
  })]
@@ -21,7 +21,7 @@ function DescriptionListItem({ label, children, tooltip, className, ...props })
21
21
  }
22
22
  function DescriptionList({ children, title, separators = true, subtitle, className, wrapperClassName, vertical = false }) {
23
23
  return /* @__PURE__ */ jsxs("div", {
24
- className: cx("w-full", wrapperClassName),
24
+ className: clsx("w-full", wrapperClassName),
25
25
  children: [
26
26
  title && /* @__PURE__ */ jsx("h2", {
27
27
  className: "text-sm font-semibold w-full mb-1",
@@ -32,7 +32,7 @@ function DescriptionList({ children, title, separators = true, subtitle, classNa
32
32
  children: subtitle
33
33
  }),
34
34
  /* @__PURE__ */ jsx("dl", {
35
- className: cx("grid", separators && "*:not-last-of-type:border-b-1", vertical ? "grid-cols-1" : "grid-cols-5 gap-x-4 gap-y-0.5 *:pb-0.5", className),
35
+ className: clsx("grid", separators && "*:not-last-of-type:border-b-1", vertical ? "grid-cols-1" : "grid-cols-5 gap-x-4 gap-y-0.5 *:pb-0.5", className),
36
36
  children: Array.isArray(children) ? React.Children.toArray(children) : children
37
37
  })
38
38
  ]
@@ -1,5 +1,5 @@
1
1
  import { FaFilter } from "../icons/fa/FaFilter.js";
2
- import cx from "classnames";
2
+ import { clsx } from "clsx";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/Filter.tsx
5
5
  function Filter({ filter, setFilter, placeholder = "Filter...", pills, activePill, onPillChange }) {
@@ -22,7 +22,7 @@ function Filter({ filter, setFilter, placeholder = "Filter...", pills, activePil
22
22
  children: pills.map((pill) => /* @__PURE__ */ jsx("button", {
23
23
  type: "button",
24
24
  onClick: () => onPillChange(pill.value),
25
- className: cx("px-2.5 py-1 text-xs rounded-full transition-colors border", activePill === pill.value ? "bg-(--theme-element) text-(--theme-element-text) border-transparent" : "theme-border theme-text hover:theme-hover"),
25
+ className: clsx("px-2.5 py-1 text-xs rounded-full transition-colors border", activePill === pill.value ? "bg-(--theme-element) text-(--theme-element-text) border-transparent" : "theme-border theme-text hover:theme-hover"),
26
26
  children: pill.label
27
27
  }, pill.value))
28
28
  })]
@@ -1,4 +1,4 @@
1
- import cx from "classnames";
1
+ import { clsx } from "clsx";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/FilterPill.tsx
4
4
  function FilterPill({ active, onClick, children }) {
@@ -6,7 +6,7 @@ function FilterPill({ active, onClick, children }) {
6
6
  type: "button",
7
7
  "aria-pressed": active,
8
8
  onClick,
9
- className: cx("px-3 py-1.5 text-xs font-medium rounded-full border transition-all duration-200", active ? "bg-[var(--theme-panel-bg)] border-[var(--theme-border)] text-[var(--theme-panel)] shadow-sm" : "bg-transparent border-transparent text-[var(--theme-muted-text-color)] hover:text-[var(--theme-panel)] hover:bg-[var(--theme-hover)]"),
9
+ className: clsx("px-3 py-1.5 text-xs font-medium rounded-full border transition-all duration-200", active ? "bg-[var(--theme-panel-bg)] border-[var(--theme-border)] text-[var(--theme-panel)] shadow-sm" : "bg-transparent border-transparent text-[var(--theme-muted-text-color)] hover:text-[var(--theme-panel)] hover:bg-[var(--theme-hover)]"),
10
10
  children
11
11
  });
12
12
  }
@@ -0,0 +1,14 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ export interface HoverCardProps {
3
+ /** Mounted only while open, so a card that loads its own data loads on first hover. */
4
+ card: ReactNode;
5
+ /** The anchor. It receives the trigger's props and ref, so it must pass them to its element. */
6
+ children: ReactElement;
7
+ /** Opens on first render, for stories and screenshots. */
8
+ defaultOpen?: boolean;
9
+ }
10
+ /** Detail about its anchor, such as a person's profile, after a short hover or
11
+ * on focus. A visual enhancement: whatever the card shows must also be
12
+ * reachable another way, such as the page the anchor links to. The card
13
+ * stays open while the pointer is over it. */
14
+ export declare function HoverCard({ card, children, defaultOpen }: HoverCardProps): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { cardClassName, portalContainer, positionerClassName } from "./floating.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { PreviewCard } from "@base-ui/react/preview-card";
4
+ //#region src/components/HoverCard.tsx
5
+ /** Detail about its anchor, such as a person's profile, after a short hover or
6
+ * on focus. A visual enhancement: whatever the card shows must also be
7
+ * reachable another way, such as the page the anchor links to. The card
8
+ * stays open while the pointer is over it. */
9
+ function HoverCard({ card, children, defaultOpen = false }) {
10
+ return /* @__PURE__ */ jsxs(PreviewCard.Root, {
11
+ defaultOpen,
12
+ children: [/* @__PURE__ */ jsx(PreviewCard.Trigger, {
13
+ delay: 350,
14
+ closeDelay: 150,
15
+ render: children
16
+ }), /* @__PURE__ */ jsx(PreviewCard.Portal, {
17
+ container: portalContainer(),
18
+ children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
19
+ side: "bottom",
20
+ align: "start",
21
+ sideOffset: 8,
22
+ collisionPadding: 8,
23
+ className: positionerClassName,
24
+ children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
25
+ className: cardClassName,
26
+ children: card
27
+ })
28
+ })
29
+ })]
30
+ });
31
+ }
32
+ //#endregion
33
+ export { HoverCard };
@@ -1,8 +1,8 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
- interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ interface IconButtonProps extends ComponentPropsWithRef<'button'> {
3
3
  /** Icon to display */
4
4
  icon: ReactNode;
5
- /** Accessible label (used for aria-label and tooltip) */
5
+ /** The accessible name, also shown as the tooltip. */
6
6
  label: string;
7
7
  /** Button variant */
8
8
  variant?: 'default' | 'ghost' | 'primary' | 'success';
@@ -10,8 +10,8 @@ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
10
10
  size?: 'sm' | 'md' | 'lg';
11
11
  /** Whether button is in active/selected state */
12
12
  active?: boolean;
13
- /** Whether to show tooltip on hover */
13
+ /** False hides the tooltip, such as while the button's own popup is open. */
14
14
  showTooltip?: boolean;
15
15
  }
16
- export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
16
+ export declare function IconButton({ icon, label, variant, size, active, showTooltip, className, ...props }: IconButtonProps): import("react").JSX.Element;
17
17
  export {};
@@ -1,34 +1,30 @@
1
- import { TOOLTIP_ID } from "./Tooltip.js";
2
- import cx from "classnames";
3
- import { forwardRef } from "react";
1
+ import { Tooltip } from "./Tooltip.js";
2
+ import { clsx } from "clsx";
4
3
  import { jsx } from "react/jsx-runtime";
5
4
  //#region src/components/IconButton.tsx
6
- var IconButton = forwardRef(({ icon, label, variant = "default", size = "md", active = false, showTooltip = true, className, disabled, ...props }, ref) => {
5
+ function IconButton({ icon, label, variant = "default", size = "md", active = false, showTooltip = true, className, ...props }) {
7
6
  const sizeClasses = {
8
7
  sm: "w-7 h-7 [&_svg]:w-3.5 [&_svg]:h-3.5",
9
8
  md: "w-9 h-9 [&_svg]:w-4 [&_svg]:h-4",
10
9
  lg: "w-11 h-11 [&_svg]:w-5 [&_svg]:h-5"
11
10
  };
12
11
  const variantClasses = {
13
- default: cx("bg-[var(--theme-muted-panel-bg)] text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-border)] hover:text-[var(--theme-app)]", active && "bg-[var(--theme-element)]/10 text-[var(--theme-element)]"),
14
- ghost: cx("bg-transparent text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-muted-panel-bg)] hover:text-[var(--theme-app)]", active && "text-[var(--theme-element)]"),
15
- primary: cx("bg-[var(--theme-element)] text-white", "hover:bg-[var(--theme-element)]/90", active && "ring-2 ring-[var(--theme-element)]/50"),
16
- success: cx("bg-[#22c55e] text-white", "hover:bg-[#22c55e]/90", active && "ring-2 ring-[#22c55e]/50")
12
+ default: clsx("bg-[var(--theme-muted-panel-bg)] text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-border)] hover:text-[var(--theme-app)]", active && "bg-[var(--theme-element)]/10 text-[var(--theme-element)]"),
13
+ ghost: clsx("bg-transparent text-[var(--theme-muted-text-color)]", "hover:bg-[var(--theme-muted-panel-bg)] hover:text-[var(--theme-app)]", active && "text-[var(--theme-element)]"),
14
+ primary: clsx("bg-[var(--theme-element)] text-white", "hover:bg-[var(--theme-element)]/90", active && "ring-2 ring-[var(--theme-element)]/50"),
15
+ success: clsx("bg-[#22c55e] text-white", "hover:bg-[#22c55e]/90", active && "ring-2 ring-[#22c55e]/50")
17
16
  };
18
- return /* @__PURE__ */ jsx("button", {
19
- ref,
20
- type: "button",
21
- "aria-label": label,
22
- disabled,
23
- ...showTooltip ? { "data-tooltip-id": TOOLTIP_ID } : {},
24
- "data-tooltip-content": label,
25
- "data-tooltip-delay-show": 300,
26
- "data-tooltip-class-name": "!bg-[var(--theme-app)] !text-[var(--theme-app-bg)] !text-xs !py-1 !px-2 !rounded-md",
27
- className: cx("inline-flex items-center justify-center rounded-lg", "transition-all duration-200 cursor-pointer", "disabled:opacity-50 disabled:cursor-not-allowed", sizeClasses[size], variantClasses[variant], className),
28
- ...props,
29
- children: icon
17
+ return /* @__PURE__ */ jsx(Tooltip, {
18
+ content: label,
19
+ disabled: !showTooltip,
20
+ children: /* @__PURE__ */ jsx("button", {
21
+ type: "button",
22
+ "aria-label": label,
23
+ className: clsx("inline-flex items-center justify-center rounded-lg", "transition-all duration-200 cursor-pointer", "disabled:opacity-50 disabled:cursor-not-allowed", sizeClasses[size], variantClasses[variant], className),
24
+ ...props,
25
+ children: icon
26
+ })
30
27
  });
31
- });
32
- IconButton.displayName = "IconButton";
28
+ }
33
29
  //#endregion
34
30
  export { IconButton };
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { TooltipSide } from './Tooltip.js';
3
+ /** Infotip text can come from untrusted sources (workflow YAML), so all markup is literal text — only `[text](url)` links and newlines are parsed. */
4
+ export declare function formatInfoTipContent(content: string): ReactNode;
5
+ interface InfoTipProps {
6
+ text: string;
7
+ side?: TooltipSide;
8
+ className?: string | undefined;
9
+ /** Replaces the info icon as the trigger, such as a status label the text explains. */
10
+ children?: ReactNode;
11
+ }
12
+ /** Extra detail behind an info trigger. A popover that also opens on hover, so
13
+ * touch and screen reader users can reach it and its links. */
14
+ export declare function InfoTip({ text, side, className, children }: InfoTipProps): import("react").JSX.Element | null;
15
+ export {};
@@ -0,0 +1,60 @@
1
+ import { HiQuestionMarkCircle } from "../icons/hi/HiQuestionMarkCircle.js";
2
+ import { portalContainer, positionerClassName, tipArrowClassName, tipClassName } from "./floating.js";
3
+ import { keyedByContent } from "./keys.js";
4
+ import { useStrings } from "./Provider.js";
5
+ import { clsx } from "clsx";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Fragment as Fragment$1 } from "react";
8
+ import { Popover } from "@base-ui/react/popover";
9
+ //#region src/components/InfoTip.tsx
10
+ var linkRegex = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g;
11
+ function formatLine(line) {
12
+ const nodes = [];
13
+ let last = 0;
14
+ for (const match of line.matchAll(linkRegex)) {
15
+ if (match.index > last) nodes.push(line.slice(last, match.index));
16
+ nodes.push(/* @__PURE__ */ jsx("a", {
17
+ href: match[2],
18
+ target: "_blank",
19
+ rel: "noopener noreferrer",
20
+ className: "underline",
21
+ children: match[1]
22
+ }, match.index));
23
+ last = match.index + match[0].length;
24
+ }
25
+ if (last < line.length) nodes.push(line.slice(last));
26
+ return nodes;
27
+ }
28
+ /** Infotip text can come from untrusted sources (workflow YAML), so all markup is literal text — only `[text](url)` links and newlines are parsed. */
29
+ function formatInfoTipContent(content) {
30
+ if (!content) return null;
31
+ return keyedByContent(content.split(/<br\s*\/?>|\n/i), (l) => l).map(({ key, item: line }, idx) => /* @__PURE__ */ jsxs(Fragment$1, { children: [idx > 0 && /* @__PURE__ */ jsx("br", {}), formatLine(line)] }, key));
32
+ }
33
+ /** Extra detail behind an info trigger. A popover that also opens on hover, so
34
+ * touch and screen reader users can reach it and its links. */
35
+ function InfoTip({ text, side = "top", className, children }) {
36
+ const t = useStrings().common;
37
+ if (!text) return children ? /* @__PURE__ */ jsx("span", {
38
+ className,
39
+ children
40
+ }) : null;
41
+ return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(Popover.Trigger, {
42
+ openOnHover: true,
43
+ "aria-label": children ? void 0 : t.moreInfo,
44
+ className: clsx("inline-flex items-center cursor-help", !children && "tooltip", className),
45
+ children: children ?? /* @__PURE__ */ jsx(HiQuestionMarkCircle, { "aria-hidden": "true" })
46
+ }), /* @__PURE__ */ jsx(Popover.Portal, {
47
+ container: portalContainer(),
48
+ children: /* @__PURE__ */ jsx(Popover.Positioner, {
49
+ side,
50
+ sideOffset: 8,
51
+ className: positionerClassName,
52
+ children: /* @__PURE__ */ jsxs(Popover.Popup, {
53
+ className: clsx("max-w-sm text-left", tipClassName),
54
+ children: [/* @__PURE__ */ jsx(Popover.Arrow, { className: tipArrowClassName }), formatInfoTipContent(text)]
55
+ })
56
+ })
57
+ })] });
58
+ }
59
+ //#endregion
60
+ export { InfoTip, formatInfoTipContent };
@@ -2,12 +2,12 @@ import { LuEye } from "../icons/lu/LuEye.js";
2
2
  import { LuEyeOff } from "../icons/lu/LuEyeOff.js";
3
3
  import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
4
4
  import { RequiredMark } from "./RequiredMark.js";
5
- import cx from "classnames";
6
- import { forwardRef, useId, useState } from "react";
5
+ import { clsx } from "clsx";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { forwardRef, useId, useState } from "react";
8
8
  //#region src/components/Input.tsx
9
9
  /** The box a text field draws, for other controls that should look like one. */
10
- var fieldBoxClasses = cx("w-full py-3 px-4 bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-lg text-[var(--theme-app)] text-sm transition-all duration-200 box-border", "focus:outline-none focus:border-[var(--theme-element)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--theme-element)_25%,transparent)]", "placeholder:text-[var(--theme-muted-text-color)]");
10
+ var fieldBoxClasses = clsx("w-full py-3 px-4 bg-[var(--theme-muted-panel-bg)] border border-[var(--theme-border)] rounded-lg text-[var(--theme-app)] text-sm transition-all duration-200 box-border", "focus:outline-none focus:border-[var(--theme-element)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--theme-element)_25%,transparent)]", "placeholder:text-[var(--theme-muted-text-color)]");
11
11
  function LabelRow({ id, label, hint, required }) {
12
12
  const element = /* @__PURE__ */ jsxs("label", {
13
13
  className: "text-[0.8125rem] font-medium text-[var(--theme-app)]",
@@ -70,7 +70,7 @@ var Input = forwardRef(({ label, labelHint, description, error, className = "",
70
70
  children: [/* @__PURE__ */ jsx("input", {
71
71
  ref,
72
72
  type: isPassword && showPassword ? "text" : type,
73
- className: cx(fieldBoxClasses, "disabled:bg-[var(--theme-muted-panel-bg)] disabled:text-[var(--theme-muted-text-color)] disabled:cursor-not-allowed disabled:opacity-70", mono && "font-mono text-[0.8125rem]", error && "!border-[#ef4444]", isPassword && "pr-11", className),
73
+ className: clsx(fieldBoxClasses, "disabled:bg-[var(--theme-muted-panel-bg)] disabled:text-[var(--theme-muted-text-color)] disabled:cursor-not-allowed disabled:opacity-70", mono && "font-mono text-[0.8125rem]", error && "!border-[#ef4444]", isPassword && "pr-11", className),
74
74
  ...props,
75
75
  id: field.id,
76
76
  required,
@@ -96,7 +96,7 @@ var Textarea = forwardRef(({ label, labelHint, description, error, className = "
96
96
  }, props.id, props["aria-describedby"], required);
97
97
  return field.frame(/* @__PURE__ */ jsx("textarea", {
98
98
  ref,
99
- className: cx(fieldBoxClasses, "min-h-[140px] resize-y", mono && "font-mono text-[0.8125rem]", error && "!border-[#ef4444]", className),
99
+ className: clsx(fieldBoxClasses, "min-h-[140px] resize-y", mono && "font-mono text-[0.8125rem]", error && "!border-[#ef4444]", className),
100
100
  ...props,
101
101
  id: field.id,
102
102
  required,
@@ -1,11 +1,11 @@
1
- import cx from "classnames";
1
+ import { clsx } from "clsx";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/LetterBadge.tsx
4
4
  /** A compact letter badge ("AI", "PUB", "SSH") used as a type mark in place of
5
5
  * an icon. Size the box and text via className (e.g. "h-5 w-5 text-[8px]"). */
6
6
  function LetterBadge({ text, className }) {
7
7
  return /* @__PURE__ */ jsx("span", {
8
- className: cx("inline-flex shrink-0 items-center justify-center rounded-[3px] border theme-border font-bold leading-none tracking-tight text-(--theme-app)", className),
8
+ className: clsx("inline-flex shrink-0 items-center justify-center rounded-[3px] border theme-border font-bold leading-none tracking-tight text-(--theme-app)", className),
9
9
  children: text
10
10
  });
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import { LoaderIcon } from "./StatusIcons.js";
2
- import cx from "classnames";
2
+ import { clsx } from "clsx";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/Loader.tsx
5
5
  var RIPPLE_STAGGER_S = .22;
@@ -15,9 +15,9 @@ function Loader({ size = 48, text, textSize = 12, full = true, color = "", loade
15
15
  return /* @__PURE__ */ jsxs("div", {
16
16
  role: "status",
17
17
  "aria-label": text || "Loading",
18
- className: cx(full && "w-full", "flex flex-col flex-wrap justify-center items-center gap-y-1"),
18
+ className: clsx(full && "w-full", "flex flex-col flex-wrap justify-center items-center gap-y-1"),
19
19
  children: [/* @__PURE__ */ jsx("div", {
20
- className: cx("w-full flex justify-center items-center", loaderColor),
20
+ className: clsx("w-full flex justify-center items-center", loaderColor),
21
21
  style: loaderStyle,
22
22
  children: variant === "logo" ? /* @__PURE__ */ jsx("svg", {
23
23
  viewBox: "0 0 64.29 64.29",
@@ -1,5 +1,5 @@
1
- import { Suspense, lazy } from "react";
2
1
  import { jsx } from "react/jsx-runtime";
2
+ import { Suspense, lazy } from "react";
3
3
  //#region src/components/Markdown.tsx
4
4
  var MarkdownImpl = lazy(() => import("./MarkdownImpl.js"));
5
5
  function Markdown(props) {
@@ -1,4 +1,4 @@
1
- import cx from "classnames";
1
+ import { clsx } from "clsx";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { code } from "@streamdown/code";
4
4
  import { math } from "@streamdown/math";
@@ -21,7 +21,7 @@ function Markdown({ children, isStreaming, controls }) {
21
21
  shikiTheme,
22
22
  components: { a: ({ node, ...props }) => /* @__PURE__ */ jsx("a", {
23
23
  ...props,
24
- className: cx("link wrap-break-word", props.className),
24
+ className: clsx("link wrap-break-word", props.className),
25
25
  target: "_blank",
26
26
  rel: "noopener noreferrer"
27
27
  }) },
@@ -0,0 +1,33 @@
1
+ import { Menu as BaseMenu } from '@base-ui/react/menu';
2
+ import type { ReactNode } from 'react';
3
+ type Styled<Props> = Omit<Props, 'className'> & {
4
+ className?: string | undefined;
5
+ };
6
+ export interface MenuPopupProps {
7
+ children: ReactNode;
8
+ className?: string | undefined;
9
+ side?: BaseMenu.Positioner.Props['side'];
10
+ align?: BaseMenu.Positioner.Props['align'];
11
+ /** What it opens against in place of its trigger, such as the point a right-click landed. */
12
+ anchor?: BaseMenu.Positioner.Props['anchor'];
13
+ /** Keeps the popup's children mounted while closed, so state they own survives. */
14
+ keepMounted?: boolean;
15
+ }
16
+ /** The portal, positioner and popup every menu needs. */
17
+ export declare function MenuPopup({ children, className, side, align, anchor, keepMounted, }: MenuPopupProps): import("react").JSX.Element;
18
+ export declare function MenuItem({ className, ...props }: Styled<BaseMenu.Item.Props>): import("react").JSX.Element;
19
+ /** A navigation row; give it `render` for a router link. Closes the menu like any item. */
20
+ export declare function MenuLinkItem({ className, ...props }: Styled<BaseMenu.LinkItem.Props>): import("react").JSX.Element;
21
+ /** A choice within a Menu.RadioGroup, checked while it holds the group's value. */
22
+ export declare function MenuRadioItem({ className, children, ...props }: Styled<BaseMenu.RadioItem.Props>): import("react").JSX.Element;
23
+ /** An on/off choice, checked while `checked` holds; it closes the menu like any item. */
24
+ export declare function MenuCheckboxItem({ className, children, ...props }: Styled<BaseMenu.CheckboxItem.Props>): import("react").JSX.Element;
25
+ /** The row that opens a submenu, inside a Menu.SubmenuRoot. */
26
+ export declare function MenuSubmenuTrigger({ className, children, ...props }: Styled<BaseMenu.SubmenuTrigger.Props>): import("react").JSX.Element;
27
+ export declare function MenuSeparator({ className }: {
28
+ className?: string | undefined;
29
+ }): import("react").JSX.Element;
30
+ export declare function MenuGroupLabel({ children }: {
31
+ children: ReactNode;
32
+ }): import("react").JSX.Element;
33
+ export {};
@@ -0,0 +1,86 @@
1
+ import { FaCheck } from "../icons/fa/FaCheck.js";
2
+ import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
3
+ import { panelClassName, panelItemClassName, portalContainer, positionerClassName } from "./floating.js";
4
+ import { Menu } from "@base-ui/react/menu";
5
+ import { clsx } from "clsx";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/Menu.tsx
8
+ var itemClassName = panelItemClassName;
9
+ /** The portal, positioner and popup every menu needs. */
10
+ function MenuPopup({ children, className, side = "bottom", align = "start", anchor, keepMounted = false }) {
11
+ return /* @__PURE__ */ jsx(Menu.Portal, {
12
+ container: portalContainer(),
13
+ keepMounted,
14
+ children: /* @__PURE__ */ jsx(Menu.Positioner, {
15
+ side,
16
+ align,
17
+ anchor,
18
+ sideOffset: 4,
19
+ className: positionerClassName,
20
+ children: /* @__PURE__ */ jsx(Menu.Popup, {
21
+ className: clsx("min-w-44 max-h-(--available-height) overflow-y-auto py-1", panelClassName, className),
22
+ children
23
+ })
24
+ })
25
+ });
26
+ }
27
+ function MenuItem({ className, ...props }) {
28
+ return /* @__PURE__ */ jsx(Menu.Item, {
29
+ ...props,
30
+ className: clsx(itemClassName, className)
31
+ });
32
+ }
33
+ /** A navigation row; give it `render` for a router link. Closes the menu like any item. */
34
+ function MenuLinkItem({ className, ...props }) {
35
+ return /* @__PURE__ */ jsx(Menu.LinkItem, {
36
+ closeOnClick: true,
37
+ ...props,
38
+ className: clsx(itemClassName, className)
39
+ });
40
+ }
41
+ /** A choice within a Menu.RadioGroup, checked while it holds the group's value. */
42
+ function MenuRadioItem({ className, children, ...props }) {
43
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, {
44
+ closeOnClick: true,
45
+ ...props,
46
+ className: clsx(itemClassName, "pl-2", className),
47
+ children: [/* @__PURE__ */ jsx("span", {
48
+ className: "flex w-3.5 shrink-0 justify-center",
49
+ children: /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(FaCheck, { className: "size-3" }) })
50
+ }), children]
51
+ });
52
+ }
53
+ /** An on/off choice, checked while `checked` holds; it closes the menu like any item. */
54
+ function MenuCheckboxItem({ className, children, ...props }) {
55
+ return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
56
+ closeOnClick: true,
57
+ ...props,
58
+ className: clsx(itemClassName, className),
59
+ children: [children, /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, {
60
+ className: "ml-auto",
61
+ children: /* @__PURE__ */ jsx(FaCheck, { className: "size-3.5 opacity-80" })
62
+ })]
63
+ });
64
+ }
65
+ /** The row that opens a submenu, inside a Menu.SubmenuRoot. */
66
+ function MenuSubmenuTrigger({ className, children, ...props }) {
67
+ return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
68
+ ...props,
69
+ className: clsx(itemClassName, "data-popup-open:bg-(--theme-hover)", className),
70
+ children: [/* @__PURE__ */ jsx("span", {
71
+ className: "flex min-w-0 flex-1 items-center gap-2",
72
+ children
73
+ }), /* @__PURE__ */ jsx(LuChevronRight, { className: "size-3 shrink-0 opacity-60" })]
74
+ });
75
+ }
76
+ function MenuSeparator({ className }) {
77
+ return /* @__PURE__ */ jsx(Menu.Separator, { className: clsx("my-1 h-px bg-(--theme-border)", className) });
78
+ }
79
+ function MenuGroupLabel({ children }) {
80
+ return /* @__PURE__ */ jsx(Menu.GroupLabel, {
81
+ className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-(--theme-muted-text-color)",
82
+ children
83
+ });
84
+ }
85
+ //#endregion
86
+ export { MenuCheckboxItem, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioItem, MenuSeparator, MenuSubmenuTrigger };
@@ -0,0 +1,56 @@
1
+ import { type ReactNode } from 'react';
2
+ /** Something a menu row does: navigates with `href`, or runs `onClick`. */
3
+ export interface MenuAction {
4
+ label: string;
5
+ icon?: ReactNode;
6
+ /** Navigates instead of calling onClick. */
7
+ href?: string | undefined;
8
+ /** Loads the page instead of routing, for paths the host's router doesn't serve. */
9
+ reloadDocument?: boolean | undefined;
10
+ onClick?: (() => void) | undefined;
11
+ disabled?: boolean | undefined;
12
+ /** Why the action is disabled, shown on hover and read with its name. */
13
+ disabledReason?: string | undefined;
14
+ destructive?: boolean | undefined;
15
+ /** Makes the row an on/off choice, checked while true. */
16
+ checked?: boolean | undefined;
17
+ /** Text the row copies to the clipboard, confirmed with a toast naming `label`. */
18
+ copy?: {
19
+ text: string;
20
+ label: string;
21
+ } | undefined;
22
+ /** More text a menu's search matches, beside the label. */
23
+ keywords?: string | undefined;
24
+ }
25
+ /** A row that opens a menu of its own. */
26
+ export interface MenuSubmenu {
27
+ label: string;
28
+ icon?: ReactNode;
29
+ items: MenuEntry[];
30
+ search?: MenuSearch | undefined;
31
+ }
32
+ export interface MenuDivider {
33
+ divider: true;
34
+ }
35
+ export type MenuEntry = MenuAction | MenuSubmenu | MenuDivider;
36
+ export declare const menuDivider: MenuDivider;
37
+ /** A field atop a menu that narrows it, submenus included, to the actions it matches. */
38
+ export interface MenuSearch {
39
+ placeholder: string;
40
+ /** Shown when nothing matches. */
41
+ empty: string;
42
+ }
43
+ export declare const isMenuDivider: (entry: MenuEntry) => entry is MenuDivider;
44
+ export declare const isMenuSubmenu: (entry: MenuEntry) => entry is MenuSubmenu;
45
+ /** Gives a menu root its search's filter; `children` renders the root with the query. */
46
+ export declare function MenuFilter({ search, children, }: {
47
+ search: MenuSearch | undefined;
48
+ children: (query: string) => ReactNode;
49
+ }): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
50
+ /** A menu's rows, with its search field when it has one. */
51
+ export declare function MenuEntries({ entries, search, query, }: {
52
+ entries: MenuEntry[];
53
+ search?: MenuSearch | undefined;
54
+ /** The search's text, from the MenuFilter around the menu's root. */
55
+ query?: string;
56
+ }): import("react").JSX.Element;