@parallelworks/ui 0.77.0 → 0.79.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 (268) hide show
  1. package/README.md +42 -6
  2. package/dist/access/AccessDrawer.d.ts +49 -7
  3. package/dist/access/AccessDrawer.js +243 -38
  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 +25 -1
  13. package/dist/access/strings.js +27 -3
  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 +23 -8
  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 +28 -2
  60. package/dist/components/ConfirmModal.js +100 -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 +20 -4
  66. package/dist/components/CreateModal.js +28 -17
  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 +41 -4
  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 +16 -2
  113. package/dist/components/Popover.js +20 -21
  114. package/dist/components/Provider.d.ts +172 -5
  115. package/dist/components/Provider.js +157 -14
  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 +10 -9
  214. package/dist/graph/MatrixGroup.js +2 -2
  215. package/dist/graph/ProblemPageLink.d.ts +9 -0
  216. package/dist/graph/ProblemPageLink.js +21 -0
  217. package/dist/graph/ProblemsButton.js +26 -16
  218. package/dist/graph/Reveal.js +1 -1
  219. package/dist/graph/RunWarningsList.js +21 -12
  220. package/dist/graph/ShortcutsButton.js +25 -8
  221. package/dist/graph/StepSummaries.js +1 -1
  222. package/dist/graph/TreeView.js +2 -2
  223. package/dist/graph/WorkflowSettingsDialog.js +3 -3
  224. package/dist/graph/editorApi.d.ts +10 -0
  225. package/dist/graph/editorFields.js +3 -3
  226. package/dist/graph/editorPrimitives.js +1 -1
  227. package/dist/graph/editorRows.js +8 -6
  228. package/dist/graph/editorStrings.d.ts +1 -0
  229. package/dist/graph/editorStrings.js +1 -0
  230. package/dist/graph/fieldProblems.js +2 -2
  231. package/dist/graph/inputRefs.js +7 -6
  232. package/dist/graph/runWarnings.d.ts +12 -1
  233. package/dist/graph/stepWith.js +2 -2
  234. package/dist/index.d.ts +30 -21
  235. package/dist/index.js +20 -12
  236. package/dist/list/ActionToolbar.d.ts +4 -0
  237. package/dist/list/ActionToolbar.js +35 -12
  238. package/dist/list/ListFilterBar.d.ts +42 -0
  239. package/dist/list/ListFilterBar.js +789 -0
  240. package/dist/list/ListPage.d.ts +42 -4
  241. package/dist/list/ListPage.js +56 -22
  242. package/dist/list/ListTable.d.ts +27 -3
  243. package/dist/list/ListTable.js +48 -23
  244. package/dist/list/ListToolbar.d.ts +31 -0
  245. package/dist/list/ListToolbar.js +43 -0
  246. package/dist/list/ListViewControls.d.ts +8 -4
  247. package/dist/list/ListViewControls.js +22 -14
  248. package/dist/list/UserHoverCard.d.ts +8 -2
  249. package/dist/list/UserHoverCard.js +26 -13
  250. package/dist/list/filterModel.d.ts +122 -0
  251. package/dist/list/filterModel.js +308 -0
  252. package/dist/list/index.d.ts +6 -2
  253. package/dist/list/index.js +6 -2
  254. package/dist/list/listSearch.d.ts +1 -1
  255. package/dist/list/listSearch.js +8 -4
  256. package/dist/list/listView.d.ts +24 -2
  257. package/dist/list/listView.js +47 -45
  258. package/dist/list/rowMenu.d.ts +10 -5
  259. package/dist/list/rowMenu.js +17 -7
  260. package/dist/list/useListFilters.d.ts +68 -0
  261. package/dist/list/useListFilters.js +252 -0
  262. package/dist/logviewer/LogViewer.js +4 -4
  263. package/dist/styles/theme.css +94 -0
  264. package/dist/styles.css +1 -1
  265. package/package.json +11 -11
  266. package/dist/assets/yaml.worker-k9AdOqzf.js +0 -1441
  267. package/dist/components/fullscreen.d.ts +0 -4
  268. package/dist/components/fullscreen.js +0 -18
@@ -1,3 +1,5 @@
1
+ import { type DateRange } from '@daypicker/react';
2
+ import { type ReactElement, type ReactNode } from 'react';
1
3
  import { type FieldBoxSize } from './fieldBox.js';
2
4
  export interface DatePickerProps {
3
5
  /** As a native date input holds it: `yyyy-MM-dd`, or with `withTime` the local
@@ -27,10 +29,38 @@ export interface DatePickerProps {
27
29
  size?: FieldBoxSize | undefined;
28
30
  /** On the row that holds the date and the time: its width or margin. */
29
31
  className?: string | undefined;
32
+ /** Renders the field as this button, such as a chip that says the date its own way. The
33
+ * button shows the date itself; `placeholder` and `size` then go unused. */
34
+ trigger?: ReactElement | undefined;
35
+ /** A hint on the trigger button. */
36
+ triggerTooltip?: ReactNode;
37
+ /** The edge of the field the calendar lines up with. */
38
+ align?: 'start' | 'end' | undefined;
30
39
  }
31
40
  /**
32
41
  * A day from a calendar, and with `withTime` a time beside it. The value is a string as a native
33
42
  * date or datetime-local input holds it, so it reads the same in forms and URLs; months, weekdays
34
43
  * and the shown date follow the reader's locale.
35
44
  */
36
- export declare function DatePicker({ value, onValueChange, withTime, min, max, timeStep, required, disabled, placeholder, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, size, className, }: DatePickerProps): import("react").JSX.Element;
45
+ export declare function DatePicker({ value, onValueChange, withTime, min, max, timeStep, required, disabled, placeholder, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, size, className, trigger, triggerTooltip, align, }: DatePickerProps): import("react").JSX.Element;
46
+ export type CalendarProps = {
47
+ /** The earliest and latest days that can be chosen. */
48
+ min?: Date | undefined;
49
+ max?: Date | undefined;
50
+ /** The month it opens on, when it differs from the chosen day's. */
51
+ defaultMonth?: Date | undefined;
52
+ /** Moves focus to the chosen day, or today, as it appears. */
53
+ autoFocus?: boolean | undefined;
54
+ } & ({
55
+ mode: 'single';
56
+ selected: Date | undefined;
57
+ onSelect: (day: Date | undefined) => void;
58
+ } | {
59
+ /** Two days, both included; the second click ends the range. */
60
+ mode: 'range';
61
+ selected: DateRange | undefined;
62
+ onSelect: (range: DateRange | undefined) => void;
63
+ });
64
+ /** The month grid DatePicker opens, for a panel that holds a calendar in place, such as a
65
+ * date filter's picker. Months, weekdays and labels follow the reader's locale. */
66
+ export declare function Calendar({ min, max, defaultMonth, autoFocus, ...props }: CalendarProps): import("react").JSX.Element;
@@ -2,12 +2,14 @@ import { cx } from "../cx.js";
2
2
  import { buttonClasses } from "./buttonClasses.js";
3
3
  import { CalendarIcon, ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
4
4
  import { panelClassName, positionerClassName } from "./floating.js";
5
- import { useFullscreenContainer } from "./fullscreen.js";
6
- import { useStrings } from "./Provider.js";
5
+ import { usePopupContainer } from "./popupContainer.js";
6
+ import { Tooltip } from "./Tooltip.js";
7
+ import { useLocale, useStrings } from "./Provider.js";
7
8
  import { fieldBox } from "./fieldBox.js";
8
9
  import { useFieldLabelledControl } from "./Field.js";
10
+ import { formatNumericDate, parseTypedDate } from "./typedDate.js";
11
+ import { useId, useRef, useState } from "react";
9
12
  import { jsx, jsxs } from "react/jsx-runtime";
10
- import { useState } from "react";
11
13
  import { Popover } from "@base-ui/react/popover";
12
14
  import { DayPicker } from "@daypicker/react";
13
15
  //#region src/components/DatePicker.tsx
@@ -23,23 +25,41 @@ function parseDay(value) {
23
25
  }
24
26
  var timeOf = (value) => value?.match(/T(\d{2}:\d{2}(?::\d{2})?)/)?.[1];
25
27
  /** The locale's first day of the week, where the browser reports it; Sunday otherwise. */
26
- function firstWeekday() {
28
+ function firstWeekday(tag) {
27
29
  try {
28
- const locale = new Intl.Locale(navigator.language);
30
+ const locale = new Intl.Locale(tag ?? navigator.language);
29
31
  const firstDay = (locale.getWeekInfo?.() ?? locale.weekInfo)?.firstDay;
30
32
  return firstDay === void 0 ? 0 : firstDay % 7;
31
33
  } catch {
32
34
  return 0;
33
35
  }
34
36
  }
35
- var caption = new Intl.DateTimeFormat(void 0, {
36
- month: "long",
37
- year: "numeric"
38
- });
39
- var weekday = new Intl.DateTimeFormat(void 0, { weekday: "narrow" });
40
- var longDay = new Intl.DateTimeFormat(void 0, { dateStyle: "full" });
41
- var shownDay = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
42
- var longWeekday = new Intl.DateTimeFormat(void 0, { weekday: "long" });
37
+ function dateFormats(locale) {
38
+ return {
39
+ caption: new Intl.DateTimeFormat(locale, {
40
+ month: "long",
41
+ year: "numeric"
42
+ }),
43
+ weekday: new Intl.DateTimeFormat(locale, { weekday: "narrow" }),
44
+ longDay: new Intl.DateTimeFormat(locale, { dateStyle: "full" }),
45
+ shownDay: new Intl.DateTimeFormat(locale, { dateStyle: "medium" }),
46
+ shownDayThisYear: new Intl.DateTimeFormat(locale, {
47
+ month: "short",
48
+ day: "numeric"
49
+ }),
50
+ longWeekday: new Intl.DateTimeFormat(locale, { weekday: "long" }),
51
+ weekStartsOn: firstWeekday(locale)
52
+ };
53
+ }
54
+ var formatsByLocale = /* @__PURE__ */ new Map();
55
+ function formatsFor(locale) {
56
+ let formats = formatsByLocale.get(locale);
57
+ if (!formats) {
58
+ formats = dateFormats(locale);
59
+ formatsByLocale.set(locale, formats);
60
+ }
61
+ return formats;
62
+ }
43
63
  var calendarClassNames = {
44
64
  root: "relative p-3",
45
65
  months: "flex flex-col",
@@ -74,14 +94,19 @@ var triggerClassName = (size) => cx(fieldBox({ size }), "flex flex-1 cursor-poin
74
94
  * date or datetime-local input holds it, so it reads the same in forms and URLs; months, weekdays
75
95
  * and the shown date follow the reader's locale.
76
96
  */
77
- function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep = 60, required = false, disabled = false, placeholder, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, size = "md", className }) {
78
- const fullscreen = useFullscreenContainer();
97
+ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep = 60, required = false, disabled = false, placeholder, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, size = "md", className, trigger, triggerTooltip, align = "start" }) {
98
+ const portal = usePopupContainer();
79
99
  const t = useStrings().datePicker;
80
100
  const { common } = useStrings();
81
101
  const field = useFieldLabelledControl();
82
102
  const [open, setOpen] = useState(false);
83
- const [weekStartsOn] = useState(firstWeekday);
103
+ const locale = useLocale();
104
+ const { caption, weekday, longDay, shownDay, shownDayThisYear, longWeekday, weekStartsOn } = formatsFor(locale);
84
105
  const day = parseDay(value);
106
+ const uid = useId();
107
+ const [month, setMonth] = useState(void 0);
108
+ const [typed, setTyped] = useState("");
109
+ const typedBox = useRef(null);
85
110
  const time = timeOf(value) ?? timeOf(min) ?? "00:00";
86
111
  const earliest = parseDay(min);
87
112
  const latest = parseDay(max);
@@ -98,37 +123,90 @@ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep
98
123
  emit(next);
99
124
  setOpen(false);
100
125
  };
126
+ const onOpenChange = (next) => {
127
+ if (next) {
128
+ setMonth(opensOn ?? /* @__PURE__ */ new Date());
129
+ setTyped(day ? formatNumericDate(day, locale) : "");
130
+ }
131
+ setOpen(next);
132
+ };
133
+ const inRange = (date) => (!earliest || date >= earliest) && (!latest || date <= latest);
134
+ const typedDay = typed.trim() ? parseTypedDate(typed, locale) : void 0;
135
+ const typedInvalid = typed.trim() !== "" && (!typedDay || !inRange(typedDay));
136
+ const shown = day ? (day.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? shownDayThisYear : shownDay).format(day) : void 0;
137
+ const triggerProps = {
138
+ id: id ?? field?.id,
139
+ disabled,
140
+ "aria-label": ariaLabel,
141
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel ? void 0 : field?.["aria-labelledby"]),
142
+ "aria-describedby": ariaDescribedBy ?? field?.["aria-describedby"],
143
+ "aria-invalid": ariaInvalid || field?.["aria-invalid"],
144
+ "aria-required": ariaRequired || field?.["aria-required"]
145
+ };
101
146
  const sameDay = (bound) => day !== void 0 && parseDay(bound)?.getTime() === day.getTime();
102
- return /* @__PURE__ */ jsxs("div", {
103
- className: cx("flex w-full items-center", size === "sm" ? "gap-1.5" : "gap-2", className),
104
- children: [/* @__PURE__ */ jsxs(Popover.Root, {
105
- open,
106
- onOpenChange: setOpen,
107
- children: [/* @__PURE__ */ jsxs(Popover.Trigger, {
108
- id: id ?? field?.id,
109
- disabled,
110
- "aria-label": ariaLabel,
111
- "aria-labelledby": ariaLabelledBy ?? (ariaLabel ? void 0 : field?.["aria-labelledby"]),
112
- "aria-describedby": ariaDescribedBy ?? field?.["aria-describedby"],
113
- "aria-invalid": ariaInvalid || field?.["aria-invalid"],
114
- "aria-required": ariaRequired || field?.["aria-required"],
147
+ const picker = /* @__PURE__ */ jsxs(Popover.Root, {
148
+ open,
149
+ onOpenChange,
150
+ children: [/* @__PURE__ */ jsx(Tooltip, {
151
+ content: triggerTooltip,
152
+ children: trigger ? /* @__PURE__ */ jsx(Popover.Trigger, {
153
+ ...triggerProps,
154
+ render: trigger
155
+ }) : /* @__PURE__ */ jsxs(Popover.Trigger, {
156
+ ...triggerProps,
115
157
  className: triggerClassName(size),
116
158
  children: [/* @__PURE__ */ jsx(CalendarIcon, {
117
159
  "aria-hidden": "true",
118
160
  className: cx("shrink-0 text-(--theme-muted-text-color)", size === "sm" ? "size-3" : "size-3.5")
119
161
  }), /* @__PURE__ */ jsx("span", {
120
162
  className: cx("truncate", !day && "text-(--theme-placeholder)"),
121
- children: day ? shownDay.format(day) : placeholder ?? t.pickDate
163
+ children: shown ?? placeholder ?? t.pickDate
122
164
  })]
123
- }), /* @__PURE__ */ jsx(Popover.Portal, {
124
- container: fullscreen,
125
- children: /* @__PURE__ */ jsx(Popover.Positioner, {
126
- align: "start",
127
- sideOffset: 4,
128
- className: positionerClassName,
129
- children: /* @__PURE__ */ jsxs(Popover.Popup, {
130
- className: panelClassName,
131
- children: [/* @__PURE__ */ jsx(DayPicker, {
165
+ })
166
+ }), /* @__PURE__ */ jsx(Popover.Portal, {
167
+ ...portal,
168
+ children: /* @__PURE__ */ jsx(Popover.Positioner, {
169
+ align,
170
+ sideOffset: 4,
171
+ className: positionerClassName,
172
+ children: /* @__PURE__ */ jsxs(Popover.Popup, {
173
+ initialFocus: typedBox,
174
+ className: panelClassName,
175
+ children: [
176
+ /* @__PURE__ */ jsxs("div", {
177
+ className: "border-b border-(--theme-border) p-2",
178
+ children: [/* @__PURE__ */ jsx("input", {
179
+ type: "text",
180
+ inputMode: "numeric",
181
+ autoComplete: "off",
182
+ spellCheck: false,
183
+ "aria-label": t.typeDate,
184
+ "aria-invalid": typedInvalid || void 0,
185
+ "aria-describedby": typedInvalid ? `${uid}invalid` : void 0,
186
+ placeholder: formatNumericDate(/* @__PURE__ */ new Date(), locale),
187
+ value: typed,
188
+ ref: typedBox,
189
+ onChange: (event) => {
190
+ const next = event.target.value;
191
+ setTyped(next);
192
+ const parsed = parseTypedDate(next, locale);
193
+ if (parsed) setMonth(parsed);
194
+ },
195
+ onKeyDown: (event) => {
196
+ if (event.key === "Enter") {
197
+ event.preventDefault();
198
+ if (typedDay && inRange(typedDay)) pick(typedDay);
199
+ }
200
+ },
201
+ className: cx(fieldBox({ size: "sm" }), "tabular-nums")
202
+ }), typedInvalid && /* @__PURE__ */ jsx("div", {
203
+ id: `${uid}invalid`,
204
+ className: "mt-1 text-xs text-(--theme-error-text)",
205
+ "aria-live": "polite",
206
+ children: t.invalidDate
207
+ })]
208
+ }),
209
+ /* @__PURE__ */ jsx(DayPicker, {
132
210
  ...required ? {
133
211
  mode: "single",
134
212
  required: true,
@@ -139,12 +217,12 @@ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep
139
217
  selected: day,
140
218
  onSelect: pick
141
219
  },
142
- ...opensOn && { defaultMonth: opensOn },
220
+ ...month && { month },
221
+ onMonthChange: setMonth,
143
222
  ...earliest && { startMonth: earliest },
144
223
  ...latest && { endMonth: latest },
145
224
  disabled: outOfRange,
146
225
  weekStartsOn,
147
- autoFocus: true,
148
226
  showOutsideDays: true,
149
227
  fixedWeeks: true,
150
228
  classNames: calendarClassNames,
@@ -160,7 +238,8 @@ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep
160
238
  labelWeekday: (date) => longWeekday.format(date)
161
239
  },
162
240
  components: { Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeftIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": "true" }) }
163
- }), !required && day && /* @__PURE__ */ jsx("div", {
241
+ }),
242
+ !required && day && /* @__PURE__ */ jsx("div", {
164
243
  className: "flex justify-end border-t border-(--theme-border) px-3 py-2",
165
244
  children: /* @__PURE__ */ jsx("button", {
166
245
  type: "button",
@@ -174,11 +253,16 @@ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep
174
253
  },
175
254
  children: common.clear
176
255
  })
177
- })]
178
- })
256
+ })
257
+ ]
179
258
  })
180
- })]
181
- }), withTime && /* @__PURE__ */ jsx("input", {
259
+ })
260
+ })]
261
+ });
262
+ if (trigger && !withTime) return picker;
263
+ return /* @__PURE__ */ jsxs("div", {
264
+ className: cx(trigger ? "inline-flex" : "flex w-full", "items-center", size === "sm" ? "gap-1.5" : "gap-2", className),
265
+ children: [picker, withTime && /* @__PURE__ */ jsx("input", {
182
266
  type: "time",
183
267
  "aria-label": t.time,
184
268
  value: day ? time : "",
@@ -195,5 +279,52 @@ function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep
195
279
  })]
196
280
  });
197
281
  }
282
+ var rangeClassNames = {
283
+ ...calendarClassNames,
284
+ selected: "",
285
+ range_start: "[&>button]:bg-(--theme-accent) [&>button]:text-(--theme-accent-text) [&>button]:hover:bg-(--theme-accent)",
286
+ range_end: "[&>button]:bg-(--theme-accent) [&>button]:text-(--theme-accent-text) [&>button]:hover:bg-(--theme-accent)",
287
+ range_middle: "[&>button]:bg-(--theme-accent-subtle) [&>button]:rounded-none"
288
+ };
289
+ /** The month grid DatePicker opens, for a panel that holds a calendar in place, such as a
290
+ * date filter's picker. Months, weekdays and labels follow the reader's locale. */
291
+ function Calendar({ min, max, defaultMonth, autoFocus = false, ...props }) {
292
+ const t = useStrings().datePicker;
293
+ const { caption, weekday, longDay, longWeekday, weekStartsOn } = formatsFor(useLocale());
294
+ const outOfRange = [...min ? [{ before: min }] : [], ...max ? [{ after: max }] : []];
295
+ const opensOn = defaultMonth ?? (props.mode === "single" ? props.selected : props.selected?.from) ?? min;
296
+ return /* @__PURE__ */ jsx(DayPicker, {
297
+ ...props.mode === "single" ? {
298
+ mode: "single",
299
+ selected: props.selected,
300
+ onSelect: props.onSelect
301
+ } : {
302
+ mode: "range",
303
+ selected: props.selected,
304
+ onSelect: props.onSelect
305
+ },
306
+ ...opensOn && { defaultMonth: opensOn },
307
+ ...min && { startMonth: min },
308
+ ...max && { endMonth: max },
309
+ disabled: outOfRange,
310
+ weekStartsOn,
311
+ autoFocus,
312
+ showOutsideDays: true,
313
+ fixedWeeks: true,
314
+ classNames: props.mode === "range" ? rangeClassNames : calendarClassNames,
315
+ formatters: {
316
+ formatCaption: (month) => caption.format(month),
317
+ formatWeekdayName: (date) => weekday.format(date)
318
+ },
319
+ labels: {
320
+ labelDayButton: (date) => longDay.format(date),
321
+ labelPrevious: () => t.previousMonth,
322
+ labelNext: () => t.nextMonth,
323
+ labelGrid: (month) => caption.format(month),
324
+ labelWeekday: (date) => longWeekday.format(date)
325
+ },
326
+ components: { Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeftIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": "true" }) }
327
+ });
328
+ }
198
329
  //#endregion
199
- export { DatePicker };
330
+ export { Calendar, DatePicker };
@@ -13,22 +13,28 @@ export interface DescriptionListProps extends Omit<ComponentPropsWithoutRef<'dl'
13
13
  * list is too narrow for both side by side. In a DescriptionListGroup, the group's
14
14
  * `stacked` decides. */
15
15
  stacked?: boolean | undefined;
16
+ /** `xs` sets smaller type, for a dense panel of details such as a job's;
17
+ * in a DescriptionListGroup, the group's `size` decides. */
18
+ size?: DescriptionListSize | undefined;
16
19
  /** Styles the box around the list, such as its margins or width. */
17
20
  className?: string | undefined;
18
21
  }
22
+ export type DescriptionListSize = 'sm' | 'xs';
19
23
  /** Names and their values, such as the details of a record in a drawer or a card. The
20
24
  * label column is as wide as its longest label, up to two fifths of the list, so a
21
25
  * long label wraps rather than squeezing the values; each label sits over its value
22
26
  * when the list is narrow. Lists side by side in one panel share their label column
23
27
  * inside a `DescriptionListGroup`. */
24
- export default function DescriptionList({ variant, title, headingLevel, stacked, className, children, ...props }: DescriptionListProps): import("react").JSX.Element;
28
+ export default function DescriptionList({ variant, title, headingLevel, stacked, size: sizeProp, className, children, ...props }: DescriptionListProps): import("react").JSX.Element;
25
29
  /** Description lists in one panel, such as a record's Overview, Actor and Target, that
26
30
  * share one label column: it fits the longest label across all of them, so their
27
31
  * values start at one edge down the panel. Each list keeps its own title and variant;
28
32
  * all of them stack together when the panel is narrow. */
29
- export declare function DescriptionListGroup({ stacked, className, children, }: {
33
+ export declare function DescriptionListGroup({ stacked, size, className, children, }: {
30
34
  /** Puts each label over its value at any width. */
31
35
  stacked?: boolean | undefined;
36
+ /** Every list's type size, so the lists in one panel match. */
37
+ size?: DescriptionListSize | undefined;
32
38
  /** Styles the box around the group, such as its margins or width. */
33
39
  className?: string | undefined;
34
40
  /** `DescriptionList`s. */
@@ -46,7 +52,11 @@ export interface DescriptionListItemProps {
46
52
  /** Adds a button that copies the value: `true` copies its text as shown; a string
47
53
  * copies that instead, such as a full ID behind a shortened one. */
48
54
  copy?: boolean | string | undefined;
55
+ /** Keeps the value to one line, cut off with an ellipsis, and shows it whole
56
+ * on hover, for a long ID or a list of nodes in a dense panel. `copy` still
57
+ * copies all of it. */
58
+ truncate?: boolean | undefined;
49
59
  className?: string | undefined;
50
60
  }
51
61
  /** A label and its value in a DescriptionList. */
52
- export declare function DescriptionListItem({ label, children, tooltip, mono, copy, className, }: DescriptionListItemProps): import("react").JSX.Element;
62
+ export declare function DescriptionListItem({ label, children, tooltip, mono, copy, truncate, className, }: DescriptionListItemProps): import("react").JSX.Element;
@@ -1,11 +1,25 @@
1
1
  import { cx } from "../cx.js";
2
+ import { Tooltip } from "./Tooltip.js";
2
3
  import { useStrings } from "./Provider.js";
3
4
  import { InfoTip } from "./InfoTip.js";
4
5
  import { CopyButton } from "./CopyButton.js";
5
6
  import { withPathBreaks } from "./pathBreaks.js";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { createContext, useContext, useId, useRef } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
9
  //#region src/components/DescriptionList.tsx
10
+ var sizeText = {
11
+ sm: "text-sm",
12
+ xs: "text-xs"
13
+ };
14
+ var sizeLeading = {
15
+ sm: "leading-5",
16
+ xs: "leading-4"
17
+ };
18
+ var sizeMono = {
19
+ sm: "font-mono text-[0.8125rem]",
20
+ xs: "font-mono text-[0.75rem]"
21
+ };
22
+ var SizeContext = createContext(null);
9
23
  var variantClasses = {
10
24
  plain: "*:py-1",
11
25
  divided: "divide-y divide-(--theme-border) *:py-2",
@@ -19,14 +33,18 @@ var titleClassName = "col-span-full m-0 mb-1 text-sm font-semibold text-(--theme
19
33
  * long label wraps rather than squeezing the values; each label sits over its value
20
34
  * when the list is narrow. Lists side by side in one panel share their label column
21
35
  * inside a `DescriptionListGroup`. */
22
- function DescriptionList({ variant = "plain", title, headingLevel = 3, stacked = false, className, children, ...props }) {
36
+ function DescriptionList({ variant = "plain", title, headingLevel = 3, stacked = false, size: sizeProp, className, children, ...props }) {
23
37
  const grouped = useContext(InGroup);
38
+ const size = useContext(SizeContext) ?? sizeProp ?? "sm";
24
39
  const titleId = useId();
25
40
  const Heading = `h${headingLevel}`;
26
41
  const list = /* @__PURE__ */ jsx("dl", {
27
42
  ...props,
28
- className: cx("m-0 text-sm", grouped ? "col-span-full grid grid-cols-subgrid" : columns(stacked), variantClasses[variant]),
29
- children
43
+ className: cx("m-0", sizeText[size], grouped ? "col-span-full grid grid-cols-subgrid" : columns(stacked), variantClasses[variant]),
44
+ children: /* @__PURE__ */ jsx(SizeContext, {
45
+ value: size,
46
+ children
47
+ })
30
48
  });
31
49
  const named = title !== void 0 ? {
32
50
  role: "group",
@@ -52,26 +70,31 @@ function DescriptionList({ variant = "plain", title, headingLevel = 3, stacked =
52
70
  * share one label column: it fits the longest label across all of them, so their
53
71
  * values start at one edge down the panel. Each list keeps its own title and variant;
54
72
  * all of them stack together when the panel is narrow. */
55
- function DescriptionListGroup({ stacked = false, className, children }) {
73
+ function DescriptionListGroup({ stacked = false, size, className, children }) {
56
74
  return /* @__PURE__ */ jsx("div", {
57
75
  className: cx("@container/dl min-w-0", className),
58
76
  children: /* @__PURE__ */ jsx("div", {
59
77
  className: cx(columns(stacked), "gap-y-6"),
60
78
  children: /* @__PURE__ */ jsx(InGroup, {
61
79
  value: true,
62
- children
80
+ children: size ? /* @__PURE__ */ jsx(SizeContext, {
81
+ value: size,
82
+ children
83
+ }) : children
63
84
  })
64
85
  })
65
86
  });
66
87
  }
67
88
  var isEmpty = (value) => value === null || value === void 0 || value === false || value === "";
68
89
  /** A label and its value in a DescriptionList. */
69
- function DescriptionListItem({ label, children, tooltip, mono = false, copy = false, className }) {
90
+ function DescriptionListItem({ label, children, tooltip, mono = false, copy = false, truncate = false, className }) {
70
91
  const labelId = useId();
92
+ const size = useContext(SizeContext) ?? "sm";
93
+ const leading = sizeLeading[size];
71
94
  return /* @__PURE__ */ jsxs("div", {
72
95
  className: cx("col-span-full grid grid-cols-subgrid gap-y-0.5", className),
73
96
  children: [/* @__PURE__ */ jsxs("dt", {
74
- className: "min-w-0 leading-5 wrap-break-word text-(--theme-muted-text-color)",
97
+ className: cx("min-w-0 wrap-break-word text-(--theme-muted-text-color)", leading),
75
98
  children: [/* @__PURE__ */ jsx("span", {
76
99
  id: labelId,
77
100
  children: label
@@ -81,9 +104,17 @@ function DescriptionListItem({ label, children, tooltip, mono = false, copy = fa
81
104
  })]
82
105
  }), /* @__PURE__ */ jsx("dd", {
83
106
  className: "m-0 flex min-w-0 items-start gap-1 text-(--theme-app)",
84
- children: isEmpty(children) ? /* @__PURE__ */ jsx(EmptyValue, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
107
+ children: isEmpty(children) ? /* @__PURE__ */ jsx(EmptyValue, {}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [truncate ? /* @__PURE__ */ jsx(Tooltip, {
108
+ content: children,
109
+ overflowOnly: true,
110
+ children: /* @__PURE__ */ jsx("div", {
111
+ "data-value": true,
112
+ className: cx("min-w-0 truncate", leading, mono && sizeMono[size]),
113
+ children
114
+ })
115
+ }) : /* @__PURE__ */ jsx("div", {
85
116
  "data-value": true,
86
- className: cx("min-w-0 leading-5 wrap-anywhere", mono && "font-mono text-[0.8125rem]"),
117
+ className: cx("min-w-0 wrap-anywhere", leading, mono && sizeMono[size]),
87
118
  children: withPathBreaks(children)
88
119
  }), copy !== false && /* @__PURE__ */ jsx(CopyValue, {
89
120
  text: copy === true ? void 0 : copy,
@@ -96,8 +127,9 @@ function DescriptionListItem({ label, children, tooltip, mono = false, copy = fa
96
127
  var EMPTY_MARK = "—";
97
128
  function EmptyValue() {
98
129
  const { common: t } = useStrings();
130
+ const size = useContext(SizeContext) ?? "sm";
99
131
  return /* @__PURE__ */ jsxs("span", {
100
- className: "leading-5 text-(--theme-muted-text-color)",
132
+ className: cx("text-(--theme-muted-text-color)", sizeLeading[size]),
101
133
  children: [/* @__PURE__ */ jsx("span", {
102
134
  "aria-hidden": "true",
103
135
  children: EMPTY_MARK
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import type { MouseEventHandler, ReactNode } from 'react';
2
2
  /** The height a collapsible panel animates as it opens and closes. It clips
3
3
  * only while it moves, so focus rings and overflowing content show once open. */
4
4
  export declare const collapsePanelClassName = "h-(--collapsible-panel-height) transition-[height,opacity] duration-200 ease-out motion-reduce:transition-none data-starting-style:h-0 data-starting-style:overflow-hidden data-starting-style:opacity-0 data-ending-style:h-0 data-ending-style:overflow-hidden data-ending-style:opacity-0";
@@ -17,12 +17,20 @@ export interface DisclosureProps {
17
17
  summaryClassName?: string | undefined;
18
18
  /** On the revealed detail: its indent and spacing. */
19
19
  panelClassName?: string | undefined;
20
+ /** False drops the chevron, for a row that reads as a toggle on its own, such as a whole
21
+ * list row that opens its detail. */
22
+ chevron?: boolean | undefined;
23
+ /** Controls beside the summary, outside the toggle, so a row can hold buttons without
24
+ * nesting them in it. */
25
+ actions?: ReactNode;
26
+ /** On the whole disclosure, summary and detail, such as a row's own menu. */
27
+ onContextMenu?: MouseEventHandler<HTMLDivElement> | undefined;
20
28
  children: ReactNode;
21
29
  }
22
30
  /** A line inside content that reveals more detail beneath it, such as a tool
23
31
  * call's arguments or a model's reasoning. For a titled part of a page or
24
32
  * form, which belongs in the page's outline, use Section. */
25
- export declare function Disclosure({ summary, open, onOpenChange, defaultOpen, disabled, keepMounted, className, summaryClassName, panelClassName, children, }: DisclosureProps): import("react").JSX.Element;
33
+ export declare function Disclosure({ summary, open, onOpenChange, defaultOpen, disabled, keepMounted, className, summaryClassName, panelClassName, chevron, actions, onContextMenu, children, }: DisclosureProps): import("react").JSX.Element;
26
34
  /** The revealing panel alone, for a toggle that lives elsewhere, such as a
27
35
  * tree row's chevron that names this panel with `aria-controls`. */
28
36
  export declare function DisclosurePanel({ open, id, keepMounted, className, children, }: {
@@ -9,20 +9,31 @@ var collapsePanelClassName = "h-(--collapsible-panel-height) transition-[height,
9
9
  /** A line inside content that reveals more detail beneath it, such as a tool
10
10
  * call's arguments or a model's reasoning. For a titled part of a page or
11
11
  * form, which belongs in the page's outline, use Section. */
12
- function Disclosure({ summary, open, onOpenChange, defaultOpen = false, disabled = false, keepMounted = false, className, summaryClassName, panelClassName, children }) {
12
+ function Disclosure({ summary, open, onOpenChange, defaultOpen = false, disabled = false, keepMounted = false, className, summaryClassName, panelClassName, chevron = true, actions, onContextMenu, children }) {
13
+ const toggle = /* @__PURE__ */ jsxs(Collapsible.Trigger, {
14
+ className: cx("group/disclosure flex min-w-0 items-start gap-2 rounded-sm text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--theme-focus)", disabled ? "cursor-default" : "cursor-pointer", summaryClassName),
15
+ children: [summary, !disabled && chevron && /* @__PURE__ */ jsx(ChevronRightIcon, {
16
+ "aria-hidden": "true",
17
+ className: "mt-1 h-3.5 w-3.5 shrink-0 opacity-70 transition-transform group-data-panel-open/disclosure:rotate-90 motion-reduce:transition-none"
18
+ })]
19
+ });
13
20
  return /* @__PURE__ */ jsxs(Collapsible.Root, {
14
21
  open,
15
22
  onOpenChange: (next) => onOpenChange?.(next),
16
23
  defaultOpen,
17
24
  disabled,
18
25
  className,
19
- children: [/* @__PURE__ */ jsxs(Collapsible.Trigger, {
20
- className: cx("group/disclosure flex min-w-0 items-start gap-2 rounded-sm text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--theme-focus)", disabled ? "cursor-default" : "cursor-pointer", summaryClassName),
21
- children: [summary, !disabled && /* @__PURE__ */ jsx(ChevronRightIcon, {
22
- "aria-hidden": "true",
23
- className: "mt-1 h-3.5 w-3.5 shrink-0 opacity-70 transition-transform group-data-panel-open/disclosure:rotate-90 motion-reduce:transition-none"
26
+ onContextMenu,
27
+ children: [actions ? /* @__PURE__ */ jsxs("div", {
28
+ className: "flex min-w-0 items-center gap-2",
29
+ children: [/* @__PURE__ */ jsx("div", {
30
+ className: "flex min-w-0 flex-1",
31
+ children: toggle
32
+ }), /* @__PURE__ */ jsx("div", {
33
+ className: "flex shrink-0 items-center gap-1",
34
+ children: actions
24
35
  })]
25
- }), /* @__PURE__ */ jsx(Collapsible.Panel, {
36
+ }) : toggle, /* @__PURE__ */ jsx(Collapsible.Panel, {
26
37
  keepMounted,
27
38
  className: cx(collapsePanelClassName, panelClassName),
28
39
  children
@@ -1,12 +1,12 @@
1
1
  import { cx } from "../cx.js";
2
2
  import { ArrowLeftIcon, CloseIcon } from "../icons.js";
3
- import { useFullscreenContainer } from "./fullscreen.js";
3
+ import { usePopupContainer } from "./popupContainer.js";
4
4
  import { useStrings } from "./Provider.js";
5
5
  import { IconButton } from "./IconButton.js";
6
6
  import { closeHandler } from "./dismiss.js";
7
7
  import { useSplitter } from "./splitter.js";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { useLayoutEffect, useRef, useState } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Drawer } from "@base-ui/react/drawer";
11
11
  //#region src/components/Drawer.tsx
12
12
  /** A panel that slides in from an edge over the page. A swipe toward that edge,
@@ -17,7 +17,7 @@ import { Drawer } from "@base-ui/react/drawer";
17
17
  * `--app-inset-start` (a start-side sidebar's width, at least 2.5rem). Set both
18
18
  * on the document root. */
19
19
  function Drawer$1({ open, onClose, title, description, onBack, backLabel, footer, side = "right", width = 480, resizable = false, minWidth = 320, dismissible = true, modal = true, closeButton = true, contained = false, keepMounted = false, padded = true, className, children, ...popupProps }) {
20
- const fullscreen = useFullscreenContainer();
20
+ const portal = usePopupContainer();
21
21
  const { common } = useStrings();
22
22
  const container = useRef(null);
23
23
  const viewport = useRef(null);
@@ -44,9 +44,9 @@ function Drawer$1({ open, onClose, title, description, onBack, backLabel, footer
44
44
  ref: container,
45
45
  className: "contents"
46
46
  }), /* @__PURE__ */ jsxs(Drawer.Portal, {
47
- container: contained ? container : fullscreen,
47
+ container: contained ? container : portal.container,
48
48
  keepMounted,
49
- className: contained ? "contents" : void 0,
49
+ className: contained ? "contents" : portal.className,
50
50
  children: [modal !== false && /* @__PURE__ */ jsx(Drawer.Backdrop, { className: cx(area, "z-(--layer-drawer) bg-black/40 opacity-[calc(1-var(--drawer-swipe-progress))] transition-opacity duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-swiping:duration-0 motion-reduce:transition-none") }), /* @__PURE__ */ jsx(Drawer.Viewport, {
51
51
  ref: viewport,
52
52
  className: cx(area, "pointer-events-none z-(--layer-drawer) flex", side === "right" ? "justify-end pl-[max(var(--app-inset-start,0px),2.5rem)]" : "justify-start pl-(--app-inset-start,0px) pr-10"),
@@ -1,16 +1,24 @@
1
1
  import type { ReactNode } from 'react';
2
+ /** `panel` frames it in a card, standing in for a whole page or list; `plain`
3
+ * gives it the same room with no frame, for a list or page body that holds
4
+ * nothing; `dashed` draws a dashed frame, for a place to add or drop the
5
+ * first item; `bare` is small, inside something that already frames it, such
6
+ * as a sidebar, a menu or a dialog. */
7
+ export type EmptyStateVariant = 'panel' | 'plain' | 'dashed' | 'bare';
2
8
  export interface EmptyStateProps {
3
9
  title: ReactNode;
4
10
  description?: ReactNode;
5
11
  /** What to do about it, such as a create button. */
6
12
  action?: ReactNode;
13
+ /** A glyph for what is missing, drawn bare and faded above the title. */
7
14
  icon?: ReactNode;
8
- /** `panel` stands in for a whole page or list; `bare` sits inside something
9
- * that already frames it, such as a sidebar, a menu or a dialog. */
10
- variant?: 'panel' | 'bare' | undefined;
15
+ variant?: EmptyStateVariant | undefined;
16
+ /** Makes the title a heading at this level, for an empty state that stands
17
+ * in for a section's content; a paragraph otherwise. */
18
+ headingLevel?: 2 | 3 | 4 | undefined;
11
19
  className?: string | undefined;
12
20
  testId?: string | undefined;
13
21
  }
14
22
  /** What shows where there is nothing yet, or nothing matches: what's missing,
15
23
  * and what to do about it. */
16
- export declare function EmptyState({ title, description, action, icon, variant, className, testId, }: EmptyStateProps): import("react").JSX.Element;
24
+ export declare function EmptyState({ title, description, action, icon, variant, headingLevel, className, testId, }: EmptyStateProps): import("react").JSX.Element;