datocms-react-ui 3.1.0-next.0 → 3.1.0-next.1

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 (201) hide show
  1. package/dist/Actions.d.ts +1 -0
  2. package/dist/Actions.js +4 -0
  3. package/dist/IconAvatar.d.ts +2 -0
  4. package/dist/IconAvatar.js +2 -0
  5. package/dist/ListDetail.js +2 -2
  6. package/dist/Pane.js +2 -1
  7. package/dist/SplitPane.js +2 -2
  8. package/dist/react-ui/src/Canvas.d.ts +2 -1
  9. package/dist/react-ui/src/Canvas.js +8 -6
  10. package/dist/react-ui/src/ContextInspector.js +2 -2
  11. package/dist/react-ui/src/messageText.js +1 -1
  12. package/dist/styles.css +330 -195
  13. package/dist/ui/icons/brands/gitlab.js +15 -0
  14. package/dist/ui/icons/custom/netlify.js +7 -29
  15. package/dist/ui/icons/custom/vercel.js +1 -4
  16. package/dist/ui/icons/index.js +206 -195
  17. package/dist/ui/icons/regular/command.js +16 -0
  18. package/dist/ui/icons/regular/keyboard.js +16 -0
  19. package/dist/ui/icons/regular/list-tree.js +2 -1
  20. package/dist/ui/icons/regular/list.js +2 -1
  21. package/dist/ui/icons/regular/memo.js +2 -1
  22. package/dist/ui/locales/en.js +10 -3
  23. package/dist/ui/src/BundledTexts.js +2 -2
  24. package/dist/ui/src/UiTextKey.d.ts +1 -1
  25. package/dist/ui/src/actions/Actions/ActionTooltip.js +24 -0
  26. package/dist/ui/src/actions/Actions/Shortcut.d.ts +23 -0
  27. package/dist/ui/src/actions/Actions/Shortcut.js +45 -0
  28. package/dist/ui/src/actions/Actions/index.d.ts +3 -0
  29. package/dist/ui/src/actions/Actions/index.js +3 -0
  30. package/dist/ui/src/actions/Actions/registry.d.ts +211 -0
  31. package/dist/ui/src/actions/Actions/registry.js +580 -0
  32. package/dist/ui/src/actions/Actions/shortcuts.d.ts +85 -0
  33. package/dist/ui/src/actions/Actions/shortcuts.js +284 -0
  34. package/dist/ui/src/actions/Button.d.ts +13 -12
  35. package/dist/ui/src/actions/Button.js +8 -7
  36. package/dist/ui/src/actions/Dropdown/DropdownContext.js +2 -1
  37. package/dist/ui/src/actions/Dropdown/Footer.js +1 -1
  38. package/dist/ui/src/actions/Dropdown/Menu.d.ts +2 -1
  39. package/dist/ui/src/actions/Dropdown/Menu.js +43 -37
  40. package/dist/ui/src/actions/Dropdown/MenuContent.js +22 -12
  41. package/dist/ui/src/actions/Dropdown/MenuParts.js +3 -3
  42. package/dist/ui/src/actions/Dropdown/Option.d.ts +20 -3
  43. package/dist/ui/src/actions/Dropdown/Option.js +48 -9
  44. package/dist/ui/src/actions/Dropdown/OptionAction.js +1 -1
  45. package/dist/ui/src/actions/Dropdown/Submenu.js +2 -2
  46. package/dist/ui/src/actions/Dropdown/index.d.ts +4 -1
  47. package/dist/ui/src/actions/Dropdown/index.js +6 -4
  48. package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.d.ts +4 -4
  49. package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.js +7 -6
  50. package/dist/ui/src/actions/Dropdown/triggers/PillTrigger.js +1 -1
  51. package/dist/ui/src/actions/Dropdown/triggers/TextualTrigger.js +1 -1
  52. package/dist/ui/src/actions/EditorToolbar/Button.js +2 -2
  53. package/dist/ui/src/actions/EditorToolbar/Buttons.js +2 -2
  54. package/dist/ui/src/actions/EditorToolbar/index.js +1 -1
  55. package/dist/ui/src/actions/MultipleSelectionActionBar.d.ts +20 -3
  56. package/dist/ui/src/actions/MultipleSelectionActionBar.js +25 -7
  57. package/dist/ui/src/actions/SplitButton/Caret.js +1 -1
  58. package/dist/ui/src/actions/SplitButton/index.js +1 -1
  59. package/dist/ui/src/actions/disabledReason.js +1 -1
  60. package/dist/ui/src/content/Avatar.d.ts +5 -3
  61. package/dist/ui/src/content/Avatar.js +4 -3
  62. package/dist/ui/src/content/CodeSnippet.js +1 -1
  63. package/dist/ui/src/content/CopyButton.js +1 -1
  64. package/dist/ui/src/content/CopyableId.d.ts +6 -1
  65. package/dist/ui/src/content/CopyableId.js +5 -2
  66. package/dist/ui/src/content/CopyableValue.js +2 -2
  67. package/dist/ui/src/content/FeedbackDot.js +1 -1
  68. package/dist/ui/src/content/IconAvatar.d.ts +42 -0
  69. package/dist/ui/src/content/IconAvatar.js +36 -0
  70. package/dist/ui/src/content/InitialsAvatar.js +1 -2
  71. package/dist/ui/src/content/Pill.js +3 -3
  72. package/dist/ui/src/content/SmartDate.js +1 -1
  73. package/dist/ui/src/content/UploadThreatTriangle.js +1 -1
  74. package/dist/ui/src/content/UsageMeter.d.ts +2 -1
  75. package/dist/ui/src/content/UsageMeter.js +3 -2
  76. package/dist/ui/src/content/ValidityTriangles.js +3 -3
  77. package/dist/ui/src/feedback/BlankSlate.js +2 -2
  78. package/dist/ui/src/feedback/Callout.js +2 -2
  79. package/dist/ui/src/feedback/ProgressBar.js +1 -1
  80. package/dist/ui/src/form/AutosizeInput.js +1 -1
  81. package/dist/ui/src/form/FieldHint.js +1 -1
  82. package/dist/ui/src/form/FieldWrapper.js +1 -1
  83. package/dist/ui/src/form/InputGroup.js +1 -1
  84. package/dist/ui/src/form/Label.js +2 -2
  85. package/dist/ui/src/form/PasswordInput.js +1 -1
  86. package/dist/ui/src/form/RadioGroupInput.js +1 -1
  87. package/dist/ui/src/form/SelectInput/SelectMenu.js +3 -3
  88. package/dist/ui/src/form/SelectInput/SelectMultiValueRemove.js +7 -0
  89. package/dist/ui/src/form/SelectInput/SelectOption.js +1 -1
  90. package/dist/ui/src/form/SelectInput/SortableMultiValue.js +1 -1
  91. package/dist/ui/src/form/StringInput.js +1 -1
  92. package/dist/ui/src/form/SwitchInput.d.ts +2 -0
  93. package/dist/ui/src/form/SwitchInput.js +4 -3
  94. package/dist/ui/src/form/SwitchList.js +1 -1
  95. package/dist/ui/src/form/TableList.js +2 -2
  96. package/dist/ui/src/form/TextareaInput.js +1 -1
  97. package/dist/ui/src/i18n.js +6 -6
  98. package/dist/ui/src/layout/ListOrOverview.js +3 -3
  99. package/dist/ui/src/layout/Page/Page.js +1 -1
  100. package/dist/ui/src/layout/Page/PageContent.js +1 -1
  101. package/dist/ui/src/layout/Page/PageGroup.js +2 -2
  102. package/dist/ui/src/layout/Page/PageSection.js +1 -1
  103. package/dist/ui/src/layout/Pane/ListFilter.js +6 -12
  104. package/dist/ui/src/layout/Pane/PaneHeader.js +3 -3
  105. package/dist/ui/src/layout/Pane/PaneRegion.d.ts +14 -0
  106. package/dist/ui/src/layout/Pane/PaneRegion.js +23 -0
  107. package/dist/ui/src/layout/Pane/index.d.ts +1 -0
  108. package/dist/ui/src/layout/Pane/index.js +36 -32
  109. package/dist/ui/src/layout/SidebarPanel.js +1 -1
  110. package/dist/ui/src/layout/SplitPane.d.ts +2 -0
  111. package/dist/ui/src/layout/SplitPane.js +79 -37
  112. package/dist/ui/src/layout/SplitView/SashActionButton.js +17 -9
  113. package/dist/ui/src/layout/SplitView/SplitView.js +1 -1
  114. package/dist/ui/src/layout/SplitView/SplitViewSash.js +2 -1
  115. package/dist/ui/src/layout/Toolbar/AddNewButton.d.ts +10 -6
  116. package/dist/ui/src/layout/Toolbar/AddNewButton.js +10 -23
  117. package/dist/ui/src/layout/Toolbar/Divider.d.ts +8 -0
  118. package/dist/ui/src/layout/Toolbar/Divider.js +16 -0
  119. package/dist/ui/src/layout/Toolbar/DotsDropdown.d.ts +8 -1
  120. package/dist/ui/src/layout/Toolbar/DotsDropdown.js +3 -2
  121. package/dist/ui/src/layout/Toolbar/Fill.js +1 -1
  122. package/dist/ui/src/layout/Toolbar/FilterInput.d.ts +7 -3
  123. package/dist/ui/src/layout/Toolbar/FilterInput.js +62 -49
  124. package/dist/ui/src/layout/Toolbar/FilterToggle.d.ts +6 -4
  125. package/dist/ui/src/layout/Toolbar/FilterToggle.js +42 -7
  126. package/dist/ui/src/layout/Toolbar/GoBack.d.ts +6 -1
  127. package/dist/ui/src/layout/Toolbar/GoBack.js +12 -5
  128. package/dist/ui/src/layout/Toolbar/Group.js +1 -1
  129. package/dist/ui/src/layout/Toolbar/Help.js +3 -3
  130. package/dist/ui/src/layout/Toolbar/Pagination.js +2 -2
  131. package/dist/ui/src/layout/Toolbar/PresetsTitle.js +3 -3
  132. package/dist/ui/src/layout/Toolbar/PrimaryButton.d.ts +3 -3
  133. package/dist/ui/src/layout/Toolbar/PrimaryButton.js +2 -2
  134. package/dist/ui/src/layout/Toolbar/Root.d.ts +6 -1
  135. package/dist/ui/src/layout/Toolbar/Root.js +13 -2
  136. package/dist/ui/src/layout/Toolbar/Search.d.ts +2 -1
  137. package/dist/ui/src/layout/Toolbar/Search.js +8 -3
  138. package/dist/ui/src/layout/Toolbar/context.js +2 -1
  139. package/dist/ui/src/layout/Toolbar/index.d.ts +5 -3
  140. package/dist/ui/src/layout/Toolbar/index.js +2 -0
  141. package/dist/ui/src/lists/CardList.d.ts +7 -2
  142. package/dist/ui/src/lists/CardList.js +7 -6
  143. package/dist/ui/src/lists/EmptySlot.js +2 -2
  144. package/dist/ui/src/lists/EntityRow.js +1 -1
  145. package/dist/ui/src/lists/InfoList.js +8 -3
  146. package/dist/ui/src/lists/InsertGap.js +4 -4
  147. package/dist/ui/src/lists/MediaCard.d.ts +10 -0
  148. package/dist/ui/src/lists/MediaCard.js +9 -4
  149. package/dist/ui/src/lists/RowList.js +2 -2
  150. package/dist/ui/src/lists/SettingsList.js +1 -1
  151. package/dist/ui/src/lists/Table/Body.js +1 -1
  152. package/dist/ui/src/lists/Table/Cell.js +1 -1
  153. package/dist/ui/src/lists/Table/ColumnsMenu.js +1 -1
  154. package/dist/ui/src/lists/Table/Header.js +8 -10
  155. package/dist/ui/src/lists/Table/HeaderCell.js +2 -2
  156. package/dist/ui/src/lists/Table/Row.d.ts +7 -1
  157. package/dist/ui/src/lists/Table/Row.js +6 -2
  158. package/dist/ui/src/lists/Table/Table.js +1 -1
  159. package/dist/ui/src/lists/Table/TreeToggle.js +1 -1
  160. package/dist/ui/src/lists/Table/index.d.ts +1 -1
  161. package/dist/ui/src/lists/Table/layout.d.ts +3 -2
  162. package/dist/ui/src/lists/Table/layout.js +26 -13
  163. package/dist/ui/src/lists/dnd/DragHandle.js +1 -1
  164. package/dist/ui/src/lists/dnd/DropIndicator.js +1 -1
  165. package/dist/ui/src/lists/dnd/SortableList.js +2 -2
  166. package/dist/ui/src/lists/dnd/tree/SortableTree.js +1 -1
  167. package/dist/ui/src/navigation/Chevron.js +2 -2
  168. package/dist/ui/src/navigation/SegmentedControl.d.ts +23 -4
  169. package/dist/ui/src/navigation/SegmentedControl.js +23 -5
  170. package/dist/ui/src/navigation/SettingsMenu.js +3 -3
  171. package/dist/ui/src/navigation/SidebarTree/SidebarTreeNode.js +3 -3
  172. package/dist/ui/src/navigation/SidebarTree/SidebarTreeNodeActions.js +1 -1
  173. package/dist/ui/src/navigation/Tabs.js +1 -1
  174. package/dist/ui/src/overlays/FullscreenModal.js +48 -53
  175. package/dist/ui/src/overlays/HoverCard.js +4 -4
  176. package/dist/ui/src/overlays/Modal.d.ts +7 -0
  177. package/dist/ui/src/overlays/Modal.js +53 -55
  178. package/dist/ui/src/overlays/Popover.d.ts +6 -3
  179. package/dist/ui/src/overlays/Popover.js +13 -8
  180. package/dist/ui/src/overlays/Portal.js +1 -1
  181. package/dist/ui/src/overlays/Tooltip.d.ts +6 -3
  182. package/dist/ui/src/overlays/Tooltip.js +29 -13
  183. package/dist/ui/src/overlays/useModalClose.js +17 -12
  184. package/dist/ui/src/patterns/ListDetail/Page.d.ts +9 -0
  185. package/dist/ui/src/patterns/ListDetail/Page.js +33 -26
  186. package/dist/ui/src/patterns/ListDetail/Panel.js +4 -2
  187. package/dist/ui/src/patterns/ListDetail/Split.d.ts +5 -0
  188. package/dist/ui/src/patterns/ListDetail/Split.js +75 -56
  189. package/dist/ui/src/patterns/ListDetail/index.d.ts +2 -2
  190. package/dist/ui/src/patterns/ListDetail/index.js +2 -2
  191. package/dist/ui/src/patterns/ListFormPage.js +2 -2
  192. package/dist/ui/src/semantic/Main.d.ts +4 -1
  193. package/dist/ui/src/semantic/Main.js +53 -3
  194. package/dist/ui/src/semantic/NavigationFocusProvider.js +9 -0
  195. package/package.json +1 -1
  196. package/dist/HotKey.d.ts +0 -1
  197. package/dist/HotKey.js +0 -2
  198. package/dist/ui/src/actions/HotKey.d.ts +0 -98
  199. package/dist/ui/src/actions/HotKey.js +0 -270
  200. package/dist/ui/src/actions/hotKeyContext.d.ts +0 -32
  201. package/dist/ui/src/actions/hotKeyContext.js +0 -15
@@ -0,0 +1,14 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const PaneRegionProvider: import("react").Provider<RefObject<HTMLElement | null> | undefined>;
3
+ /**
4
+ * The element of the Pane around the component, for `useRegisterActions`:
5
+ * the actions are on while the pointer or the focus is in the pane.
6
+ * `undefined` out of a Pane.
7
+ */
8
+ export declare function usePaneRegion(): RefObject<HTMLElement | null> | undefined;
9
+ export declare const CollectionRegionProvider: import("react").Provider<RefObject<HTMLElement | null> | undefined>;
10
+ /**
11
+ * The element of the split around the list of the component, for the keys
12
+ * that filter the list. `undefined` out of the list of a split.
13
+ */
14
+ export declare function useCollectionRegion(): RefObject<HTMLElement | null> | undefined;
@@ -0,0 +1,23 @@
1
+ import { createContext, useContext } from "react";
2
+ //#region ../ui/src/layout/Pane/PaneRegion.tsx
3
+ var PaneRegionContext = createContext(void 0);
4
+ var PaneRegionProvider = PaneRegionContext.Provider;
5
+ /**
6
+ * The element of the Pane around the component, for `useRegisterActions`:
7
+ * the actions are on while the pointer or the focus is in the pane.
8
+ * `undefined` out of a Pane.
9
+ */
10
+ function usePaneRegion() {
11
+ return useContext(PaneRegionContext);
12
+ }
13
+ var CollectionRegionContext = createContext(void 0);
14
+ var CollectionRegionProvider = CollectionRegionContext.Provider;
15
+ /**
16
+ * The element of the split around the list of the component, for the keys
17
+ * that filter the list. `undefined` out of the list of a split.
18
+ */
19
+ function useCollectionRegion() {
20
+ return useContext(CollectionRegionContext);
21
+ }
22
+ //#endregion
23
+ export { CollectionRegionProvider, PaneRegionProvider, useCollectionRegion, usePaneRegion };
@@ -3,6 +3,7 @@ import { type TextMessage } from '../../Message.js';
3
3
  export { useFilteredList } from './ListFilter.js';
4
4
  export type { ListPreset, ListPresetOption, ListPresetsProps, } from './ListPresets.js';
5
5
  export { usePaneAriaLabel } from './PaneAriaLabel.js';
6
+ export { usePaneRegion } from './PaneRegion.js';
6
7
  export type PaneProps = PropsWithChildren<{
7
8
  /**
8
9
  * The label of the parts of the pane that get none of their own (the
@@ -1,14 +1,15 @@
1
1
  import { useTranslation } from "../../i18n.js";
2
2
  import Spinner_default from "../../feedback/Spinner.js";
3
3
  import { useAutoincrementIntegerId } from "../../hooks/useAutoincrementIntegerId.js";
4
+ import { PaneRegionProvider, usePaneRegion } from "./PaneRegion.js";
4
5
  import { PaneAriaLabelProvider, usePaneAriaLabel } from "./PaneAriaLabel.js";
5
6
  import FormHeader_default from "./FormHeader.js";
6
7
  import { FilterBlankSlate, useFilteredList } from "./ListFilter.js";
7
8
  import { PaneTitleIdProvider } from "./PaneTitleId.js";
8
9
  import PaneHeader_default from "./PaneHeader.js";
9
10
  import React, { useEffect, useRef } from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import classNames from "classnames";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
12
13
  //#region ../ui/src/layout/Pane/index.tsx
13
14
  /**
14
15
  * A box with the full height of its place: a fixed header (a Pane.Header or
@@ -57,36 +58,39 @@ function Pane({ children, ariaLabel, className, busy, header, mode, slideUpToolb
57
58
  value: ariaLabel ? tm(ariaLabel) : "",
58
59
  children: /* @__PURE__ */ jsx(PaneTitleIdProvider, {
59
60
  value: titleId,
60
- children: /* @__PURE__ */ jsxs("div", {
61
- ref,
62
- className: classNames("Pane", className, { "Pane--mode": mode }),
63
- children: [
64
- header && /* @__PURE__ */ jsx("div", {
65
- className: "Pane__header",
66
- children: header
67
- }),
68
- busy && /* @__PURE__ */ jsx(Spinner_default.Overlay, {
69
- veil: false,
70
- className: "Pane__overlay"
71
- }),
72
- /* @__PURE__ */ jsx("div", {
73
- ref: contentRef,
74
- className: "Pane__content",
75
- role: tabPanel ? "tabpanel" : mode ? "group" : void 0,
76
- id: tabPanel?.id,
77
- "aria-labelledby": tabPanel?.labelledBy ?? (mode ? titleId : void 0),
78
- tabIndex: -1,
79
- children
80
- }),
81
- slideUpToolbar && /* @__PURE__ */ jsx("div", {
82
- className: "Pane__slideUpToolbar",
83
- children: slideUpToolbar
84
- }),
85
- footer && /* @__PURE__ */ jsx("div", {
86
- className: "Pane__footer",
87
- children: footer
88
- })
89
- ]
61
+ children: /* @__PURE__ */ jsx(PaneRegionProvider, {
62
+ value: ref,
63
+ children: /* @__PURE__ */ jsxs("div", {
64
+ ref,
65
+ className: classNames("Pane", className, { "Pane--mode": mode }),
66
+ children: [
67
+ header && /* @__PURE__ */ jsx("div", {
68
+ className: "Pane__header",
69
+ children: header
70
+ }),
71
+ busy && /* @__PURE__ */ jsx(Spinner_default.Overlay, {
72
+ veil: false,
73
+ className: "Pane__overlay"
74
+ }),
75
+ /* @__PURE__ */ jsx("div", {
76
+ ref: contentRef,
77
+ className: "Pane__content",
78
+ role: tabPanel ? "tabpanel" : mode ? "group" : void 0,
79
+ id: tabPanel?.id,
80
+ "aria-labelledby": tabPanel?.labelledBy ?? (mode ? titleId : void 0),
81
+ tabIndex: -1,
82
+ children
83
+ }),
84
+ slideUpToolbar && /* @__PURE__ */ jsx("div", {
85
+ className: "Pane__slideUpToolbar",
86
+ children: slideUpToolbar
87
+ }),
88
+ footer && /* @__PURE__ */ jsx("div", {
89
+ className: "Pane__footer",
90
+ children: footer
91
+ })
92
+ ]
93
+ })
90
94
  })
91
95
  })
92
96
  });
@@ -97,4 +101,4 @@ var Pane_default = Object.assign(React.memo(Pane), {
97
101
  FilterBlankSlate
98
102
  });
99
103
  //#endregion
100
- export { Pane_default as default, useFilteredList, usePaneAriaLabel };
104
+ export { Pane_default as default, useFilteredList, usePaneAriaLabel, usePaneRegion };
@@ -5,8 +5,8 @@ import Heading from "../semantic/Heading.js";
5
5
  import { DisclosureChevron } from "../navigation/Chevron.js";
6
6
  import { useInMemorySidebarPanelOpen, useLocalStorageSidebarPanelOpen } from "./sidebarPanelStorage.js";
7
7
  import { useMemo, useState } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import classNames from "classnames";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  //#region ../ui/src/layout/SidebarPanel.tsx
11
11
  var nextContentId = 0;
12
12
  /**
@@ -63,6 +63,8 @@ export type SplitPaneCollapse = {
63
63
  */
64
64
  wrapToggle?: (toggle: React.ReactElement) => React.ReactNode;
65
65
  };
66
+ export declare const TOGGLE_LEFT_SIDEBAR_ACTION_ID = "sidebar.toggleLeft";
67
+ export declare const TOGGLE_RIGHT_SIDEBAR_ACTION_ID = "sidebar.toggleRight";
66
68
  export declare const DEFAULT_SECONDARY_SIZE = 220;
67
69
  export declare function useIsInSecondaryPane(): boolean;
68
70
  export declare function useSecondaryPaneMinSize(minSize: number | undefined): void;
@@ -1,16 +1,19 @@
1
+ import { Generic, Misc, Navigation } from "../../icons/index.js";
2
+ import { useRegisterActions } from "../actions/Actions/registry.js";
1
3
  import { useTranslation } from "../i18n.js";
2
4
  import NewZIndex from "../overlays/NewZIndex.js";
3
- import Tooltip from "../overlays/Tooltip.js";
4
5
  import RawButton from "../semantic/RawButton.js";
5
- import { HotKeyListener } from "../actions/HotKey.js";
6
- import { Misc, Navigation } from "../../icons/index.js";
6
+ import { ActionTooltip } from "../actions/Actions/ActionTooltip.js";
7
7
  import { mouseHoverProps } from "../utils/mouseHoverProps.js";
8
+ import { CollectionRegionProvider } from "./Pane/PaneRegion.js";
8
9
  import { useSashActionReveal } from "./SplitView/SashActionButton.js";
9
10
  import SplitView_default from "./SplitView/SplitView.js";
10
11
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import classNames from "classnames";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
13
14
  //#region ../ui/src/layout/SplitPane.tsx
15
+ var TOGGLE_LEFT_SIDEBAR_ACTION_ID = "sidebar.toggleLeft";
16
+ var TOGGLE_RIGHT_SIDEBAR_ACTION_ID = "sidebar.toggleRight";
14
17
  var DEFAULT_SECONDARY_SIZE = 220;
15
18
  var InSecondaryPaneContext = createContext(false);
16
19
  function useIsInSecondaryPane() {
@@ -117,9 +120,33 @@ function SplitPane({ mode = "split", minSize: minSizeProp = 200, maxSize, size:
117
120
  });
118
121
  const isSecondaryVisible = !isSecondaryCollapsed || isPeeking;
119
122
  const isFloating = isOverlayModeActive && isSecondaryVisible || isPeeking;
123
+ useRegisterActions([{
124
+ id: "splitPane.closeFloating",
125
+ name: { id: "sidebar.hide" },
126
+ shortcut: { key: "escape" },
127
+ palette: "hidden",
128
+ applicable: () => isFloating,
129
+ run: handleEscape
130
+ }]);
131
+ const rootRef = useRef(null);
132
+ const secondaryHostRef = useRef(null);
133
+ const railRef = useRef(null);
134
+ const toggleActionId = secondarySide === "left" ? TOGGLE_LEFT_SIDEBAR_ACTION_ID : TOGGLE_RIGHT_SIDEBAR_ACTION_ID;
135
+ const focusRailOnCollapse = useFocusRailOnCollapse(Boolean(isSecondaryCollapsed), railRef);
136
+ useRegisterActions(collapse ? [{
137
+ id: toggleActionId,
138
+ name: { id: secondarySide === "left" ? "sidebar.toggleLeft" : "sidebar.toggleRight" },
139
+ icon: secondarySide === "left" ? Generic.SidebarIcon : Misc.SidebarFlipIcon,
140
+ shortcut: { key: secondarySide === "left" ? "[" : "]" },
141
+ run: () => {
142
+ if (secondaryHostRef.current?.contains(document.activeElement)) focusRailOnCollapse();
143
+ handleSecondaryClick();
144
+ }
145
+ }] : []);
120
146
  const railLabel = isPeeking ? "sidebar.keepOpen" : isSecondaryCollapsed ? "sidebar.show" : "sidebar.hide";
121
147
  function renderRail(pane) {
122
- const icon = SashActionIcon && /* @__PURE__ */ jsx(Tooltip, {
148
+ const icon = SashActionIcon && /* @__PURE__ */ jsx(ActionTooltip, {
149
+ action: toggleActionId,
123
150
  label: { id: railLabel },
124
151
  placement: pane === "left" ? "right" : "left",
125
152
  children: /* @__PURE__ */ jsx("span", {
@@ -129,6 +156,7 @@ function SplitPane({ mode = "split", minSize: minSizeProp = 200, maxSize, size:
129
156
  });
130
157
  const railIcon = icon && collapse?.wrapToggle ? collapse.wrapToggle(icon) : icon;
131
158
  return /* @__PURE__ */ jsx(RawButton, {
159
+ ref: railRef,
132
160
  className: classNames("SplitPane__rail", `SplitPane__rail--${pane}`, isFloating && "SplitPane__rail--active"),
133
161
  ariaLabel: t(railLabel),
134
162
  expandable: { open: !isSecondaryCollapsed },
@@ -146,7 +174,10 @@ function SplitPane({ mode = "split", minSize: minSizeProp = 200, maxSize, size:
146
174
  value: false,
147
175
  children: /* @__PURE__ */ jsx(SecondaryPaneMinSizeContext.Provider, {
148
176
  value: void 0,
149
- children: children[pane === "left" ? 0 : 1]
177
+ children: /* @__PURE__ */ jsx(CollectionRegionProvider, {
178
+ value: void 0,
179
+ children: children[pane === "left" ? 0 : 1]
180
+ })
150
181
  })
151
182
  }) });
152
183
  return /* @__PURE__ */ jsx(SplitView_default.Pane, {
@@ -160,6 +191,7 @@ function SplitPane({ mode = "split", minSize: minSizeProp = 200, maxSize, size:
160
191
  function renderSecondaryHost(panes, baseZIndex) {
161
192
  if (!isSecondaryVisible) return null;
162
193
  return /* @__PURE__ */ jsx("div", {
194
+ ref: secondaryHostRef,
163
195
  className: isFloating ? classNames("SplitPaneOverlay", showsRail && `SplitPaneOverlay--${secondarySide}`, isPeeking && "SplitPaneOverlay--peek") : "SplitPane__secondary-host",
164
196
  onClick: isFloating && !isPeeking ? handleSecondaryClick : void 0,
165
197
  ...isFloating ? {} : sashActionReveal.paneHoverProps,
@@ -182,44 +214,54 @@ function SplitPane({ mode = "split", minSize: minSizeProp = 200, maxSize, size:
182
214
  value: true,
183
215
  children: /* @__PURE__ */ jsx(SecondaryPaneMinSizeContext.Provider, {
184
216
  value: requestMinSize,
185
- children: children[secondaryIndex]
217
+ children: /* @__PURE__ */ jsx(CollectionRegionProvider, {
218
+ value: rootRef,
219
+ children: children[secondaryIndex]
220
+ })
186
221
  })
187
222
  })
188
223
  })
189
224
  });
190
225
  }
191
- return /* @__PURE__ */ jsx(NewZIndex, { children: (baseZIndex) => /* @__PURE__ */ jsx(HotKeyListener, {
192
- hotKey: "escape",
193
- description: { id: "hotkeys.closeModal" },
194
- trigger: handleEscape,
195
- enabled: isFloating,
196
- children: /* @__PURE__ */ jsx("div", {
197
- className: classNames("SplitPane", isSizeAnimated && "SplitPane--size-animated"),
198
- style: ROOT_STYLE,
199
- children: /* @__PURE__ */ jsxs(SplitView_default, {
200
- allowResize: isSecondaryDocked,
201
- sizes,
202
- onChange: handleChange,
203
- onDragEnd: handleDragEnd,
204
- sashZIndex: SashActionIcon ? 10 : void 0,
205
- sashAction: SashActionIcon && isSecondaryDocked ? {
206
- icon: SashActionIcon,
207
- label: { id: "sidebar.hide" },
208
- expandable: { open: true },
209
- wrap: collapse?.wrapToggle,
210
- onClick: handleSecondaryClick,
211
- hidden: !sashActionReveal.isVisible,
212
- revealFrom: secondarySide,
213
- onHoverChange: sashActionReveal.onActionHoverChange
214
- } : void 0,
215
- collapsiblePaneIndex: collapse ? secondaryIndex : void 0,
216
- onCollapseByDrag: collapse ? handleCollapseByDrag : void 0,
217
- renderOverPanes: (panes) => renderSecondaryHost(panes, baseZIndex),
218
- children: [renderPane("left"), renderPane("right")]
219
- })
226
+ return /* @__PURE__ */ jsx(NewZIndex, { children: (baseZIndex) => /* @__PURE__ */ jsx("div", {
227
+ ref: rootRef,
228
+ className: classNames("SplitPane", isSizeAnimated && "SplitPane--size-animated"),
229
+ style: ROOT_STYLE,
230
+ children: /* @__PURE__ */ jsxs(SplitView_default, {
231
+ allowResize: isSecondaryDocked,
232
+ sizes,
233
+ onChange: handleChange,
234
+ onDragEnd: handleDragEnd,
235
+ sashZIndex: SashActionIcon ? 10 : void 0,
236
+ sashAction: SashActionIcon && isSecondaryDocked ? {
237
+ icon: SashActionIcon,
238
+ label: { id: "sidebar.hide" },
239
+ expandable: { open: true },
240
+ action: toggleActionId,
241
+ wrap: collapse?.wrapToggle,
242
+ onClick: handleSecondaryClick,
243
+ hidden: !sashActionReveal.isVisible,
244
+ revealFrom: secondarySide,
245
+ onHoverChange: sashActionReveal.onActionHoverChange
246
+ } : void 0,
247
+ collapsiblePaneIndex: collapse ? secondaryIndex : void 0,
248
+ onCollapseByDrag: collapse ? handleCollapseByDrag : void 0,
249
+ renderOverPanes: (panes) => renderSecondaryHost(panes, baseZIndex),
250
+ children: [renderPane("left"), renderPane("right")]
220
251
  })
221
252
  }) });
222
253
  }
254
+ function useFocusRailOnCollapse(isCollapsed, railRef) {
255
+ const pending = useRef(false);
256
+ useEffect(() => {
257
+ if (!isCollapsed || !pending.current) return;
258
+ pending.current = false;
259
+ railRef.current?.focus();
260
+ }, [isCollapsed, railRef]);
261
+ return useCallback(() => {
262
+ pending.current = true;
263
+ }, []);
264
+ }
223
265
  var PEEK_OPEN_DELAY = 200;
224
266
  var PEEK_CLOSE_DELAY = 300;
225
267
  function usePeek(canPeek) {
@@ -274,4 +316,4 @@ function useRailDrag(side, onOpen) {
274
316
  };
275
317
  }
276
318
  //#endregion
277
- export { DEFAULT_SECONDARY_SIZE, SplitPane as default, useIsInSecondaryPane, useSecondaryPaneMinSize };
319
+ export { DEFAULT_SECONDARY_SIZE, TOGGLE_LEFT_SIDEBAR_ACTION_ID, TOGGLE_RIGHT_SIDEBAR_ACTION_ID, SplitPane as default, useIsInSecondaryPane, useSecondaryPaneMinSize };
@@ -1,12 +1,13 @@
1
1
  import { useTranslation } from "../../i18n.js";
2
- import Tooltip from "../../overlays/Tooltip.js";
3
2
  import RawButton from "../../semantic/RawButton.js";
3
+ import { ActionTooltip } from "../../actions/Actions/ActionTooltip.js";
4
+ import Tooltip from "../../overlays/Tooltip.js";
4
5
  import { mouseHoverProps } from "../../utils/mouseHoverProps.js";
5
6
  import { useDebounceOnBoolean } from "../../hooks/useDebounceOnBoolean.js";
6
7
  import { stopPropagation } from "../../utils/events.js";
7
8
  import React, { useState } from "react";
8
- import { jsx } from "react/jsx-runtime";
9
9
  import classNames from "classnames";
10
+ import { jsx } from "react/jsx-runtime";
10
11
  //#region ../ui/src/layout/SplitView/SashActionButton.tsx
11
12
  var SHOW_DELAY = 500;
12
13
  var HIDE_DELAY = 400;
@@ -23,9 +24,14 @@ function useSashActionReveal(isActive) {
23
24
  onActionHoverChange: setPointerOnAction
24
25
  };
25
26
  }
26
- function SashActionButton({ icon: Icon, label, onClick, expandable, revealFrom, hidden = false, onHoverChange, className }) {
27
+ function SashActionButton({ icon: Icon, label, onClick, expandable, action, revealFrom, hidden = false, onHoverChange, className }) {
27
28
  const { tm } = useTranslation();
28
29
  const labelText = tm(label);
30
+ const placement = revealFrom === "right" ? "left" : revealFrom === "left" ? "right" : "top";
31
+ const button = /* @__PURE__ */ jsx("span", {
32
+ className: "SplitViewSash__content__button",
33
+ children: /* @__PURE__ */ jsx(Icon, {})
34
+ });
29
35
  return /* @__PURE__ */ jsx(RawButton, {
30
36
  className: classNames("SplitViewSash__content", revealFrom && `SplitViewSash__content--reveal-from-${revealFrom}`, hidden && "SplitViewSash__content--hidden", className),
31
37
  ariaLabel: labelText,
@@ -35,13 +41,15 @@ function SashActionButton({ icon: Icon, label, onClick, expandable, revealFrom,
35
41
  onPointerDown: stopPropagation,
36
42
  onClick: () => onClick(),
37
43
  ...onHoverChange && mouseHoverProps(onHoverChange),
38
- children: /* @__PURE__ */ jsx(Tooltip, {
44
+ children: action ? /* @__PURE__ */ jsx(ActionTooltip, {
45
+ action,
46
+ label: labelText,
47
+ placement,
48
+ children: button
49
+ }) : /* @__PURE__ */ jsx(Tooltip, {
39
50
  label: labelText,
40
- placement: revealFrom === "right" ? "left" : revealFrom === "left" ? "right" : "top",
41
- children: /* @__PURE__ */ jsx("span", {
42
- className: "SplitViewSash__content__button",
43
- children: /* @__PURE__ */ jsx(Icon, {})
44
- })
51
+ placement,
52
+ children: button
45
53
  })
46
54
  });
47
55
  }
@@ -1,8 +1,8 @@
1
1
  import SplitViewPane from "./SplitViewPane.js";
2
2
  import SplitViewSash from "./SplitViewSash.js";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import classNames from "classnames";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region ../ui/src/layout/SplitView/SplitView.tsx
7
7
  var SplitView = ({ children, sizes: propSizes, allowResize = true, split = "vertical", resizerSize = 10, performanceMode = false, onChange = () => null, onDragStart = () => null, onDragEnd = () => null, sashAction, sashZIndex, collapsiblePaneIndex, onCollapseByDrag, renderOverPanes }) => {
8
8
  const axis = useRef({
@@ -1,7 +1,7 @@
1
1
  import SashActionButton_default from "./SashActionButton.js";
2
2
  import { useState } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
3
  import classNames from "classnames";
4
+ import { jsx } from "react/jsx-runtime";
5
5
  //#region ../ui/src/layout/SplitView/SplitViewSash.tsx
6
6
  function SplitViewSash({ onMouseDown, onMouseMove, onMouseUp, style, split, allowResize, action }) {
7
7
  const [dragging, setDrag] = useState(false);
@@ -28,6 +28,7 @@ function SplitViewSash({ onMouseDown, onMouseMove, onMouseUp, style, split, allo
28
28
  label: action.label,
29
29
  onClick: action.onClick,
30
30
  expandable: action.expandable,
31
+ action: action.action,
31
32
  revealFrom: action.revealFrom,
32
33
  hidden: action.hidden,
33
34
  onHoverChange: action.onHoverChange
@@ -12,11 +12,6 @@ type ExtraAction = {
12
12
  export type AddNewButtonProps = {
13
13
  /** The text of the button ("Add new webhook") */
14
14
  label: TextMessage;
15
- /**
16
- * The description of the hotkey. The default is the label. Give a
17
- * different text when the label has placeholders.
18
- */
19
- hotKeyDescription?: TextMessage;
20
15
  /**
21
16
  * The full URL of the page of the new item (the app adds its prefixes,
22
17
  * for example the environment)
@@ -31,7 +26,16 @@ export type AddNewButtonProps = {
31
26
  icon?: SvgIcon;
32
27
  /** Other "add" actions. They show in a menu next to the button. */
33
28
  extraActions?: ExtraAction[];
29
+ /**
30
+ * The id of the action of the button: its name and its keys show in the
31
+ * tooltip (see the "action" tooltip of Button)
32
+ */
33
+ action?: string;
34
34
  };
35
- declare function AddNewButton({ label, hotKeyDescription, to, disabled, icon: customIcon, extraActions, }: AddNewButtonProps): React.JSX.Element;
35
+ /**
36
+ * The PrimaryButton that adds an item to a list. In the toolbar of a
37
+ * secondary pane, it shows only its icon.
38
+ */
39
+ declare function AddNewButton({ label, to, disabled, icon: customIcon, extraActions, action, }: AddNewButtonProps): React.JSX.Element;
36
40
  declare const _default: React.MemoExoticComponent<typeof AddNewButton>;
37
41
  export default _default;
@@ -1,28 +1,21 @@
1
+ import { Generic } from "../../../icons/index.js";
1
2
  import { useTranslation } from "../../i18n.js";
2
- import { useNavigation } from "../../navigation/NavigationProvider.js";
3
3
  import { InToolbarContext } from "./context.js";
4
- import { HotKeyListener } from "../../actions/HotKey.js";
5
- import { Generic } from "../../../icons/index.js";
6
4
  import { useIsInSecondaryPane } from "../SplitPane.js";
7
5
  import PrimaryButton from "./PrimaryButton.js";
8
- import React, { useCallback, useContext, useMemo } from "react";
6
+ import React, { useContext, useMemo } from "react";
9
7
  import { jsx } from "react/jsx-runtime";
10
8
  //#region ../ui/src/layout/Toolbar/AddNewButton.tsx
11
9
  /**
12
- * The PrimaryButton that adds an item to a list, with the hotkey ⌘⇧N. In
13
- * the toolbar of a secondary pane, it shows only its icon.
10
+ * The PrimaryButton that adds an item to a list. In the toolbar of a
11
+ * secondary pane, it shows only its icon.
14
12
  */
15
- var HOT_KEY = "mod+shift+n";
16
- function AddNewButton({ label, hotKeyDescription, to, disabled, icon: customIcon, extraActions }) {
13
+ function AddNewButton({ label, to, disabled, icon: customIcon, extraActions, action }) {
17
14
  const { tm } = useTranslation();
18
- const { navigate } = useNavigation();
19
15
  const isInSecondaryPane = useIsInSecondaryPane();
20
16
  const iconOnly = useContext(InToolbarContext) && isInSecondaryPane;
21
17
  const icon = customIcon ?? Generic.AddIcon;
22
18
  const labelText = tm(label);
23
- const handleAdd = useCallback(() => {
24
- navigate(to);
25
- }, [navigate, to]);
26
19
  const actions = useMemo(() => [{
27
20
  to,
28
21
  label: labelText,
@@ -38,17 +31,11 @@ function AddNewButton({ label, hotKeyDescription, to, disabled, icon: customIcon
38
31
  extraActions,
39
32
  tm
40
33
  ]);
41
- return /* @__PURE__ */ jsx(HotKeyListener, {
42
- hotKey: HOT_KEY,
43
- description: hotKeyDescription ?? label,
44
- enabled: !disabled,
45
- trigger: handleAdd,
46
- children: /* @__PURE__ */ jsx(PrimaryButton, {
47
- disabled,
48
- actions,
49
- hotKey: true,
50
- iconOnly
51
- })
34
+ return /* @__PURE__ */ jsx(PrimaryButton, {
35
+ disabled,
36
+ actions,
37
+ action,
38
+ iconOnly
52
39
  });
53
40
  }
54
41
  var AddNewButton_default = React.memo(AddNewButton);
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * A hairline between two parts of a filter row that must read as separate
4
+ * cells (for example the text filter and the filters of the fields). It takes
5
+ * the full height of the cells, and at least the height of a field.
6
+ */
7
+ declare function Divider(): React.JSX.Element;
8
+ export default Divider;
@@ -0,0 +1,16 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region ../ui/src/layout/Toolbar/Divider.tsx
4
+ /**
5
+ * A hairline between two parts of a filter row that must read as separate
6
+ * cells (for example the text filter and the filters of the fields). It takes
7
+ * the full height of the cells, and at least the height of a field.
8
+ */
9
+ function Divider() {
10
+ return /* @__PURE__ */ jsx("div", {
11
+ className: "Toolbar__divider",
12
+ "aria-hidden": "true"
13
+ });
14
+ }
15
+ //#endregion
16
+ export { Divider as default };
@@ -1,13 +1,20 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { type TextMessage } from '../../Message.js';
2
3
  export type DotsDropdownProps = {
3
4
  /** The Dropdown.Option elements of the menu */
4
5
  children: ReactNode;
5
6
  /** The menu does not show (give it when no option applies) */
6
7
  hidden?: boolean;
8
+ /**
9
+ * The name of the button and the text of its tooltip. Name the thing that
10
+ * the menu acts on, for example "Actions for Hello world".
11
+ * @default "Actions"
12
+ */
13
+ label?: TextMessage;
7
14
  };
8
15
  /**
9
16
  * The "⋮" menu of the actions on the thing that the toolbar shows. Put it
10
17
  * right after the title (and the subtitle), never at the right end.
11
18
  */
12
- declare function DotsDropdown({ children, hidden }: DotsDropdownProps): React.JSX.Element | null;
19
+ declare function DotsDropdown({ children, hidden, label }: DotsDropdownProps): React.JSX.Element | null;
13
20
  export default DotsDropdown;
@@ -1,5 +1,5 @@
1
- import { ToolbarMenuProviderContext } from "./context.js";
2
1
  import { Generic } from "../../../icons/index.js";
2
+ import { ToolbarMenuProviderContext } from "./context.js";
3
3
  import { Dropdown } from "../../actions/Dropdown/index.js";
4
4
  import { useContext } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -8,7 +8,7 @@ import { jsx } from "react/jsx-runtime";
8
8
  * The "⋮" menu of the actions on the thing that the toolbar shows. Put it
9
9
  * right after the title (and the subtitle), never at the right end.
10
10
  */
11
- function DotsDropdown({ children, hidden }) {
11
+ function DotsDropdown({ children, hidden, label }) {
12
12
  const MenuProvider = useContext(ToolbarMenuProviderContext);
13
13
  if (hidden) return null;
14
14
  return /* @__PURE__ */ jsx("div", {
@@ -16,6 +16,7 @@ function DotsDropdown({ children, hidden }) {
16
16
  children: /* @__PURE__ */ jsx(MenuProvider, { children: /* @__PURE__ */ jsx(Dropdown, {
17
17
  triggerComponent: Dropdown.IconTrigger,
18
18
  icon: Generic.ActionToggleIcon,
19
+ label,
19
20
  children: () => /* @__PURE__ */ jsx(Dropdown.Menu, { children })
20
21
  }) })
21
22
  });
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import classNames from "classnames";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  //#region ../ui/src/layout/Toolbar/Fill.tsx
5
5
  /**
6
6
  * A part that takes all the free width of the toolbar (for example a filter
@@ -7,7 +7,8 @@ export type FilterInputProps = {
7
7
  onChange: (value: string) => void;
8
8
  /**
9
9
  * The name of the search landmark: what the field filters. Without it,
10
- * the ariaLabel of the Pane.
10
+ * the ariaLabel of the Pane. In a Toolbar.Search, the filter has no
11
+ * landmark of its own and does not use it.
11
12
  */
12
13
  ariaLabel?: TextMessage;
13
14
  /**
@@ -28,7 +29,10 @@ export type FilterInputProps = {
28
29
  */
29
30
  onClose?: () => void;
30
31
  };
31
- /** The text filter of a list, with a magnifier and a "✕" that clears it */
32
- declare function FilterInput({ value, onChange, ariaLabel, autoFocus, debounce, disabled, onClose, }: FilterInputProps): React.JSX.Element;
32
+ /**
33
+ * The text filter of a list, with a magnifier and a "✕" that clears it. It is
34
+ * a search landmark, except in a Toolbar.Search (the text cell of a form).
35
+ */
36
+ declare function FilterInput({ ariaLabel, ...props }: FilterInputProps): React.JSX.Element;
33
37
  declare const _default: React.MemoExoticComponent<typeof FilterInput>;
34
38
  export default _default;