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.
- package/dist/Actions.d.ts +1 -0
- package/dist/Actions.js +4 -0
- package/dist/IconAvatar.d.ts +2 -0
- package/dist/IconAvatar.js +2 -0
- package/dist/ListDetail.js +2 -2
- package/dist/Pane.js +2 -1
- package/dist/SplitPane.js +2 -2
- package/dist/react-ui/src/Canvas.d.ts +2 -1
- package/dist/react-ui/src/Canvas.js +8 -6
- package/dist/react-ui/src/ContextInspector.js +2 -2
- package/dist/react-ui/src/messageText.js +1 -1
- package/dist/styles.css +330 -195
- package/dist/ui/icons/brands/gitlab.js +15 -0
- package/dist/ui/icons/custom/netlify.js +7 -29
- package/dist/ui/icons/custom/vercel.js +1 -4
- package/dist/ui/icons/index.js +206 -195
- package/dist/ui/icons/regular/command.js +16 -0
- package/dist/ui/icons/regular/keyboard.js +16 -0
- package/dist/ui/icons/regular/list-tree.js +2 -1
- package/dist/ui/icons/regular/list.js +2 -1
- package/dist/ui/icons/regular/memo.js +2 -1
- package/dist/ui/locales/en.js +10 -3
- package/dist/ui/src/BundledTexts.js +2 -2
- package/dist/ui/src/UiTextKey.d.ts +1 -1
- package/dist/ui/src/actions/Actions/ActionTooltip.js +24 -0
- package/dist/ui/src/actions/Actions/Shortcut.d.ts +23 -0
- package/dist/ui/src/actions/Actions/Shortcut.js +45 -0
- package/dist/ui/src/actions/Actions/index.d.ts +3 -0
- package/dist/ui/src/actions/Actions/index.js +3 -0
- package/dist/ui/src/actions/Actions/registry.d.ts +211 -0
- package/dist/ui/src/actions/Actions/registry.js +580 -0
- package/dist/ui/src/actions/Actions/shortcuts.d.ts +85 -0
- package/dist/ui/src/actions/Actions/shortcuts.js +284 -0
- package/dist/ui/src/actions/Button.d.ts +13 -12
- package/dist/ui/src/actions/Button.js +8 -7
- package/dist/ui/src/actions/Dropdown/DropdownContext.js +2 -1
- package/dist/ui/src/actions/Dropdown/Footer.js +1 -1
- package/dist/ui/src/actions/Dropdown/Menu.d.ts +2 -1
- package/dist/ui/src/actions/Dropdown/Menu.js +43 -37
- package/dist/ui/src/actions/Dropdown/MenuContent.js +22 -12
- package/dist/ui/src/actions/Dropdown/MenuParts.js +3 -3
- package/dist/ui/src/actions/Dropdown/Option.d.ts +20 -3
- package/dist/ui/src/actions/Dropdown/Option.js +48 -9
- package/dist/ui/src/actions/Dropdown/OptionAction.js +1 -1
- package/dist/ui/src/actions/Dropdown/Submenu.js +2 -2
- package/dist/ui/src/actions/Dropdown/index.d.ts +4 -1
- package/dist/ui/src/actions/Dropdown/index.js +6 -4
- package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.d.ts +4 -4
- package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.js +7 -6
- package/dist/ui/src/actions/Dropdown/triggers/PillTrigger.js +1 -1
- package/dist/ui/src/actions/Dropdown/triggers/TextualTrigger.js +1 -1
- package/dist/ui/src/actions/EditorToolbar/Button.js +2 -2
- package/dist/ui/src/actions/EditorToolbar/Buttons.js +2 -2
- package/dist/ui/src/actions/EditorToolbar/index.js +1 -1
- package/dist/ui/src/actions/MultipleSelectionActionBar.d.ts +20 -3
- package/dist/ui/src/actions/MultipleSelectionActionBar.js +25 -7
- package/dist/ui/src/actions/SplitButton/Caret.js +1 -1
- package/dist/ui/src/actions/SplitButton/index.js +1 -1
- package/dist/ui/src/actions/disabledReason.js +1 -1
- package/dist/ui/src/content/Avatar.d.ts +5 -3
- package/dist/ui/src/content/Avatar.js +4 -3
- package/dist/ui/src/content/CodeSnippet.js +1 -1
- package/dist/ui/src/content/CopyButton.js +1 -1
- package/dist/ui/src/content/CopyableId.d.ts +6 -1
- package/dist/ui/src/content/CopyableId.js +5 -2
- package/dist/ui/src/content/CopyableValue.js +2 -2
- package/dist/ui/src/content/FeedbackDot.js +1 -1
- package/dist/ui/src/content/IconAvatar.d.ts +42 -0
- package/dist/ui/src/content/IconAvatar.js +36 -0
- package/dist/ui/src/content/InitialsAvatar.js +1 -2
- package/dist/ui/src/content/Pill.js +3 -3
- package/dist/ui/src/content/SmartDate.js +1 -1
- package/dist/ui/src/content/UploadThreatTriangle.js +1 -1
- package/dist/ui/src/content/UsageMeter.d.ts +2 -1
- package/dist/ui/src/content/UsageMeter.js +3 -2
- package/dist/ui/src/content/ValidityTriangles.js +3 -3
- package/dist/ui/src/feedback/BlankSlate.js +2 -2
- package/dist/ui/src/feedback/Callout.js +2 -2
- package/dist/ui/src/feedback/ProgressBar.js +1 -1
- package/dist/ui/src/form/AutosizeInput.js +1 -1
- package/dist/ui/src/form/FieldHint.js +1 -1
- package/dist/ui/src/form/FieldWrapper.js +1 -1
- package/dist/ui/src/form/InputGroup.js +1 -1
- package/dist/ui/src/form/Label.js +2 -2
- package/dist/ui/src/form/PasswordInput.js +1 -1
- package/dist/ui/src/form/RadioGroupInput.js +1 -1
- package/dist/ui/src/form/SelectInput/SelectMenu.js +3 -3
- package/dist/ui/src/form/SelectInput/SelectMultiValueRemove.js +7 -0
- package/dist/ui/src/form/SelectInput/SelectOption.js +1 -1
- package/dist/ui/src/form/SelectInput/SortableMultiValue.js +1 -1
- package/dist/ui/src/form/StringInput.js +1 -1
- package/dist/ui/src/form/SwitchInput.d.ts +2 -0
- package/dist/ui/src/form/SwitchInput.js +4 -3
- package/dist/ui/src/form/SwitchList.js +1 -1
- package/dist/ui/src/form/TableList.js +2 -2
- package/dist/ui/src/form/TextareaInput.js +1 -1
- package/dist/ui/src/i18n.js +6 -6
- package/dist/ui/src/layout/ListOrOverview.js +3 -3
- package/dist/ui/src/layout/Page/Page.js +1 -1
- package/dist/ui/src/layout/Page/PageContent.js +1 -1
- package/dist/ui/src/layout/Page/PageGroup.js +2 -2
- package/dist/ui/src/layout/Page/PageSection.js +1 -1
- package/dist/ui/src/layout/Pane/ListFilter.js +6 -12
- package/dist/ui/src/layout/Pane/PaneHeader.js +3 -3
- package/dist/ui/src/layout/Pane/PaneRegion.d.ts +14 -0
- package/dist/ui/src/layout/Pane/PaneRegion.js +23 -0
- package/dist/ui/src/layout/Pane/index.d.ts +1 -0
- package/dist/ui/src/layout/Pane/index.js +36 -32
- package/dist/ui/src/layout/SidebarPanel.js +1 -1
- package/dist/ui/src/layout/SplitPane.d.ts +2 -0
- package/dist/ui/src/layout/SplitPane.js +79 -37
- package/dist/ui/src/layout/SplitView/SashActionButton.js +17 -9
- package/dist/ui/src/layout/SplitView/SplitView.js +1 -1
- package/dist/ui/src/layout/SplitView/SplitViewSash.js +2 -1
- package/dist/ui/src/layout/Toolbar/AddNewButton.d.ts +10 -6
- package/dist/ui/src/layout/Toolbar/AddNewButton.js +10 -23
- package/dist/ui/src/layout/Toolbar/Divider.d.ts +8 -0
- package/dist/ui/src/layout/Toolbar/Divider.js +16 -0
- package/dist/ui/src/layout/Toolbar/DotsDropdown.d.ts +8 -1
- package/dist/ui/src/layout/Toolbar/DotsDropdown.js +3 -2
- package/dist/ui/src/layout/Toolbar/Fill.js +1 -1
- package/dist/ui/src/layout/Toolbar/FilterInput.d.ts +7 -3
- package/dist/ui/src/layout/Toolbar/FilterInput.js +62 -49
- package/dist/ui/src/layout/Toolbar/FilterToggle.d.ts +6 -4
- package/dist/ui/src/layout/Toolbar/FilterToggle.js +42 -7
- package/dist/ui/src/layout/Toolbar/GoBack.d.ts +6 -1
- package/dist/ui/src/layout/Toolbar/GoBack.js +12 -5
- package/dist/ui/src/layout/Toolbar/Group.js +1 -1
- package/dist/ui/src/layout/Toolbar/Help.js +3 -3
- package/dist/ui/src/layout/Toolbar/Pagination.js +2 -2
- package/dist/ui/src/layout/Toolbar/PresetsTitle.js +3 -3
- package/dist/ui/src/layout/Toolbar/PrimaryButton.d.ts +3 -3
- package/dist/ui/src/layout/Toolbar/PrimaryButton.js +2 -2
- package/dist/ui/src/layout/Toolbar/Root.d.ts +6 -1
- package/dist/ui/src/layout/Toolbar/Root.js +13 -2
- package/dist/ui/src/layout/Toolbar/Search.d.ts +2 -1
- package/dist/ui/src/layout/Toolbar/Search.js +8 -3
- package/dist/ui/src/layout/Toolbar/context.js +2 -1
- package/dist/ui/src/layout/Toolbar/index.d.ts +5 -3
- package/dist/ui/src/layout/Toolbar/index.js +2 -0
- package/dist/ui/src/lists/CardList.d.ts +7 -2
- package/dist/ui/src/lists/CardList.js +7 -6
- package/dist/ui/src/lists/EmptySlot.js +2 -2
- package/dist/ui/src/lists/EntityRow.js +1 -1
- package/dist/ui/src/lists/InfoList.js +8 -3
- package/dist/ui/src/lists/InsertGap.js +4 -4
- package/dist/ui/src/lists/MediaCard.d.ts +10 -0
- package/dist/ui/src/lists/MediaCard.js +9 -4
- package/dist/ui/src/lists/RowList.js +2 -2
- package/dist/ui/src/lists/SettingsList.js +1 -1
- package/dist/ui/src/lists/Table/Body.js +1 -1
- package/dist/ui/src/lists/Table/Cell.js +1 -1
- package/dist/ui/src/lists/Table/ColumnsMenu.js +1 -1
- package/dist/ui/src/lists/Table/Header.js +8 -10
- package/dist/ui/src/lists/Table/HeaderCell.js +2 -2
- package/dist/ui/src/lists/Table/Row.d.ts +7 -1
- package/dist/ui/src/lists/Table/Row.js +6 -2
- package/dist/ui/src/lists/Table/Table.js +1 -1
- package/dist/ui/src/lists/Table/TreeToggle.js +1 -1
- package/dist/ui/src/lists/Table/index.d.ts +1 -1
- package/dist/ui/src/lists/Table/layout.d.ts +3 -2
- package/dist/ui/src/lists/Table/layout.js +26 -13
- package/dist/ui/src/lists/dnd/DragHandle.js +1 -1
- package/dist/ui/src/lists/dnd/DropIndicator.js +1 -1
- package/dist/ui/src/lists/dnd/SortableList.js +2 -2
- package/dist/ui/src/lists/dnd/tree/SortableTree.js +1 -1
- package/dist/ui/src/navigation/Chevron.js +2 -2
- package/dist/ui/src/navigation/SegmentedControl.d.ts +23 -4
- package/dist/ui/src/navigation/SegmentedControl.js +23 -5
- package/dist/ui/src/navigation/SettingsMenu.js +3 -3
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNode.js +3 -3
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNodeActions.js +1 -1
- package/dist/ui/src/navigation/Tabs.js +1 -1
- package/dist/ui/src/overlays/FullscreenModal.js +48 -53
- package/dist/ui/src/overlays/HoverCard.js +4 -4
- package/dist/ui/src/overlays/Modal.d.ts +7 -0
- package/dist/ui/src/overlays/Modal.js +53 -55
- package/dist/ui/src/overlays/Popover.d.ts +6 -3
- package/dist/ui/src/overlays/Popover.js +13 -8
- package/dist/ui/src/overlays/Portal.js +1 -1
- package/dist/ui/src/overlays/Tooltip.d.ts +6 -3
- package/dist/ui/src/overlays/Tooltip.js +29 -13
- package/dist/ui/src/overlays/useModalClose.js +17 -12
- package/dist/ui/src/patterns/ListDetail/Page.d.ts +9 -0
- package/dist/ui/src/patterns/ListDetail/Page.js +33 -26
- package/dist/ui/src/patterns/ListDetail/Panel.js +4 -2
- package/dist/ui/src/patterns/ListDetail/Split.d.ts +5 -0
- package/dist/ui/src/patterns/ListDetail/Split.js +75 -56
- package/dist/ui/src/patterns/ListDetail/index.d.ts +2 -2
- package/dist/ui/src/patterns/ListDetail/index.js +2 -2
- package/dist/ui/src/patterns/ListFormPage.js +2 -2
- package/dist/ui/src/semantic/Main.d.ts +4 -1
- package/dist/ui/src/semantic/Main.js +53 -3
- package/dist/ui/src/semantic/NavigationFocusProvider.js +9 -0
- package/package.json +1 -1
- package/dist/HotKey.d.ts +0 -1
- package/dist/HotKey.js +0 -2
- package/dist/ui/src/actions/HotKey.d.ts +0 -98
- package/dist/ui/src/actions/HotKey.js +0 -270
- package/dist/ui/src/actions/hotKeyContext.d.ts +0 -32
- 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__ */
|
|
61
|
-
ref,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 {
|
|
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(
|
|
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:
|
|
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:
|
|
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(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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(
|
|
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
|
|
41
|
-
children:
|
|
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
|
-
|
|
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, {
|
|
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
|
|
13
|
-
*
|
|
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
|
-
|
|
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(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
/**
|
|
32
|
-
|
|
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;
|