@parallelworks/ui 0.77.0 → 0.78.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 (262) hide show
  1. package/README.md +30 -5
  2. package/dist/access/AccessDrawer.d.ts +28 -7
  3. package/dist/access/AccessDrawer.js +216 -35
  4. package/dist/access/AccessList.d.ts +19 -1
  5. package/dist/access/AccessList.js +220 -9
  6. package/dist/access/GrantView.d.ts +3 -1
  7. package/dist/access/GrantView.js +17 -4
  8. package/dist/access/PrincipalPicker.js +5 -5
  9. package/dist/access/focus.js +1 -1
  10. package/dist/access/index.d.ts +2 -2
  11. package/dist/access/index.js +2 -2
  12. package/dist/access/strings.d.ts +18 -0
  13. package/dist/access/strings.js +20 -2
  14. package/dist/access/types.d.ts +26 -0
  15. package/dist/ai/components/AllocationSelector.js +1 -1
  16. package/dist/ai/components/AttachmentManager.js +5 -5
  17. package/dist/ai/components/AttachmentUpload.js +2 -2
  18. package/dist/ai/components/BranchNavigator.js +1 -1
  19. package/dist/ai/components/ChatActivity.js +1 -1
  20. package/dist/ai/components/ChatEmptyState.js +3 -3
  21. package/dist/ai/components/ChatInput.js +3 -5
  22. package/dist/ai/components/ChatLayout.js +1 -1
  23. package/dist/ai/components/ChatMessage.js +1 -1
  24. package/dist/ai/components/ChatMessageList.js +2 -2
  25. package/dist/ai/components/ChatSidebar.js +3 -3
  26. package/dist/ai/components/ChatThread.js +4 -4
  27. package/dist/ai/components/ComposerAddMenu.js +9 -20
  28. package/dist/ai/components/ModelSelector.js +3 -3
  29. package/dist/ai/components/PastedText.js +5 -5
  30. package/dist/ai/components/SessionView.js +1 -1
  31. package/dist/ai/components/ShareDialog.js +3 -3
  32. package/dist/ai/components/SlashMenu.d.ts +31 -4
  33. package/dist/ai/components/SlashMenu.js +36 -63
  34. package/dist/ai/components/agent/ActivityLine.js +1 -1
  35. package/dist/ai/components/agent/AgentMessageParts.js +13 -13
  36. package/dist/ai/components/conversationActions.js +3 -3
  37. package/dist/ai/core/ChatProvider.js +1 -1
  38. package/dist/ai/core/config.js +1 -1
  39. package/dist/ai/ui/ConversationSidebar.js +3 -3
  40. package/dist/ai/ui/sidebar.js +3 -3
  41. package/dist/assets/yaml.worker-DOBV2lND.js +884 -0
  42. package/dist/components/ActionMenu.d.ts +38 -9
  43. package/dist/components/ActionMenu.js +48 -22
  44. package/dist/components/Avatar.d.ts +66 -6
  45. package/dist/components/Avatar.js +130 -18
  46. package/dist/components/Breadcrumbs.d.ts +4 -0
  47. package/dist/components/Breadcrumbs.js +26 -10
  48. package/dist/components/Button.d.ts +3 -2
  49. package/dist/components/Button.js +11 -1
  50. package/dist/components/Callout.d.ts +3 -2
  51. package/dist/components/Callout.js +3 -2
  52. package/dist/components/Card.d.ts +33 -9
  53. package/dist/components/Card.js +24 -8
  54. package/dist/components/Checkbox.d.ts +3 -1
  55. package/dist/components/Checkbox.js +4 -2
  56. package/dist/components/ColorInput.js +1 -1
  57. package/dist/components/Combobox.d.ts +23 -0
  58. package/dist/components/Combobox.js +252 -86
  59. package/dist/components/ConfirmModal.d.ts +26 -2
  60. package/dist/components/ConfirmModal.js +81 -15
  61. package/dist/components/ContextMenu.d.ts +29 -2
  62. package/dist/components/ContextMenu.js +60 -8
  63. package/dist/components/CopyButton.d.ts +21 -8
  64. package/dist/components/CopyButton.js +29 -9
  65. package/dist/components/CreateModal.d.ts +16 -4
  66. package/dist/components/CreateModal.js +27 -16
  67. package/dist/components/DatePicker.d.ts +31 -1
  68. package/dist/components/DatePicker.js +178 -47
  69. package/dist/components/DescriptionList.d.ts +13 -3
  70. package/dist/components/DescriptionList.js +43 -11
  71. package/dist/components/Disclosure.d.ts +10 -2
  72. package/dist/components/Disclosure.js +18 -7
  73. package/dist/components/Drawer.js +5 -5
  74. package/dist/components/EmptyState.d.ts +12 -4
  75. package/dist/components/EmptyState.js +18 -10
  76. package/dist/components/ErrorPage.d.ts +40 -0
  77. package/dist/components/ErrorPage.js +101 -0
  78. package/dist/components/ExternalLink.d.ts +4 -1
  79. package/dist/components/ExternalLink.js +4 -5
  80. package/dist/components/Field.d.ts +21 -6
  81. package/dist/components/Field.js +32 -16
  82. package/dist/components/FileButton.d.ts +19 -0
  83. package/dist/components/FileButton.js +32 -0
  84. package/dist/components/HoverCard.d.ts +26 -6
  85. package/dist/components/HoverCard.js +11 -5
  86. package/dist/components/IconButton.js +4 -2
  87. package/dist/components/InfoTip.js +3 -3
  88. package/dist/components/Input.d.ts +33 -3
  89. package/dist/components/Input.js +149 -14
  90. package/dist/components/Kbd.d.ts +40 -0
  91. package/dist/components/Kbd.js +168 -0
  92. package/dist/components/Listbox.d.ts +103 -0
  93. package/dist/components/Listbox.js +190 -0
  94. package/dist/components/Loader.d.ts +8 -2
  95. package/dist/components/Loader.js +16 -1
  96. package/dist/components/Markdown.js +1 -1
  97. package/dist/components/MarkdownImpl.js +1 -1
  98. package/dist/components/Menu.d.ts +20 -2
  99. package/dist/components/Menu.js +48 -19
  100. package/dist/components/MenuEntries.d.ts +38 -2
  101. package/dist/components/MenuEntries.js +266 -39
  102. package/dist/components/Meter.d.ts +50 -11
  103. package/dist/components/Meter.js +71 -21
  104. package/dist/components/Modal.d.ts +9 -3
  105. package/dist/components/Modal.js +68 -29
  106. package/dist/components/OneTimeCodeInput.js +1 -1
  107. package/dist/components/PageHeader.js +111 -7
  108. package/dist/components/PageHeaderAction.d.ts +8 -3
  109. package/dist/components/PageHeaderAction.js +122 -34
  110. package/dist/components/Pagination.d.ts +13 -1
  111. package/dist/components/Pagination.js +90 -19
  112. package/dist/components/Popover.d.ts +13 -2
  113. package/dist/components/Popover.js +20 -21
  114. package/dist/components/Provider.d.ts +140 -3
  115. package/dist/components/Provider.js +142 -12
  116. package/dist/components/RefreshButton.d.ts +13 -6
  117. package/dist/components/RefreshButton.js +17 -9
  118. package/dist/components/RunStatusIcon.d.ts +16 -7
  119. package/dist/components/RunStatusIcon.js +21 -8
  120. package/dist/components/Section.d.ts +11 -4
  121. package/dist/components/Section.js +33 -22
  122. package/dist/components/SegmentedControl.d.ts +16 -3
  123. package/dist/components/SegmentedControl.js +7 -3
  124. package/dist/components/Select.d.ts +19 -3
  125. package/dist/components/Select.js +114 -68
  126. package/dist/components/SelectionCopy.d.ts +10 -0
  127. package/dist/components/SelectionCopy.js +105 -0
  128. package/dist/components/SettingModeOption.js +1 -1
  129. package/dist/components/SettingsCard.js +1 -1
  130. package/dist/components/Skeleton.js +1 -1
  131. package/dist/components/StatusBadge.d.ts +55 -10
  132. package/dist/components/StatusBadge.js +91 -15
  133. package/dist/components/StickyBar.js +1 -1
  134. package/dist/components/Table.d.ts +22 -4
  135. package/dist/components/Table.js +46 -24
  136. package/dist/components/Tabs.d.ts +9 -4
  137. package/dist/components/Tabs.js +9 -4
  138. package/dist/components/Tag.d.ts +49 -0
  139. package/dist/components/Tag.js +199 -0
  140. package/dist/components/ThemeEditor.js +1 -1
  141. package/dist/components/Toast.js +1 -1
  142. package/dist/components/ToggleGroup.d.ts +4 -1
  143. package/dist/components/ToggleGroup.js +30 -13
  144. package/dist/components/Tooltip.d.ts +9 -3
  145. package/dist/components/Tooltip.js +55 -39
  146. package/dist/components/buttonClasses.d.ts +5 -2
  147. package/dist/components/buttonClasses.js +11 -10
  148. package/dist/components/chart.d.ts +69 -0
  149. package/dist/components/chart.js +145 -0
  150. package/dist/components/comboboxItems.d.ts +7 -1
  151. package/dist/components/comboboxItems.js +6 -2
  152. package/dist/components/dismiss.d.ts +5 -1
  153. package/dist/components/dismiss.js +6 -2
  154. package/dist/components/floating.d.ts +4 -4
  155. package/dist/components/floating.js +5 -5
  156. package/dist/components/headerActionsFit.d.ts +37 -0
  157. package/dist/components/headerActionsFit.js +81 -0
  158. package/dist/components/pageHeaderStore.d.ts +3 -0
  159. package/dist/components/pageHeaderStore.js +3 -0
  160. package/dist/components/pathBreaks.js +2 -2
  161. package/dist/components/popupContainer.d.ts +17 -0
  162. package/dist/components/popupContainer.js +69 -0
  163. package/dist/components/relativeTime.d.ts +21 -10
  164. package/dist/components/relativeTime.js +50 -22
  165. package/dist/components/segmented.d.ts +18 -4
  166. package/dist/components/segmented.js +48 -6
  167. package/dist/components/typedDate.d.ts +5 -0
  168. package/dist/components/typedDate.js +50 -0
  169. package/dist/components/useClosingValue.d.ts +4 -0
  170. package/dist/components/useClosingValue.js +12 -0
  171. package/dist/components/useCopy.d.ts +6 -0
  172. package/dist/components/useCopy.js +3 -3
  173. package/dist/components/useNarrow.d.ts +2 -0
  174. package/dist/components/useNarrow.js +16 -0
  175. package/dist/editor/Editor.js +1 -1
  176. package/dist/editor/FormCodePanel.js +1 -1
  177. package/dist/editor/Monaco.js +1 -1
  178. package/dist/editor/workers.js +1 -1
  179. package/dist/file-explorer/FileExplorer.js +16 -15
  180. package/dist/file-explorer/FileExplorerContext.js +2 -2
  181. package/dist/file-explorer/FilePreview/Viewer.js +3 -3
  182. package/dist/file-explorer/FilePreview/index.js +2 -2
  183. package/dist/file-explorer/FileRowsWindow.js +3 -3
  184. package/dist/file-explorer/FileTable.js +1 -1
  185. package/dist/file-explorer/LoadMoreRow.js +1 -1
  186. package/dist/file-explorer/TreeView.js +5 -5
  187. package/dist/file-explorer/helpers.js +2 -2
  188. package/dist/file-explorer/toasts.js +2 -2
  189. package/dist/form/Fields/CheckboxGroupField.js +1 -1
  190. package/dist/form/Fields/DropdownField.js +1 -1
  191. package/dist/form/Fields/DurationField.js +2 -2
  192. package/dist/form/Fields/MultiDropdownField.js +1 -1
  193. package/dist/form/Fields/NumberField.js +1 -1
  194. package/dist/form/Fields/ObjectField.js +1 -1
  195. package/dist/form/Fields/RangeField.js +1 -1
  196. package/dist/form/Fields/StringField.js +1 -1
  197. package/dist/form/Form.js +3 -3
  198. package/dist/form/FormLayout.js +1 -1
  199. package/dist/form/Wizard/WizardContainer.js +1 -1
  200. package/dist/form/Wizard/WizardNavigation.js +1 -1
  201. package/dist/form/Wizard/WizardStepContent.js +1 -1
  202. package/dist/form/fieldRegistry.js +1 -1
  203. package/dist/form/formEditing.js +1 -1
  204. package/dist/format.d.ts +17 -7
  205. package/dist/format.js +39 -16
  206. package/dist/graph/AnnotationBanner.js +2 -2
  207. package/dist/graph/Connectors.js +5 -5
  208. package/dist/graph/DependencyGraph.js +10 -9
  209. package/dist/graph/GraphEditor.js +4 -4
  210. package/dist/graph/GraphEditorDialogs.js +13 -12
  211. package/dist/graph/GraphNode.js +1 -1
  212. package/dist/graph/InputDialog.js +5 -5
  213. package/dist/graph/InputsEditor.js +7 -7
  214. package/dist/graph/MatrixGroup.js +2 -2
  215. package/dist/graph/ProblemsButton.js +3 -3
  216. package/dist/graph/Reveal.js +1 -1
  217. package/dist/graph/RunWarningsList.js +1 -1
  218. package/dist/graph/ShortcutsButton.js +25 -8
  219. package/dist/graph/StepSummaries.js +1 -1
  220. package/dist/graph/TreeView.js +2 -2
  221. package/dist/graph/WorkflowSettingsDialog.js +3 -3
  222. package/dist/graph/editorFields.js +3 -3
  223. package/dist/graph/editorPrimitives.js +1 -1
  224. package/dist/graph/editorRows.js +5 -5
  225. package/dist/graph/fieldProblems.js +2 -2
  226. package/dist/graph/inputRefs.js +7 -6
  227. package/dist/graph/stepWith.js +2 -2
  228. package/dist/index.d.ts +30 -21
  229. package/dist/index.js +20 -12
  230. package/dist/list/ActionToolbar.d.ts +4 -0
  231. package/dist/list/ActionToolbar.js +35 -12
  232. package/dist/list/ListFilterBar.d.ts +42 -0
  233. package/dist/list/ListFilterBar.js +789 -0
  234. package/dist/list/ListPage.d.ts +42 -4
  235. package/dist/list/ListPage.js +56 -22
  236. package/dist/list/ListTable.d.ts +27 -3
  237. package/dist/list/ListTable.js +48 -23
  238. package/dist/list/ListToolbar.d.ts +31 -0
  239. package/dist/list/ListToolbar.js +43 -0
  240. package/dist/list/ListViewControls.d.ts +8 -4
  241. package/dist/list/ListViewControls.js +22 -14
  242. package/dist/list/UserHoverCard.d.ts +8 -2
  243. package/dist/list/UserHoverCard.js +26 -13
  244. package/dist/list/filterModel.d.ts +122 -0
  245. package/dist/list/filterModel.js +308 -0
  246. package/dist/list/index.d.ts +6 -2
  247. package/dist/list/index.js +6 -2
  248. package/dist/list/listSearch.d.ts +1 -1
  249. package/dist/list/listSearch.js +8 -4
  250. package/dist/list/listView.d.ts +24 -2
  251. package/dist/list/listView.js +47 -45
  252. package/dist/list/rowMenu.d.ts +10 -5
  253. package/dist/list/rowMenu.js +17 -7
  254. package/dist/list/useListFilters.d.ts +68 -0
  255. package/dist/list/useListFilters.js +252 -0
  256. package/dist/logviewer/LogViewer.js +4 -4
  257. package/dist/styles/theme.css +94 -0
  258. package/dist/styles.css +1 -1
  259. package/package.json +11 -11
  260. package/dist/assets/yaml.worker-k9AdOqzf.js +0 -1441
  261. package/dist/components/fullscreen.d.ts +0 -4
  262. package/dist/components/fullscreen.js +0 -18
@@ -1,7 +1,10 @@
1
1
  import { cx } from "../cx.js";
2
- import { ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
3
- import { useStrings } from "./Provider.js";
2
+ import { buttonClasses } from "./buttonClasses.js";
3
+ import { ChevronLeftIcon, ChevronRightIcon, MoreIcon } from "../icons.js";
4
+ import { useLocale, useStrings } from "./Provider.js";
5
+ import { AppLink } from "./AppLink.js";
4
6
  import { IconButton } from "./IconButton.js";
7
+ import { formatInteger } from "../format.js";
5
8
  import { Select } from "./Select.js";
6
9
  import { jsx, jsxs } from "react/jsx-runtime";
7
10
  //#region src/components/Pagination.tsx
@@ -11,10 +14,36 @@ var PAGE_SIZES = [
11
14
  100,
12
15
  200
13
16
  ];
17
+ /** The pages to number, counting from 0, with `null` for a gap: all of them
18
+ * when they fit in `max` steps, and otherwise the first and last around a
19
+ * window on the current one, `max` steps in all. */
20
+ function pageSteps(page, count, max = 7) {
21
+ const steps = Math.max(5, Math.floor(max));
22
+ const range = (from, to) => Array.from({ length: to - from + 1 }, (_, i) => from + i);
23
+ if (count <= steps) return range(0, count - 1);
24
+ if (page < steps - 3) return [
25
+ ...range(0, steps - 3),
26
+ null,
27
+ count - 1
28
+ ];
29
+ if (page > count - (steps - 2)) return [
30
+ 0,
31
+ null,
32
+ ...range(count - (steps - 2), count - 1)
33
+ ];
34
+ const side = Math.floor((steps - 5) / 2);
35
+ return [
36
+ 0,
37
+ null,
38
+ ...range(page - side, page + side),
39
+ null,
40
+ count - 1
41
+ ];
42
+ }
14
43
  /** Steps through a list a page at a time: where the page sits in the list,
15
44
  * previous and next, and optionally how many rows a page holds. Renders
16
45
  * nothing when everything fits on one page. */
17
- function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes = PAGE_SIZES, onPageSizeChange, summary, className }) {
46
+ function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes = PAGE_SIZES, onPageSizeChange, summary, pageNumbers = false, className }) {
18
47
  const t = useStrings().list;
19
48
  const start = page * pageSize + 1;
20
49
  const pageEnd = (page + 1) * pageSize;
@@ -49,21 +78,40 @@ function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pa
49
78
  })]
50
79
  }), /* @__PURE__ */ jsxs("div", {
51
80
  className: "flex items-center gap-1",
52
- children: [/* @__PURE__ */ jsx(PageStep, {
53
- to: page - 1,
54
- enabled: hasPrevious,
55
- label: t.paginationPrevious,
56
- icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
57
- onPageChange,
58
- pageHref
59
- }), /* @__PURE__ */ jsx(PageStep, {
60
- to: page + 1,
61
- enabled: hasMore,
62
- label: t.paginationNext,
63
- icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
64
- onPageChange,
65
- pageHref
66
- })]
81
+ children: [
82
+ /* @__PURE__ */ jsx(PageStep, {
83
+ to: page - 1,
84
+ enabled: hasPrevious,
85
+ label: t.paginationPrevious,
86
+ icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
87
+ onPageChange,
88
+ pageHref
89
+ }),
90
+ pageNumbers && pageCount !== void 0 && pageCount > 1 && /* @__PURE__ */ jsx("ol", {
91
+ className: "m-0 hidden list-none items-center gap-1 p-0 sm:flex",
92
+ children: pageSteps(page, pageCount, typeof pageNumbers === "object" ? pageNumbers.max : void 0).map((step, i) => /* @__PURE__ */ jsx("li", {
93
+ className: "flex",
94
+ children: step === null ? /* @__PURE__ */ jsx(MoreIcon, {
95
+ "aria-hidden": "true",
96
+ className: "size-3.5 w-5 text-(--theme-muted-text-color)"
97
+ }) : /* @__PURE__ */ jsx(PageNumber, {
98
+ to: step,
99
+ current: step === page,
100
+ label: t.page(step + 1),
101
+ onPageChange,
102
+ pageHref
103
+ })
104
+ }, step ?? `gap-${i}`))
105
+ }),
106
+ /* @__PURE__ */ jsx(PageStep, {
107
+ to: page + 1,
108
+ enabled: hasMore,
109
+ label: t.paginationNext,
110
+ icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
111
+ onPageChange,
112
+ pageHref
113
+ })
114
+ ]
67
115
  })]
68
116
  });
69
117
  }
@@ -82,5 +130,28 @@ function PageStep({ to, enabled, label, icon, onPageChange, pageHref }) {
82
130
  onClick: () => onPageChange?.(to)
83
131
  });
84
132
  }
133
+ var numberClassName = cx(buttonClasses({
134
+ variant: "outline",
135
+ size: "sm"
136
+ }), "min-w-7 px-1.5 tabular-nums aria-[current=page]:border-(--theme-link) aria-[current=page]:bg-(--theme-accent-subtle) aria-[current=page]:text-(--theme-app)");
137
+ function PageNumber({ to, current, label, onPageChange, pageHref }) {
138
+ const number = formatInteger(to + 1, useLocale());
139
+ const props = {
140
+ "aria-label": label,
141
+ "aria-current": current ? "page" : void 0,
142
+ className: numberClassName
143
+ };
144
+ if (pageHref) return /* @__PURE__ */ jsx(AppLink, {
145
+ ...props,
146
+ href: pageHref(to),
147
+ children: number
148
+ });
149
+ return /* @__PURE__ */ jsx("button", {
150
+ type: "button",
151
+ ...props,
152
+ onClick: () => !current && onPageChange?.(to),
153
+ children: number
154
+ });
155
+ }
85
156
  //#endregion
86
- export { PAGE_SIZES, Pagination };
157
+ export { PAGE_SIZES, Pagination, pageSteps };
@@ -29,6 +29,12 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
29
29
  /** Also opens while the pointer rests on the trigger. A click or a tap still
30
30
  * opens it, so touch and keyboard users reach it too. */
31
31
  openOnHover?: boolean;
32
+ /** With `openOnHover`, how long the pointer rests on the trigger before it opens, in
33
+ * milliseconds. 0 opens it at once, as for a collapsed rail's flyout. */
34
+ hoverDelay?: number | undefined;
35
+ /** With `openOnHover`, how long it stays open after the pointer leaves, in milliseconds,
36
+ * so the pointer can cross the gap to it. */
37
+ hoverCloseDelay?: number | undefined;
32
38
  /** Where focus goes on opening: the first control in it, the panel itself for
33
39
  * a list read before one item in it is picked, or nowhere, for a popover that
34
40
  * offers an action on what the reader is doing, such as copying a selection. */
@@ -39,7 +45,12 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
39
45
  /** Stays on `side` where it doesn't fit rather than flipping to the other, for a popup that
40
46
  * must not cover what is there, such as the control a tip describes while it is typed in. */
41
47
  keepSide?: boolean | undefined;
42
- /** `panel` holds controls or a list; `tip` is a tooltip-sized note with an arrow. */
48
+ /** At phone width, under 640px, opens as a sheet along the bottom of the screen, as wide as
49
+ * the screen and scrolling inside, rather than in the strip of page beside its trigger. On
50
+ * by default for a panel with a trigger; off for a tip and for a popover opened `at` a point,
51
+ * which belongs where the reader is. */
52
+ sheet?: boolean | undefined;
53
+ /** `panel` holds controls or a list; `tip` is a tooltip-sized note in the tooltip's look. */
43
54
  variant?: 'panel' | 'tip';
44
55
  /** On the popup: its width, padding or text size. */
45
56
  className?: string;
@@ -49,5 +60,5 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
49
60
  * flips and shifts to stay on screen, closes on Escape or a press outside, and
50
61
  * returns focus to the trigger. Use a Menu for a list of actions, and a
51
62
  * HoverCard for a preview a link already leads to. */
52
- export declare function Popover({ trigger, at, title, open, defaultOpen, onOpenChange, side, align, openOnHover, initialFocus, anchor, keepSide, variant, className, children, ...popupProps }: PopoverProps): import("react").JSX.Element;
63
+ export declare function Popover({ trigger, at, title, open, defaultOpen, onOpenChange, side, align, openOnHover, hoverDelay, hoverCloseDelay, initialFocus, anchor, keepSide, variant, sheet, className, children, ...popupProps }: PopoverProps): import("react").JSX.Element;
53
64
  export {};
@@ -1,8 +1,8 @@
1
1
  import { cx } from "../cx.js";
2
2
  import { panelClassName, positionerClassName, tipClassName, toPositionerAnchor } from "./floating.js";
3
- import { useFullscreenContainer } from "./fullscreen.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { usePopupContainer } from "./popupContainer.js";
5
4
  import { createContext, use, useCallback, useRef } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Popover } from "@base-ui/react/popover";
7
7
  //#region src/components/Popover.tsx
8
8
  /** A button that closes the popover it sits in. */
@@ -13,13 +13,16 @@ var CloseContext = createContext(() => {});
13
13
  function useClosePopover() {
14
14
  return use(CloseContext);
15
15
  }
16
+ var sheetPositionerClassName = "max-sm:fixed! max-sm:inset-x-2! max-sm:top-auto! max-sm:bottom-[max(8px,env(safe-area-inset-bottom))]! max-sm:transform-none!";
17
+ var sheetPopupClassName = "max-sm:w-auto! max-sm:max-w-none! max-sm:max-h-[min(75dvh,calc(100dvh-16px))]! max-sm:origin-bottom!";
16
18
  /** A panel anchored to its trigger, over the page so no container clips it. It
17
19
  * flips and shifts to stay on screen, closes on Escape or a press outside, and
18
20
  * returns focus to the trigger. Use a Menu for a list of actions, and a
19
21
  * HoverCard for a preview a link already leads to. */
20
- function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side = "bottom", align = "center", openOnHover = false, initialFocus = "first-control", anchor, keepSide = false, variant = "panel", className, children, ...popupProps }) {
21
- const fullscreen = useFullscreenContainer();
22
+ function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side = "bottom", align = "center", openOnHover = false, hoverDelay = 300, hoverCloseDelay = 150, initialFocus = "first-control", anchor, keepSide = false, variant = "panel", sheet, className, children, ...popupProps }) {
23
+ const portal = usePopupContainer();
22
24
  const tip = variant === "tip";
25
+ const asSheet = sheet ?? (!tip && !at);
23
26
  const popup = useRef(null);
24
27
  const actions = useRef(null);
25
28
  const close = useCallback(() => actions.current?.close(), []);
@@ -32,35 +35,31 @@ function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side =
32
35
  render: trigger,
33
36
  openOnHover,
34
37
  ...openOnHover ? {
35
- delay: 300,
36
- closeDelay: 150
38
+ delay: hoverDelay,
39
+ closeDelay: hoverCloseDelay
37
40
  } : {}
38
41
  }), /* @__PURE__ */ jsx(Popover.Portal, {
39
- container: fullscreen,
42
+ ...portal,
40
43
  children: /* @__PURE__ */ jsx(Popover.Positioner, {
41
44
  side,
42
45
  align,
43
- sideOffset: tip ? 8 : 6,
46
+ sideOffset: 6,
44
47
  collisionPadding: 8,
45
48
  ...keepSide && { collisionAvoidance: { side: "none" } },
46
49
  ...at ? { anchor: toPositionerAnchor(at) } : anchor ? { anchor } : {},
47
- className: positionerClassName,
50
+ className: cx(positionerClassName, asSheet && sheetPositionerClassName),
48
51
  children: /* @__PURE__ */ jsxs(Popover.Popup, {
49
52
  ...popupProps,
50
53
  ref: popup,
51
54
  initialFocus: initialFocus === "popup" ? popup : initialFocus === "first-control",
52
- className: cx(tip ? cx("max-w-sm text-left", tipClassName) : cx(panelClassName, "max-h-(--available-height) max-w-[calc(100vw-16px)] overflow-y-auto p-3"), className),
53
- children: [
54
- tip && /* @__PURE__ */ jsx(Popover.Arrow, { className: "size-2 rotate-45 bg-(--theme-app) data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1" }),
55
- title && /* @__PURE__ */ jsx(Popover.Title, {
56
- className: "mb-2 text-sm font-semibold",
57
- children: title
58
- }),
59
- /* @__PURE__ */ jsx(CloseContext, {
60
- value: close,
61
- children
62
- })
63
- ]
55
+ className: cx(tip ? cx("text-left", tipClassName) : cx(panelClassName, "max-h-(--available-height) max-w-[calc(100vw-16px)] overflow-y-auto p-3"), className, asSheet && sheetPopupClassName),
56
+ children: [title && /* @__PURE__ */ jsx(Popover.Title, {
57
+ className: "mb-2 text-sm font-semibold",
58
+ children: title
59
+ }), /* @__PURE__ */ jsx(CloseContext, {
60
+ value: close,
61
+ children
62
+ })]
64
63
  })
65
64
  })
66
65
  })]
@@ -4,6 +4,7 @@ import type { WorkflowAction, WorkflowEditing } from '../editing.js';
4
4
  import type { WorkflowEngine } from '../engine.js';
5
5
  import type { GraphEditorText, InputsEditorText } from '../graph/editorStrings.js';
6
6
  import type { RunLink } from '../graph/types.js';
7
+ import type { FilterOperator } from '../list/filterModel.js';
7
8
  export interface UIStrings {
8
9
  modal: {
9
10
  creating: string;
@@ -59,6 +60,8 @@ export interface UIStrings {
59
60
  copyThing: (label: string) => string;
60
61
  copiedThing: (label: string) => string;
61
62
  copyThingFailed: (label: string) => string;
63
+ /** A count past a badge's cap, `max` already formatted, such as "99+". */
64
+ countOverflow: (max: string) => string;
62
65
  /** Read out where a value is missing, which shows as a dash. */
63
66
  noValue: string;
64
67
  /** A name field's rule: the characters a key or identifier allows. */
@@ -109,6 +112,12 @@ export interface UIStrings {
109
112
  refreshing: string;
110
113
  /** A refresh button's label once it knows when the data was fetched. */
111
114
  updated: (ago: string) => string;
115
+ /** Read with a "+3" chip that stands for the items a list leaves out. */
116
+ moreCount: (count: number) => string;
117
+ /** Names the button that copies the text selected in a block. */
118
+ copySelection: string;
119
+ /** Read in place of a masked secret's dots. */
120
+ hiddenValue: string;
112
121
  };
113
122
  dropdown: {
114
123
  select: (type: string) => string;
@@ -118,6 +127,10 @@ export interface UIStrings {
118
127
  showOptions: string;
119
128
  /** The row that adds typed text as a new value. */
120
129
  add: (text: string) => string;
130
+ /** The row that creates the thing typed text names, such as a new label. */
131
+ create: (text: string) => string;
132
+ /** Heads the values offered under a tag field. */
133
+ suggested: string;
121
134
  /** In place of the placeholder once a field holds as many values as it takes. */
122
135
  limitReached: (max: number) => string;
123
136
  /** Names the button on a chosen value's chip that takes it out. */
@@ -130,6 +143,10 @@ export interface UIStrings {
130
143
  time: string;
131
144
  previousMonth: string;
132
145
  nextMonth: string;
146
+ /** Names the box in the calendar's popup that takes a typed date. */
147
+ typeDate: string;
148
+ /** Under the box while what is typed isn't a date that can be chosen. */
149
+ invalidDate: string;
133
150
  };
134
151
  colorInput: {
135
152
  /** Names the picker beside the hex field: the field's name, or none when it has no plain one. */
@@ -535,12 +552,37 @@ export interface UIStrings {
535
552
  /** A step's name in the list of steps, numbered from 1. */
536
553
  stepLabel: (number: number, title: string) => string;
537
554
  };
555
+ /** A compact relative time ("5m", "3h"), which reads as a date after a week. */
538
556
  time: {
539
557
  now: string;
540
558
  minutes: (n: number) => string;
541
559
  hours: (n: number) => string;
542
560
  days: (n: number) => string;
561
+ /** @deprecated A compact time reads as a date once it is a week away, so no longer counts in years. */
543
562
  years: (n: number) => string;
563
+ /** A compact time still to come, such as "in 5m"; `label` is one of the counts above. */
564
+ inFuture: (label: string) => string;
565
+ /** A compact time a week or more away, such as "Sep 4"; by default with the year only while
566
+ * it isn't this year. `locale` is UIProvider's, when the host gives one. */
567
+ date: (date: Date, locale?: string) => string;
568
+ };
569
+ /** Key names in a shortcut, as keycaps carry them off an Apple keyboard, such as
570
+ * "Strg" for Control in German. An Apple keyboard shows its symbols: ⌘ ⌥ ⇧ ⌃. */
571
+ keys: {
572
+ ctrl: string;
573
+ alt: string;
574
+ shift: string;
575
+ meta: string;
576
+ enter: string;
577
+ escape: string;
578
+ space: string;
579
+ tab: string;
580
+ backspace: string;
581
+ delete: string;
582
+ };
583
+ chart: {
584
+ /** The row under a chart's tooltip that sums its series. */
585
+ total: string;
544
586
  };
545
587
  list: {
546
588
  moreActions: string;
@@ -552,6 +594,8 @@ export interface UIStrings {
552
594
  labelId: string;
553
595
  labelUrl: string;
554
596
  couldNotLoad: (noun: string) => string;
597
+ /** What `ListError` says under its heading when the host gives no message of its own. */
598
+ couldNotLoadHint: string;
555
599
  /** What `ListError` names when the host gives no noun. */
556
600
  data: string;
557
601
  /** A list's size, as `ListCount` shows it; `count` is formatted and `noun` agrees with it. */
@@ -584,11 +628,79 @@ export interface UIStrings {
584
628
  paginationPrevious: string;
585
629
  paginationNext: string;
586
630
  pagination: string;
631
+ /** A numbered page's name in `Pagination`, counting from 1. */
632
+ page: (page: number) => string;
587
633
  removeSearchTerm: (term: string) => string;
588
634
  };
635
+ /** The chip row of a list's active filters, its Filter menu and its pickers. Field and option
636
+ * labels come from the host's fields, already translated. */
637
+ filters: {
638
+ /** The button at the end of the chip row that adds one, and the Filter menu's heading. */
639
+ addFilter: string;
640
+ /** Names the Filter menu's search over the fields. */
641
+ searchFields: string;
642
+ /** Names the chip row. */
643
+ activeFilters: string;
644
+ /** The toolbar's Filter button, saying how many filters are on, since its dot is only seen. */
645
+ filterButton: (count: number) => string;
646
+ /** A required or pinned filter's value while it has none. */
647
+ any: string;
648
+ /** The value part of a chip just added, until a value is chosen. */
649
+ pending: string;
650
+ /** A condition, worded for how many values follow it: "is" / "is any of". */
651
+ operator: (op: FilterOperator, count: number) => string;
652
+ /** After the first values shown in a chip: "+3". */
653
+ more: (count: number) => string;
654
+ /** At phone width, the chip that opens every filter in a sheet: "+3 filters". */
655
+ overflow: (count: number) => string;
656
+ /** The sheet's title. */
657
+ sheetTitle: string;
658
+ /** Names a chip's remove button. */
659
+ remove: (field: string) => string;
660
+ /** Names a chip, read as a sentence. */
661
+ chip: (field: string, operator: string, values: string) => string;
662
+ /** Names a chip's field part, which picks another field. */
663
+ changeField: (field: string) => string;
664
+ /** Names a chip's condition part. */
665
+ changeOperator: (operator: string) => string;
666
+ /** Names a chip's value part. */
667
+ changeValue: (values: string) => string;
668
+ /** Joins the values a chip lists. */
669
+ list: (values: string[]) => string;
670
+ /** A relative date preset: `today`, `-7d`, `-30d`, `-90d` or `month`; any `-Nd`. */
671
+ datePreset: (preset: string) => string;
672
+ /** The date picker's entry that picks days on a calendar. */
673
+ customDate: string;
674
+ /** Two days a filter spans. */
675
+ between: (from: string, to: string) => string;
676
+ /** A day in a chip; by default without the year while it is this year. `locale` is
677
+ * UIProvider's, when the host gives one. */
678
+ formatDate: (date: Date, locale?: string) => string;
679
+ /** The text picker's hint. */
680
+ textPlaceholder: string;
681
+ /** A yes-or-no filter's values. */
682
+ yes: string;
683
+ no: string;
684
+ };
685
+ /** `ErrorPage`'s words: the way back, and a title and description for each kind of error. */
686
+ errorPage: {
687
+ /** Back through the browser's history. */
688
+ back: string;
689
+ /** Back to the app's start, when there is no history to go back through. */
690
+ home: string;
691
+ /** The title when nothing more is known about the error. */
692
+ error: string;
693
+ /** The title for a status no kind covers, such as 418. */
694
+ statusTitle: (status: string) => string;
695
+ titles: Record<ErrorPageKind, string>;
696
+ descriptions: Record<ErrorPageKind, string>;
697
+ };
589
698
  }
590
- /** What a host passes to translate the strings: any group, any string in it, at any depth.
591
- * A string it leaves out stays in English. */
699
+ /** What went wrong, which picks an `ErrorPage`'s words: `notFound` (404),
700
+ * `forbidden` (403), `unauthenticated` (401), `unavailable` (502, 503 and
701
+ * 504), `server` (any other 5xx), and `network` for a request that never
702
+ * reached the server. */
703
+ export type ErrorPageKind = 'notFound' | 'forbidden' | 'unauthenticated' | 'unavailable' | 'server' | 'network';
592
704
  export type UIStringOverrides = Overrides<UIStrings>;
593
705
  type Overrides<T> = {
594
706
  [K in keyof T]?: T[K] extends (...args: never[]) => unknown ? T[K] : T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? Overrides<T[K]> : T[K];
@@ -599,6 +711,13 @@ export interface UINavigation {
599
711
  * `sourceUrl` is a page the server resolved for it, when there is one. */
600
712
  openStepSource: (uses: string, sourceUrl?: string) => void;
601
713
  openExternal: (href: string) => void;
714
+ /** Goes back one entry in the history, such as an error page's "Back". Bind it
715
+ * to the router's history; the browser's by default. */
716
+ goBack: () => void;
717
+ /** Whether there is an entry of this app's to go back to; when there isn't, an
718
+ * error page offers the way home instead. Bind it to the router's own
719
+ * answer; by default, whether the tab's history holds more than this page. */
720
+ canGoBack: () => boolean;
602
721
  }
603
722
  export type WorkflowJsonRef = {
604
723
  kind: 'marketplace';
@@ -715,7 +834,17 @@ export interface UISlots {
715
834
  }
716
835
  /** An engine, or a loader so the host can keep the engine out of its first-load bundle. */
717
836
  export type WorkflowEngineSource = WorkflowEngine | (() => Promise<WorkflowEngine>);
837
+ /** How avatars without a picture are colored. `name` gives each person a color from the theme's
838
+ * categorical palette, picked by name, and one initial for a one-word name. `kind` gives every
839
+ * person one tint and every agent another (and a square), with two initials for a one-word name,
840
+ * for an app that tells people and agents apart at a glance. */
841
+ export type AvatarColoring = 'name' | 'kind';
718
842
  export declare function useStrings(): UIStrings;
843
+ /** The host's locale for dates and times, such as `de-DE`. Undefined without one, which leaves
844
+ * each format's own default: the date library's for its times, the browser's for the rest. */
845
+ export declare function useLocale(): string | undefined;
846
+ /** How the host colors avatars, UIProvider's `avatarColoring`. */
847
+ export declare function useAvatarColoring(): AvatarColoring;
719
848
  export declare function useNavigation(): UINavigation;
720
849
  export declare function useWorkflowJsonResolver(): UIData['resolveWorkflowJson'];
721
850
  export declare function useRepoSuggestions(): UIData['repoSuggestions'];
@@ -756,7 +885,15 @@ export interface UIProviderProps {
756
885
  * that places them before hydration. The components render no inline
757
886
  * `<style>`, so a policy without 'unsafe-inline' styles needs none. */
758
887
  nonce?: string | undefined;
888
+ /** The locale dates and times read in, such as `de-DE`, as a BCP 47 tag: relative times,
889
+ * exact times and the date picker. Pass the app's language, so they read as its own text
890
+ * does. Without one they follow the date library's default locale, or the browser's. */
891
+ locale?: string | undefined;
892
+ /** How avatars without a picture are colored: by name (the default), or by kind, where people
893
+ * share one tint and agents another, set by `--avatar-person` and `--avatar-agent` (see
894
+ * `Avatar`). */
895
+ avatarColoring?: AvatarColoring | undefined;
759
896
  children: React.ReactNode;
760
897
  }
761
- export declare function UIProvider({ strings, navigation, data, slots, engine: engineProp, nonce, children, }: UIProviderProps): import("react").JSX.Element;
898
+ export declare function UIProvider({ strings, navigation, data, slots, engine: engineProp, nonce, locale, avatarColoring, children, }: UIProviderProps): import("react").JSX.Element;
762
899
  export {};