@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,29 +1,25 @@
1
- import Dropdown from "../components/Dropdown.js";
2
- import cx from "classnames";
1
+ import { Autocomplete } from "../components/Combobox.js";
3
2
  import { jsx } from "react/jsx-runtime";
4
3
  //#region src/graph/SuggestionInput.tsx
5
- function suggestionOptions(suggestions) {
4
+ /** A labelled suggestion shows its meaning, with the value it writes beneath. */
5
+ function suggestionItems(suggestions) {
6
6
  return suggestions.map(({ value, label }) => label ? {
7
- label,
8
7
  value,
8
+ label,
9
9
  description: value
10
- } : value);
10
+ } : {
11
+ value,
12
+ label: value
13
+ });
11
14
  }
12
15
  var FIELD_TEXT_BOX = "py-3 pl-4 rounded-lg text-sm !bg-[var(--theme-muted-panel-bg)]";
13
- /**
14
- * The dropdown for a field that takes any typed value as well as the ones it offers. Any of
15
- * the dropdown's own props can still be passed, such as `allowCustomValue={false}`.
16
- */
17
- function SuggestionInput({ value, onChange, suggestions, allowCustomValue = true, ...props }) {
18
- return /* @__PURE__ */ jsx(Dropdown, {
19
- showCaret: suggestions.length > 0,
16
+ /** A field that takes any typed value, offering `suggestions` as it's typed. */
17
+ function SuggestionInput({ suggestions, ...props }) {
18
+ return /* @__PURE__ */ jsx(Autocomplete, {
20
19
  ...props,
21
- textBoxClassName: cx(FIELD_TEXT_BOX, props.textBoxClassName),
22
- allowCustomValue,
23
- value,
24
- options: suggestionOptions(suggestions),
25
- onChange: (next) => onChange(next === void 0 ? "" : String(next))
20
+ className: FIELD_TEXT_BOX,
21
+ items: suggestionItems(suggestions)
26
22
  });
27
23
  }
28
24
  //#endregion
29
- export { FIELD_TEXT_BOX, SuggestionInput, suggestionOptions };
25
+ export { FIELD_TEXT_BOX, SuggestionInput, suggestionItems };
@@ -1,8 +1,13 @@
1
- import { type ReactNode, type RefObject } from 'react';
2
- /** A toolbar button's panel, drawn over the page so the pane it sits in can't clip it. */
3
- export declare function ToolbarPopover({ anchor, label, onClose, children, }: {
4
- anchor: RefObject<HTMLElement | null>;
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ /** A toolbar button's panel, drawn over the page so the pane it sits in can't clip it.
3
+ * It opens above the button when there's room and below it otherwise, its right edge
4
+ * lined up with the button's. Escape closes it before the graph's own Escape sees the
5
+ * key, and focus goes back to the button. */
6
+ export declare function ToolbarPopover({ trigger, label, open, onOpenChange, children, }: {
7
+ /** The button. It receives the trigger's props and ref, so it must pass them to its element. */
8
+ trigger: ReactElement;
5
9
  label: string;
6
- onClose: () => void;
10
+ open: boolean;
11
+ onOpenChange: (open: boolean) => void;
7
12
  children: ReactNode;
8
- }): import("react").ReactPortal;
13
+ }): import("react").JSX.Element;
@@ -1,71 +1,39 @@
1
- import { useEffect, useLayoutEffect, useRef, useState } from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import { createPortal } from "react-dom";
1
+ import { panelClassName, portalContainer, positionerClassName } from "../components/floating.js";
2
+ import { clsx } from "clsx";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useRef } from "react";
5
+ import { Popover } from "@base-ui/react/popover";
4
6
  //#region src/graph/ToolbarPopover.tsx
5
- var GAP = 8;
6
- var PANEL_WIDTH = 384;
7
- function placeBy(anchor, width) {
8
- const rect = anchor.getBoundingClientRect();
9
- const above = rect.top - 16;
10
- const below = window.innerHeight - rect.bottom - 16;
11
- const right = Math.max(GAP, Math.min(window.innerWidth - rect.right, window.innerWidth - GAP - width));
12
- return above >= below ? {
13
- right,
14
- bottom: window.innerHeight - rect.top + GAP,
15
- maxHeight: above
16
- } : {
17
- right,
18
- top: rect.bottom + GAP,
19
- maxHeight: below
20
- };
21
- }
22
- /** A toolbar button's panel, drawn over the page so the pane it sits in can't clip it. */
23
- function ToolbarPopover({ anchor, label, onClose, children }) {
24
- const panel = useRef(null);
25
- const [place, setPlace] = useState(null);
26
- const close = useRef(onClose);
27
- close.current = onClose;
28
- useLayoutEffect(() => {
29
- const update = () => {
30
- if (anchor.current) setPlace(placeBy(anchor.current, panel.current?.offsetWidth || PANEL_WIDTH));
31
- };
32
- update();
33
- window.addEventListener("resize", update);
34
- window.addEventListener("scroll", update, true);
35
- return () => {
36
- window.removeEventListener("resize", update);
37
- window.removeEventListener("scroll", update, true);
38
- };
39
- }, [anchor]);
40
- useEffect(() => {
41
- panel.current?.focus({ preventScroll: true });
42
- const away = (e) => {
43
- const target = e.target;
44
- if (!panel.current?.contains(target) && !anchor.current?.contains(target)) close.current();
45
- };
46
- const onEscape = (e) => {
47
- if (e.key === "Escape") {
48
- e.stopPropagation();
49
- close.current();
50
- anchor.current?.focus({ preventScroll: true });
51
- }
52
- };
53
- window.addEventListener("pointerdown", away, true);
54
- window.addEventListener("keydown", onEscape, true);
55
- return () => {
56
- window.removeEventListener("pointerdown", away, true);
57
- window.removeEventListener("keydown", onEscape, true);
58
- };
59
- }, [anchor]);
60
- return createPortal(/* @__PURE__ */ jsx("div", {
61
- ref: panel,
62
- role: "dialog",
63
- "aria-label": label,
64
- tabIndex: -1,
65
- className: "fixed z-50 w-96 max-w-[calc(100vw-16px)] overflow-y-auto rounded-md border theme-border bg-(--theme-panel-bg) p-3 text-xs text-(--theme-app) shadow-lg outline-none",
66
- style: place ?? { visibility: "hidden" },
67
- children
68
- }), document.body);
7
+ /** A toolbar button's panel, drawn over the page so the pane it sits in can't clip it.
8
+ * It opens above the button when there's room and below it otherwise, its right edge
9
+ * lined up with the button's. Escape closes it before the graph's own Escape sees the
10
+ * key, and focus goes back to the button. */
11
+ function ToolbarPopover({ trigger, label, open, onOpenChange, children }) {
12
+ const popup = useRef(null);
13
+ return /* @__PURE__ */ jsxs(Popover.Root, {
14
+ open,
15
+ onOpenChange,
16
+ children: [/* @__PURE__ */ jsx(Popover.Trigger, { render: trigger }), /* @__PURE__ */ jsx(Popover.Portal, {
17
+ container: portalContainer(),
18
+ children: /* @__PURE__ */ jsx(Popover.Positioner, {
19
+ side: "top",
20
+ align: "end",
21
+ sideOffset: 8,
22
+ collisionPadding: 8,
23
+ className: positionerClassName,
24
+ children: /* @__PURE__ */ jsx(Popover.Popup, {
25
+ ref: popup,
26
+ "aria-label": label,
27
+ initialFocus: popup,
28
+ className: clsx(panelClassName, "w-96 max-w-[calc(100vw-16px)] max-h-(--available-height) overflow-y-auto p-3"),
29
+ children: /* @__PURE__ */ jsx("div", {
30
+ className: "text-xs",
31
+ children
32
+ })
33
+ })
34
+ })
35
+ })]
36
+ });
69
37
  }
70
38
  //#endregion
71
39
  export { ToolbarPopover };
@@ -1,16 +1,15 @@
1
- import { useRunFile, useSlots, useStrings, useWorkflowEngine } from "../components/Provider.js";
2
1
  import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
3
2
  import { LoaderIcon } from "../components/StatusIcons.js";
3
+ import { useRunFile, useSlots, useStrings, useWorkflowEngine } from "../components/Provider.js";
4
4
  import { Indicator } from "../components/Indicator.js";
5
5
  import { LogViewer } from "../logviewer/LogViewer.js";
6
6
  import { toAbsHumanDuration } from "../duration.js";
7
7
  import { Collapse } from "./Collapse.js";
8
8
  import { jobLabel, toggled } from "./util.js";
9
- import cx from "classnames";
10
- import { useCallback, useId, useMemo, useState } from "react";
9
+ import { clsx } from "clsx";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { useCallback, useId, useMemo, useState } from "react";
12
12
  import { DateTime } from "luxon";
13
- import { AnimatePresence, motion } from "framer-motion";
14
13
  //#region src/graph/TreeView.tsx
15
14
  function elapsed({ startedAt, completedAt }) {
16
15
  if (!startedAt) return "";
@@ -18,11 +17,9 @@ function elapsed({ startedAt, completedAt }) {
18
17
  return toAbsHumanDuration(DateTime.fromISO(startedAt), end);
19
18
  }
20
19
  function Chevron({ open, hidden = false }) {
21
- return /* @__PURE__ */ jsx(motion.div, {
22
- animate: { rotate: open ? 90 : 0 },
23
- transition: { duration: .15 },
24
- className: cx("flex-shrink-0", hidden ? "invisible" : "text-[var(--theme-muted-text-color)]"),
25
- children: /* @__PURE__ */ jsx(LuChevronRight, { className: cx("w-4 h-4", open && "text-[var(--theme-element)]") })
20
+ return /* @__PURE__ */ jsx("div", {
21
+ className: clsx("flex-shrink-0 transition-transform duration-150", open && "rotate-90", hidden ? "invisible" : "text-[var(--theme-muted-text-color)]"),
22
+ children: /* @__PURE__ */ jsx(LuChevronRight, { className: clsx("w-4 h-4", open && "text-[var(--theme-element)]") })
26
23
  });
27
24
  }
28
25
  function StepLogs({ slug, prefix, jobName, stepIndex }) {
@@ -59,7 +56,7 @@ function JobRow({ jobName, job, isExpanded, onToggle, prefix, state }) {
59
56
  type: "button",
60
57
  "aria-expanded": isExpanded,
61
58
  "aria-controls": hasSteps ? panelId : void 0,
62
- className: cx("flex items-center gap-3 px-5 py-3 transition-colors w-full text-left", job.status === "skipped" || job.status === "skipped-failed" ? "cursor-default" : "cursor-pointer", isExpanded && "bg-[var(--theme-panel-bg)]"),
59
+ className: clsx("flex items-center gap-3 px-5 py-3 transition-colors w-full text-left", job.status === "skipped" || job.status === "skipped-failed" ? "cursor-default" : "cursor-pointer", isExpanded && "bg-[var(--theme-panel-bg)]"),
63
60
  onClick: onToggle,
64
61
  children: [
65
62
  /* @__PURE__ */ jsx(Chevron, {
@@ -125,7 +122,7 @@ function StepRow({ step, index, isExpanded, onToggle, prefix, jobName, state })
125
122
  type: "button",
126
123
  "aria-expanded": isExpanded,
127
124
  "aria-controls": panelId,
128
- className: cx("flex items-center gap-3 px-5 py-2.5 cursor-pointer transition-colors w-full text-left", isExpanded ? "" : "hover:bg-[var(--theme-hover)]"),
125
+ className: clsx("flex items-center gap-3 px-5 py-2.5 cursor-pointer transition-colors w-full text-left", isExpanded ? "" : "hover:bg-[var(--theme-hover)]"),
129
126
  onClick: onToggle,
130
127
  children: [
131
128
  /* @__PURE__ */ jsx(Chevron, { open: isExpanded }),
@@ -279,34 +276,24 @@ function TreeView({ jobs, slug, expandedJobs, setExpandedJobs }) {
279
276
  ]
280
277
  })
281
278
  ]
282
- }), /* @__PURE__ */ jsx(AnimatePresence, { children: isGroupExpanded && /* @__PURE__ */ jsx(motion.div, {
283
- initial: {
284
- height: 0,
285
- opacity: 0
286
- },
287
- animate: {
288
- height: "auto",
289
- opacity: 1
290
- },
291
- exit: {
292
- height: 0,
293
- opacity: 0
294
- },
295
- transition: { duration: .15 },
296
- className: "overflow-hidden pl-4",
279
+ }), /* @__PURE__ */ jsx(Collapse, {
280
+ expanded: isGroupExpanded,
297
281
  id: `matrix-panel-${matrixOrigin}`,
298
- children: group.members.map((memberName) => {
299
- const member = jobs[memberName];
300
- return member ? /* @__PURE__ */ jsx(JobRow, {
301
- jobName: memberName,
302
- job: member,
303
- isExpanded: expandedJobs.has(memberName),
304
- onToggle: () => toggleJob(memberName),
305
- prefix: "",
306
- state: rowState
307
- }, memberName) : null;
282
+ children: /* @__PURE__ */ jsx("div", {
283
+ className: "pl-4",
284
+ children: group.members.map((memberName) => {
285
+ const member = jobs[memberName];
286
+ return member ? /* @__PURE__ */ jsx(JobRow, {
287
+ jobName: memberName,
288
+ job: member,
289
+ isExpanded: expandedJobs.has(memberName),
290
+ onToggle: () => toggleJob(memberName),
291
+ prefix: "",
292
+ state: rowState
293
+ }, memberName) : null;
294
+ })
308
295
  })
309
- }) })]
296
+ })]
310
297
  }, `matrix-${matrixOrigin}`));
311
298
  } else rendered.push(/* @__PURE__ */ jsx(JobRow, {
312
299
  jobName,
@@ -1,5 +1,5 @@
1
- import { useWorkflowEditing } from "../components/Provider.js";
2
1
  import { IoMdClose } from "../icons/io/IoMdClose.js";
2
+ import { useWorkflowEditing } from "../components/Provider.js";
3
3
  import { IconButton } from "../components/IconButton.js";
4
4
  import { Input } from "../components/Input.js";
5
5
  import { useGraphEditorStrings, useInputsEditorStrings } from "./editorStrings.js";
@@ -11,8 +11,8 @@ import { expressionRefs } from "./expressionRefs.js";
11
11
  import { useNewInputs } from "./InputDialog.js";
12
12
  import { useSettingsViews } from "./GraphEditorDialogs.js";
13
13
  import { firstPageEdits, pagesBackEdits } from "./inputPages.js";
14
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
15
  import { useState } from "react";
15
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
16
16
  //#region src/graph/WorkflowSettingsDialog.tsx
17
17
  var LINK_NAME = /^[a-z0-9_-]*[a-z0-9]$/;
18
18
  var ORG_VARIABLE = /^[A-Z][A-Z0-9_]*$/;
@@ -331,7 +331,7 @@ function SettingsForm({ workflow, onEdit, onClose, renderShell, onDraft, pending
331
331
  ] : wizardOn && flatten !== (wizard["flatten"] !== false) ? [...settings, ...reflattenEdits(inputs, wizardEdit)] : [update];
332
332
  const saveEdit = newInputs.save(dirty ? editing.batchOf(edits) : null);
333
333
  onDraft?.(saveEdit, invalid);
334
- const children = /* @__PURE__ */ jsxs(Fragment$1, { children: [
334
+ const children = /* @__PURE__ */ jsxs(Fragment, { children: [
335
335
  newInputs.dialog,
336
336
  /* @__PURE__ */ jsxs(Section, {
337
337
  title: t.sectionGeneral,
@@ -622,7 +622,7 @@ function SettingsForm({ workflow, onEdit, onClose, renderShell, onDraft, pending
622
622
  }
623
623
  })
624
624
  }),
625
- wizardOn && /* @__PURE__ */ jsxs(Fragment$1, { children: [
625
+ wizardOn && /* @__PURE__ */ jsxs(Fragment, { children: [
626
626
  WIZARD_FLAGS.map((flag) => /* @__PURE__ */ jsx(FlagField, {
627
627
  label: t.fields[flag],
628
628
  yamlKey: flag,
@@ -1,18 +1,18 @@
1
1
  import { BiRedo } from "../icons/bi/BiRedo.js";
2
2
  import { BiUndo } from "../icons/bi/BiUndo.js";
3
3
  import { IoSettingsOutline } from "../icons/io5/IoSettingsOutline.js";
4
- import { TOOLTIP_ID } from "../components/Tooltip.js";
4
+ import { Tooltip } from "../components/Tooltip.js";
5
5
  import { IconButton } from "../components/IconButton.js";
6
6
  import { useGraphEditorStrings } from "./editorStrings.js";
7
7
  import { ProblemsButton } from "./ProblemsButton.js";
8
8
  import { ShortcutsButton } from "./ShortcutsButton.js";
9
- import cx from "classnames";
9
+ import { clsx } from "clsx";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/graph/editorChrome.tsx
12
12
  /** What a drag carries, beside the pointer at `at` in its layer's coordinates. */
13
13
  function DragLabel({ at, text, refused = false }) {
14
14
  return /* @__PURE__ */ jsx("div", {
15
- className: cx("pointer-events-none absolute z-30 rounded-md border bg-(--theme-panel-bg) px-2 py-1 text-xs shadow", refused ? "border-(--theme-error) text-(--theme-error)" : "theme-border"),
15
+ className: clsx("pointer-events-none absolute z-30 rounded-md border bg-(--theme-panel-bg) px-2 py-1 text-xs shadow", refused ? "border-(--theme-error) text-(--theme-error)" : "theme-border"),
16
16
  style: {
17
17
  left: at.x + 12,
18
18
  top: at.y + 12
@@ -25,21 +25,22 @@ function BarDivider() {
25
25
  }
26
26
  /** A toolbar chip that adds something: click to add it, or, given `onPointerDown`, drag it to where it goes. */
27
27
  function AddChip({ icon, label, hint, className, onPointerDown, onClick }) {
28
- return /* @__PURE__ */ jsxs("button", {
29
- type: "button",
30
- className: cx("flex h-7 items-center gap-1 whitespace-nowrap rounded px-2 text-xs theme-hover", onPointerDown ? "cursor-grab" : "cursor-pointer", className),
31
- "data-tooltip-id": TOOLTIP_ID,
32
- "data-tooltip-content": hint,
33
- onPointerDown,
34
- onClick,
35
- children: [icon, label]
28
+ return /* @__PURE__ */ jsx(Tooltip, {
29
+ content: hint,
30
+ children: /* @__PURE__ */ jsxs("button", {
31
+ type: "button",
32
+ className: clsx("flex h-7 items-center gap-1 whitespace-nowrap rounded px-2 text-xs theme-hover", onPointerDown ? "cursor-grab" : "cursor-pointer", className),
33
+ onPointerDown,
34
+ onClick,
35
+ children: [icon, label]
36
+ })
36
37
  });
37
38
  }
38
39
  /** The bar both editors draw: problems, undo and redo, the editor's own controls, settings, shortcuts. */
39
40
  function EditorBar({ editor, groups, className, children }) {
40
41
  const t = useGraphEditorStrings();
41
42
  return /* @__PURE__ */ jsxs("div", {
42
- className: cx("flex max-w-full flex-wrap items-center justify-end gap-0.5 rounded-md border theme-border bg-(--theme-panel-bg) p-0.5", className),
43
+ className: clsx("flex max-w-full flex-wrap items-center justify-end gap-0.5 rounded-md border theme-border bg-(--theme-panel-bg) p-0.5", className),
43
44
  children: [
44
45
  !!editor.listedProblems?.length && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ProblemsButton, { problems: editor.listedProblems }), /* @__PURE__ */ jsx(BarDivider, {})] }),
45
46
  /* @__PURE__ */ jsx(IconButton, {
@@ -3,21 +3,21 @@ import { IoMdClose } from "../icons/io/IoMdClose.js";
3
3
  import { LuBraces } from "../icons/lu/LuBraces.js";
4
4
  import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
5
5
  import { withPositionKeys } from "../components/keys.js";
6
- import { TOOLTIP_ID } from "../components/Tooltip.js";
7
- import { BareModal, modalPanelClasses } from "../components/BareModal.js";
6
+ import { Tooltip } from "../components/Tooltip.js";
8
7
  import { Button } from "../components/Button.js";
9
8
  import { ghostButtonClasses, primaryButtonClasses } from "../components/ghostButton.js";
9
+ import { Modal, ModalTitle } from "../components/Modal.js";
10
+ import { Switch } from "../components/Switch.js";
10
11
  import { FilterPill } from "../components/FilterPill.js";
11
12
  import { IconButton } from "../components/IconButton.js";
12
13
  import { Input, Textarea } from "../components/Input.js";
13
- import { Toggle } from "../components/Toggle.js";
14
14
  import { useGraphEditorStrings } from "./editorStrings.js";
15
15
  import { asRecord } from "./records.js";
16
16
  import { useFieldLint } from "./fieldProblems.js";
17
17
  import { SuggestionInput } from "./SuggestionInput.js";
18
- import cx from "classnames";
19
- import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
18
+ import { clsx } from "clsx";
20
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
+ import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
21
21
  //#region src/graph/editorFields.tsx
22
22
  var EXPRESSION = /^\$\{\{.*\}\}$/;
23
23
  var ENV_KEY = /^[a-zA-Z0-9_]+$/;
@@ -265,10 +265,10 @@ function ToggleField({ label, yamlKey, description, checked, onChange, disabled
265
265
  label,
266
266
  yamlKey,
267
267
  description
268
- }), /* @__PURE__ */ jsx(Toggle, {
268
+ }), /* @__PURE__ */ jsx(Switch, {
269
269
  checked,
270
- onChange,
271
- label,
270
+ onCheckedChange: onChange,
271
+ "aria-label": label,
272
272
  ...disabled ? { disabled } : {}
273
273
  })]
274
274
  });
@@ -351,11 +351,11 @@ function KeyValueRow({ row, onChange, onRemove, keyPlaceholder, valuePlaceholder
351
351
  title: row.nested ? t.jsonValue : void 0,
352
352
  children: /* @__PURE__ */ jsx(SuggestionInput, {
353
353
  id,
354
- ariaLabel: t.value,
354
+ "aria-label": t.value,
355
355
  placeholder: valuePlaceholder,
356
356
  value: row.value,
357
357
  suggestions: valueSuggestions.map((value) => ({ value })),
358
- onChange: (value) => onChange({
358
+ onValueChange: (value) => onChange({
359
359
  ...row,
360
360
  value
361
361
  })
@@ -392,11 +392,11 @@ function StringListEditor({ label, values, onChange, addLabel, placeholder, erro
392
392
  children: [/* @__PURE__ */ jsx("div", {
393
393
  className: "flex-1",
394
394
  children: /* @__PURE__ */ jsx(SuggestionInput, {
395
- ariaLabel: t.listItem(label, i + 1),
395
+ "aria-label": t.listItem(label, i + 1),
396
396
  value,
397
397
  placeholder,
398
398
  suggestions: suggestions.map((option) => ({ value: option })),
399
- onChange: (next) => onChange(updateAt(values, i, next))
399
+ onValueChange: (next) => onChange(updateAt(values, i, next))
400
400
  })
401
401
  }), /* @__PURE__ */ jsx(IconButton, {
402
402
  icon: /* @__PURE__ */ jsx(IoMdClose, { className: "h-4 w-4" }),
@@ -430,7 +430,7 @@ function SuggestedInput({ label, yamlKey, description, value, onChange, suggesti
430
430
  value,
431
431
  placeholder,
432
432
  suggestions: suggestions.map((option) => ({ value: option })),
433
- onChange
433
+ onValueChange: onChange
434
434
  }),
435
435
  /* @__PURE__ */ jsx(FieldError, { message: error ?? lint.message }),
436
436
  lint.fixes
@@ -468,16 +468,17 @@ function openOnAddOf(editor) {
468
468
  }
469
469
  function OpenOnAddSwitch({ open, onChange }) {
470
470
  const t = useGraphEditorStrings();
471
- return /* @__PURE__ */ jsxs("label", {
472
- className: "flex cursor-pointer items-center gap-2 text-xs theme-muted-text",
473
- "data-tooltip-id": TOOLTIP_ID,
474
- "data-tooltip-content": t.openOnAddHelp,
475
- children: [/* @__PURE__ */ jsx("input", {
476
- type: "checkbox",
477
- className: "h-4 w-4 cursor-pointer accent-(--theme-element)",
478
- checked: open,
479
- onChange: (e) => onChange(e.target.checked)
480
- }), t.openOnAdd]
471
+ return /* @__PURE__ */ jsx(Tooltip, {
472
+ content: t.openOnAddHelp,
473
+ children: /* @__PURE__ */ jsxs("label", {
474
+ className: "flex cursor-pointer items-center gap-2 text-xs theme-muted-text",
475
+ children: [/* @__PURE__ */ jsx("input", {
476
+ type: "checkbox",
477
+ className: "h-4 w-4 cursor-pointer accent-(--theme-element)",
478
+ checked: open,
479
+ onChange: (e) => onChange(e.target.checked)
480
+ }), t.openOnAdd]
481
+ })
481
482
  });
482
483
  }
483
484
  function DialogShell({ title, onClose, onSubmit, saveDisabled, dirty, locked = false, footerStart, headerEnd, openOnAdd, children }) {
@@ -485,19 +486,18 @@ function DialogShell({ title, onClose, onSubmit, saveDisabled, dirty, locked = f
485
486
  const submit = () => {
486
487
  if (!saveDisabled) onSubmit();
487
488
  };
488
- return /* @__PURE__ */ jsx(BareModal, {
489
+ return /* @__PURE__ */ jsx(Modal, {
489
490
  open: true,
490
491
  onClose,
491
- ariaLabel: title,
492
492
  align: "center",
493
- preventClose: dirty || locked,
494
- className: cx(modalPanelClasses, "flex max-h-[85vh] w-full max-w-2xl flex-col"),
493
+ dismissible: !dirty && !locked,
494
+ className: "flex max-h-[85vh] w-full max-w-2xl flex-col",
495
495
  children: /* @__PURE__ */ jsxs("div", {
496
496
  className: "flex min-h-0 flex-col",
497
497
  children: [
498
498
  /* @__PURE__ */ jsxs("div", {
499
499
  className: "flex items-center gap-3 border-b theme-border px-5 py-4",
500
- children: [/* @__PURE__ */ jsx("div", {
500
+ children: [/* @__PURE__ */ jsx(ModalTitle, {
501
501
  className: "flex-1 text-[1rem] font-semibold",
502
502
  children: title
503
503
  }), headerEnd]
@@ -522,7 +522,7 @@ function DialogShell({ title, onClose, onSubmit, saveDisabled, dirty, locked = f
522
522
  type: "button",
523
523
  disabled: saveDisabled,
524
524
  onClick: submit,
525
- className: cx(primaryButtonClasses, "disabled:cursor-not-allowed disabled:opacity-50"),
525
+ className: clsx(primaryButtonClasses, "disabled:cursor-not-allowed disabled:opacity-50"),
526
526
  children: t.save
527
527
  })
528
528
  ]
@@ -1,4 +1,4 @@
1
- import type { OpenMenu } from '../list/RowContextMenu.js';
1
+ import type { OpenMenu } from '../components/ContextMenu.js';
2
2
  export interface Point {
3
3
  x: number;
4
4
  y: number;
@@ -1,6 +1,6 @@
1
- import cx from "classnames";
2
- import { useEffect, useRef, useSyncExternalStore } from "react";
1
+ import { clsx } from "clsx";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useSyncExternalStore } from "react";
4
4
  //#region src/graph/editorPrimitives.tsx
5
5
  /** A small store for an editor's view state, so a change redraws only what reads it. */
6
6
  function createStore(initial) {
@@ -51,10 +51,13 @@ function useFocusAfterDialog(store, container) {
51
51
  }
52
52
  /** `openMenu` whose menus reclaim focus for the editor when they close. */
53
53
  function returningFocus(openMenu, container) {
54
- return (x, y, items, onClose, search) => openMenu(x, y, items, () => {
55
- onClose?.();
56
- reclaimFocus(container());
57
- }, search);
54
+ return (at, items, options) => openMenu(at, items, {
55
+ ...options,
56
+ onClose: () => {
57
+ options?.onClose?.();
58
+ reclaimFocus(container());
59
+ }
60
+ });
58
61
  }
59
62
  var DRAG_THRESHOLD = 4;
60
63
  function suppressNextClick() {
@@ -120,7 +123,7 @@ function place(box) {
120
123
  /** The box a shift + drag draws, in its layer's coordinates. */
121
124
  function MarqueeBox({ box, className }) {
122
125
  return /* @__PURE__ */ jsx("div", {
123
- className: cx("absolute rounded-md border-2 border-dashed border-(--theme-element) bg-(--theme-element)/10", className),
126
+ className: clsx("absolute rounded-md border-2 border-dashed border-(--theme-element) bg-(--theme-element)/10", className),
124
127
  style: place(box)
125
128
  });
126
129
  }