datocms-react-ui 3.1.0-next.2 → 3.1.0-next.3
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/Tooltip.js +2 -2
- package/dist/react-ui/src/Canvas.js +2 -2
- package/dist/react-ui/src/ContextInspector.js +1 -1
- package/dist/styles.css +6 -4
- package/dist/ui-public/icons/index.js +296 -292
- package/dist/ui-public/icons/regular/arrow-down-from-line.js +16 -0
- package/dist/ui-public/icons/regular/arrow-up-from-line.js +16 -0
- package/dist/ui-public/locales/en.js +1 -1
- package/dist/ui-public/src/actions/Button.js +1 -1
- package/dist/ui-public/src/actions/Dropdown/Option.js +2 -2
- package/dist/ui-public/src/actions/Dropdown/OptionAction.js +1 -1
- package/dist/ui-public/src/actions/Dropdown/triggers/ButtonTrigger.js +1 -1
- package/dist/ui-public/src/actions/EditorToolbar/Button.js +1 -1
- package/dist/ui-public/src/actions/MultipleSelectionActionBar.js +1 -1
- package/dist/ui-public/src/actions/disabledReason.js +1 -1
- package/dist/ui-public/src/content/CopyableId.js +1 -1
- package/dist/ui-public/src/content/Pill.js +1 -1
- package/dist/ui-public/src/layout/Pane/PaneHeader.d.ts +4 -0
- package/dist/ui-public/src/layout/Pane/PaneHeader.js +6 -0
- package/dist/ui-public/src/layout/Pane/index.d.ts +3 -0
- package/dist/ui-public/src/layout/SplitView/SashActionButton.js +1 -1
- package/dist/ui-public/src/layout/Toolbar/FilterInput.js +1 -1
- package/dist/ui-public/src/layout/Toolbar/GoBack.d.ts +1 -1
- package/dist/ui-public/src/layout/Toolbar/Root.js +1 -1
- package/dist/ui-public/src/lists/InsertGap/parts.js +1 -1
- package/dist/ui-public/src/navigation/SegmentedControl.js +1 -1
- package/dist/ui-public/src/overlays/HoverCard/index.js +8 -2
- package/dist/ui-public/src/overlays/HoverDelayGroup.js +41 -0
- package/dist/ui-public/src/overlays/Modal/index.js +1 -1
- package/dist/ui-public/src/overlays/Portal.js +1 -1
- package/dist/ui-public/src/overlays/Tooltip/index.d.ts +1 -8
- package/dist/ui-public/src/overlays/Tooltip/index.js +8 -16
- package/dist/ui-public/src/patterns/ListDetail/Page.d.ts +6 -1
- package/dist/ui-public/src/patterns/ListDetail/Page.js +2 -1
- package/dist/ui-public/src/patterns/ListDetail/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region ../ui-public/icons/regular/arrow-down-from-line.svg?react
|
|
4
|
+
var SvgArrowDownFromLine = (props, ref) => /* @__PURE__ */ jsx("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 384 512",
|
|
7
|
+
width: "1em",
|
|
8
|
+
height: "1em",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
ref,
|
|
11
|
+
...props,
|
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M174.5 472.4c4.5 4.8 10.9 7.6 17.5 7.6s12.9-2.7 17.5-7.6l128-136c9.1-9.7 8.6-24.8-1-33.9s-24.8-8.6-33.9 1L216 395.5l0-83.5 0-128c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 128 0 83.5L81.5 303.6c-9.1-9.7-24.3-10.1-33.9-1s-10.1 24.3-1 33.9l128 136zM360 80c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 32C10.7 32 0 42.7 0 56S10.7 80 24 80l336 0z" })
|
|
13
|
+
});
|
|
14
|
+
var ForwardRef = forwardRef(SvgArrowDownFromLine);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ForwardRef as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region ../ui-public/icons/regular/arrow-up-from-line.svg?react
|
|
4
|
+
var SvgArrowUpFromLine = (props, ref) => /* @__PURE__ */ jsx("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 384 512",
|
|
7
|
+
width: "1em",
|
|
8
|
+
height: "1em",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
ref,
|
|
11
|
+
...props,
|
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M209.5 39.6C204.9 34.7 198.6 32 192 32s-12.9 2.7-17.5 7.6l-128 136c-9.1 9.7-8.6 24.8 1 33.9s24.8 8.6 33.9-1L168 116.5l0 83.5 0 128c0 13.3 10.7 24 24 24s24-10.7 24-24l0-128 0-83.5 86.5 91.9c9.1 9.7 24.3 10.1 33.9 1s10.1-24.3 1-33.9l-128-136zM24 432c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 432z" })
|
|
13
|
+
});
|
|
14
|
+
var ForwardRef = forwardRef(SvgArrowUpFromLine);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ForwardRef as default };
|
|
@@ -103,7 +103,7 @@ var en_default = {
|
|
|
103
103
|
"splitButton.moreActions": "More actions",
|
|
104
104
|
"table.row.loading": "Loading",
|
|
105
105
|
"tableList.removeRow": "Remove row",
|
|
106
|
-
"toolbar.goBack": "Go back to the
|
|
106
|
+
"toolbar.goBack": "Go back to the list",
|
|
107
107
|
"toolbar.help": "About this page",
|
|
108
108
|
"toolbar.learnMore": "Learn more",
|
|
109
109
|
"upload.threatDetected": "Threat detected",
|
|
@@ -2,10 +2,10 @@ import { isHtmlMessage, isIntlMessage } from "../Message.js";
|
|
|
2
2
|
import { useTranslation } from "../i18n.js";
|
|
3
3
|
import Spinner_default from "../feedback/Spinner.js";
|
|
4
4
|
import Link from "../navigation/Link.js";
|
|
5
|
+
import Tooltip from "../overlays/Tooltip/index.js";
|
|
5
6
|
import RawButton from "../semantic/RawButton.js";
|
|
6
7
|
import { ActionTooltip } from "./Actions/ActionTooltip.js";
|
|
7
8
|
import { DisabledReasonTooltip, disabledReasonOf } from "./disabledReason.js";
|
|
8
|
-
import Tooltip from "../overlays/Tooltip/index.js";
|
|
9
9
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -12,7 +12,6 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState }
|
|
|
12
12
|
import classNames from "classnames";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import mergeRefs from "@react-hook/merged-ref";
|
|
15
|
-
import cuid from "cuid";
|
|
16
15
|
import { test } from "fuzzyjs";
|
|
17
16
|
//#region ../ui-public/src/actions/Dropdown/Option.tsx
|
|
18
17
|
/**
|
|
@@ -36,8 +35,9 @@ function useOptionAction(id, rootRef) {
|
|
|
36
35
|
rootRef
|
|
37
36
|
]);
|
|
38
37
|
}
|
|
38
|
+
var nextOptionId = 0;
|
|
39
39
|
var Option = React.forwardRef(({ onPick: onPickProp, action, to, href, newTab, active, forceHover, alert, invalid, children, sortable, disabled: disabledProp, closeMenuOnClick, checkbox, actions, icon, keywords, submenu }, ref) => {
|
|
40
|
-
const id =
|
|
40
|
+
const [id] = useState(() => `Dropdown__option-${++nextOptionId}`);
|
|
41
41
|
const { closeMenu, setCloseOnClickOutside, rootRef, triggerId } = useContext(DropdownContext);
|
|
42
42
|
const registryAction = useOptionAction(action, rootRef);
|
|
43
43
|
const onPick = registryAction ? registryAction.onPick : onPickProp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslation } from "../../i18n.js";
|
|
2
|
-
import RawButton from "../../semantic/RawButton.js";
|
|
3
2
|
import Tooltip from "../../overlays/Tooltip/index.js";
|
|
3
|
+
import RawButton from "../../semantic/RawButton.js";
|
|
4
4
|
import DropdownContext from "./DropdownContext.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useTranslation } from "../../../i18n.js";
|
|
2
|
+
import Tooltip from "../../../overlays/Tooltip/index.js";
|
|
2
3
|
import { ActionTooltip } from "../../Actions/ActionTooltip.js";
|
|
3
4
|
import { disabledReasonOf } from "../../disabledReason.js";
|
|
4
5
|
import { buttonClassName, useButtonSize } from "../../Button.js";
|
|
5
|
-
import Tooltip from "../../../overlays/Tooltip/index.js";
|
|
6
6
|
import { MenuChevron } from "../../../navigation/Chevron.js";
|
|
7
7
|
import DropdownTriggerButton_default from "./DropdownTriggerButton.js";
|
|
8
8
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslation } from "../../i18n.js";
|
|
2
|
-
import RawButton from "../../semantic/RawButton.js";
|
|
3
2
|
import Tooltip from "../../overlays/Tooltip/index.js";
|
|
3
|
+
import RawButton from "../../semantic/RawButton.js";
|
|
4
4
|
import { createContext, useContext } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -3,8 +3,8 @@ import { useRunAction } from "./Actions/registry.js";
|
|
|
3
3
|
import { useTranslation } from "../i18n.js";
|
|
4
4
|
import { useIsSmallViewport } from "../hooks/useMediaQuery.js";
|
|
5
5
|
import NewZIndex from "../overlays/NewZIndex.js";
|
|
6
|
-
import Button, { buttonClassName } from "./Button.js";
|
|
7
6
|
import Portal from "../overlays/Portal.js";
|
|
7
|
+
import Button, { buttonClassName } from "./Button.js";
|
|
8
8
|
import { MenuChevron } from "../navigation/Chevron.js";
|
|
9
9
|
import DropdownTriggerButton_default from "./Dropdown/triggers/DropdownTriggerButton.js";
|
|
10
10
|
import { Dropdown } from "./Dropdown/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslation } from "../i18n.js";
|
|
2
|
-
import HoverCard_default from "../overlays/HoverCard/index.js";
|
|
3
2
|
import Tooltip from "../overlays/Tooltip/index.js";
|
|
3
|
+
import HoverCard_default from "../overlays/HoverCard/index.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../ui-public/src/actions/disabledReason.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAction } from "../actions/Actions/registry.js";
|
|
2
2
|
import { useTranslation } from "../i18n.js";
|
|
3
|
-
import RawButton from "../semantic/RawButton.js";
|
|
4
3
|
import Tooltip from "../overlays/Tooltip/index.js";
|
|
4
|
+
import RawButton from "../semantic/RawButton.js";
|
|
5
5
|
import { useCopyToClipboard } from "../hooks/useCopyToClipboard.js";
|
|
6
6
|
import IdText from "./IdText.js";
|
|
7
7
|
import React from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Link from "../navigation/Link.js";
|
|
2
|
-
import RawButton from "../semantic/RawButton.js";
|
|
3
2
|
import Tooltip from "../overlays/Tooltip/index.js";
|
|
3
|
+
import RawButton from "../semantic/RawButton.js";
|
|
4
4
|
import { pillClassName } from "./pillClassName.js";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
@@ -46,6 +46,9 @@ declare function Subtitle(_props: {
|
|
|
46
46
|
declare function Menu(_props: {
|
|
47
47
|
children: ReactNode;
|
|
48
48
|
}): null;
|
|
49
|
+
declare function Display(_props: {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}): null;
|
|
49
52
|
declare function Spinner(): null;
|
|
50
53
|
declare function Button(_props: {
|
|
51
54
|
children: ReactNode;
|
|
@@ -58,6 +61,7 @@ declare const _default: React.NamedExoticComponent<PaneHeaderProps> & {
|
|
|
58
61
|
Tabs: typeof Tabs;
|
|
59
62
|
Subtitle: typeof Subtitle;
|
|
60
63
|
Menu: typeof Menu;
|
|
64
|
+
Display: typeof Display;
|
|
61
65
|
Spinner: typeof Spinner;
|
|
62
66
|
Button: typeof Button;
|
|
63
67
|
};
|
|
@@ -17,6 +17,9 @@ function Subtitle(_props) {
|
|
|
17
17
|
function Menu(_props) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
+
function Display(_props) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
20
23
|
function Spinner() {
|
|
21
24
|
return null;
|
|
22
25
|
}
|
|
@@ -60,6 +63,7 @@ function PaneHeader({ filter, children }) {
|
|
|
60
63
|
const tabs = findPart(children, Tabs);
|
|
61
64
|
const subtitle = findPart(children, Subtitle);
|
|
62
65
|
const menu = findPart(children, Menu);
|
|
66
|
+
const display = findPart(children, Display);
|
|
63
67
|
const spinner = findPart(children, Spinner);
|
|
64
68
|
const button = findPart(children, Button);
|
|
65
69
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -86,6 +90,7 @@ function PaneHeader({ filter, children }) {
|
|
|
86
90
|
className: "Toolbar__title-menu",
|
|
87
91
|
children: /* @__PURE__ */ jsx(Toolbar.DotsDropdown, { children: menu.props.children })
|
|
88
92
|
}),
|
|
93
|
+
display?.props.children,
|
|
89
94
|
/* @__PURE__ */ jsx(Toolbar.Spinner, { show: Boolean(spinner) }),
|
|
90
95
|
/* @__PURE__ */ jsx(Toolbar.Space, {}),
|
|
91
96
|
listFilter && /* @__PURE__ */ jsx(ListFilterButton, {
|
|
@@ -104,6 +109,7 @@ var PaneHeader_default = Object.assign(React.memo(PaneHeader), {
|
|
|
104
109
|
Tabs,
|
|
105
110
|
Subtitle,
|
|
106
111
|
Menu,
|
|
112
|
+
Display,
|
|
107
113
|
Spinner,
|
|
108
114
|
Button
|
|
109
115
|
});
|
|
@@ -145,6 +145,9 @@ declare const _default: React.NamedExoticComponent<{
|
|
|
145
145
|
Menu: (_props: {
|
|
146
146
|
children: ReactNode;
|
|
147
147
|
}) => null;
|
|
148
|
+
Display: (_props: {
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
}) => null;
|
|
148
151
|
Spinner: () => null;
|
|
149
152
|
Button: (_props: {
|
|
150
153
|
children: ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslation } from "../../i18n.js";
|
|
2
|
+
import Tooltip from "../../overlays/Tooltip/index.js";
|
|
2
3
|
import RawButton from "../../semantic/RawButton.js";
|
|
3
4
|
import { ActionTooltip } from "../../actions/Actions/ActionTooltip.js";
|
|
4
|
-
import Tooltip from "../../overlays/Tooltip/index.js";
|
|
5
5
|
import { mouseHoverProps } from "../../utils/mouseHoverProps.js";
|
|
6
6
|
import { useDebounceOnBoolean } from "../../hooks/useDebounceOnBoolean.js";
|
|
7
7
|
import { stopPropagation } from "../../utils/events.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Generic } from "../../../icons/index.js";
|
|
2
2
|
import { useTranslation } from "../../i18n.js";
|
|
3
|
-
import Button from "../../actions/Button.js";
|
|
4
3
|
import { InSearchContext } from "./context.js";
|
|
4
|
+
import Button from "../../actions/Button.js";
|
|
5
5
|
import DebouncedTextInput_default from "../../form/DebouncedTextInput.js";
|
|
6
6
|
import Search from "../../semantic/Search.js";
|
|
7
7
|
import { usePaneAriaLabel } from "../Pane/PaneAriaLabel.js";
|
|
@@ -18,7 +18,7 @@ type GoBackButton = {
|
|
|
18
18
|
export type GoBackProps = (GoBackLink | GoBackButton) & {
|
|
19
19
|
/**
|
|
20
20
|
* The name of the chevron for screen readers
|
|
21
|
-
* @default { id: 'toolbar.goBack' } ("Go back to the
|
|
21
|
+
* @default { id: 'toolbar.goBack' } ("Go back to the list")
|
|
22
22
|
*/
|
|
23
23
|
ariaLabel?: TextMessage;
|
|
24
24
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonSizeContext } from "../../actions/Button.js";
|
|
2
1
|
import { InToolbarContext } from "./context.js";
|
|
2
|
+
import { ButtonSizeContext } from "../../actions/Button.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Generic } from "../../../icons/index.js";
|
|
2
2
|
import { useTranslation } from "../../i18n.js";
|
|
3
|
-
import RawButton from "../../semantic/RawButton.js";
|
|
4
3
|
import Tooltip from "../../overlays/Tooltip/index.js";
|
|
4
|
+
import RawButton from "../../semantic/RawButton.js";
|
|
5
5
|
import DropdownContext from "../../actions/Dropdown/DropdownContext.js";
|
|
6
6
|
import { useContext } from "react";
|
|
7
7
|
import classNames from "classnames";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslation } from "../i18n.js";
|
|
2
|
+
import Tooltip from "../overlays/Tooltip/index.js";
|
|
2
3
|
import RawButton from "../semantic/RawButton.js";
|
|
3
4
|
import { useButtonSize } from "../actions/Button.js";
|
|
4
|
-
import Tooltip from "../overlays/Tooltip/index.js";
|
|
5
5
|
import { useRovingKeyDown } from "../hooks/useRovingKeyDown.js";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import classNames from "classnames";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { useHoverDelay } from "../HoverDelayGroup.js";
|
|
1
2
|
import { cloneTrigger } from "../floatingTrigger.js";
|
|
2
3
|
import NewZIndex from "../NewZIndex.js";
|
|
3
|
-
import HoverCardSurface from "./Surface.js";
|
|
4
4
|
import Portal from "../Portal.js";
|
|
5
5
|
import { floatingMiddleware } from "../Popover.js";
|
|
6
|
+
import HoverCardSurface from "./Surface.js";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { autoUpdate, safePolygon, useDismiss, useFloating, useFocus, useHover, useInteractions } from "@floating-ui/react";
|
|
@@ -26,10 +27,15 @@ function HoverCard({ children, content, placement = "top", offset = { mainAxis:
|
|
|
26
27
|
whileElementsMounted: autoUpdate,
|
|
27
28
|
middleware: floatingMiddleware(offset)
|
|
28
29
|
});
|
|
30
|
+
const { delay } = useHoverDelay(context, {
|
|
31
|
+
enabled,
|
|
32
|
+
delay: HOVER_CARD_DELAY,
|
|
33
|
+
instant: false
|
|
34
|
+
});
|
|
29
35
|
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
30
36
|
useHover(context, {
|
|
31
37
|
enabled,
|
|
32
|
-
delay
|
|
38
|
+
delay,
|
|
33
39
|
handleClose: safePolygon({
|
|
34
40
|
requireIntent: false,
|
|
35
41
|
buffer: 5
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { NextFloatingDelayGroup, useNextDelayGroup } from "@floating-ui/react";
|
|
4
|
+
//#region ../ui-public/src/overlays/HoverDelayGroup.tsx
|
|
5
|
+
var GROUP_TIMEOUT_MS = 300;
|
|
6
|
+
var IDLE_DELAY = {
|
|
7
|
+
open: 0,
|
|
8
|
+
close: 0
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The tooltips and the hover cards in this group open one at a time. When
|
|
12
|
+
* the next one opens, the one before it closes. After the first one opens,
|
|
13
|
+
* the next tooltip opens immediately. Put it once around the app.
|
|
14
|
+
*/
|
|
15
|
+
function HoverDelayGroup({ children }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(NextFloatingDelayGroup, {
|
|
17
|
+
delay: IDLE_DELAY,
|
|
18
|
+
timeoutMs: GROUP_TIMEOUT_MS,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Puts an overlay in the HoverDelayGroup. Give `delay` to `useHover`. When
|
|
24
|
+
* no overlay of the group is open, or with no group, the overlay uses its
|
|
25
|
+
* own delay. `isInstantPhase` is true when the overlay opened immediately
|
|
26
|
+
* after another overlay of the group.
|
|
27
|
+
*
|
|
28
|
+
* Set `instant` to false for an overlay that the pointer can move into
|
|
29
|
+
* (a hover card). The overlay then always waits for its own delay. If it
|
|
30
|
+
* opens immediately, a trigger on the path from an open card to that card
|
|
31
|
+
* opens its own card and closes the open card.
|
|
32
|
+
*/
|
|
33
|
+
function useHoverDelay(context, { enabled, delay, instant = true }) {
|
|
34
|
+
const { delayRef, hasProvider, isInstantPhase } = useNextDelayGroup(context, { enabled });
|
|
35
|
+
return {
|
|
36
|
+
delay: () => instant && hasProvider && delayRef.current !== IDLE_DELAY ? delayRef.current : delay,
|
|
37
|
+
isInstantPhase
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { HoverDelayGroup, useHoverDelay };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionLayer } from "../../actions/Actions/registry.js";
|
|
2
2
|
import { useTranslation } from "../../i18n.js";
|
|
3
3
|
import NewZIndex from "../NewZIndex.js";
|
|
4
|
-
import Button from "../../actions/Button.js";
|
|
5
4
|
import Portal from "../Portal.js";
|
|
5
|
+
import Button from "../../actions/Button.js";
|
|
6
6
|
import { ModalCloseContext, closeAction, useDialogLayer, useModalClose } from "../useModalClose.js";
|
|
7
7
|
import ModalLayer from "./Layer.js";
|
|
8
8
|
import ModalPanel from "./Panel.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { usePortalWrapper } from "./PortalWrapper.js";
|
|
2
|
-
import { ButtonSizeContext } from "../actions/Button.js";
|
|
3
2
|
import { InToolbarContext } from "../layout/Toolbar/context.js";
|
|
3
|
+
import { ButtonSizeContext } from "../actions/Button.js";
|
|
4
4
|
import React, { useLayoutEffect, useRef } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import ReactDOM from "react-dom";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OffsetOptions, type Placement } from '@floating-ui/react';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { type ActionShortcut } from '../../actions/Actions/shortcuts.js';
|
|
4
4
|
import { type Message } from '../../Message.js';
|
|
5
5
|
import { type FloatingTrigger } from '../floatingTrigger.js';
|
|
@@ -48,11 +48,4 @@ export type TooltipProps = {
|
|
|
48
48
|
* with links, controls or images, use HoverCard.
|
|
49
49
|
*/
|
|
50
50
|
declare function Tooltip({ children, label, shortcut, long, placement, offset, }: TooltipProps): React.JSX.Element;
|
|
51
|
-
/**
|
|
52
|
-
* The tooltips in this group share one delay: after the first tooltip
|
|
53
|
-
* opens, the next tooltip opens immediately. Put it once around the app.
|
|
54
|
-
*/
|
|
55
|
-
export declare function TooltipDelayGroup({ children }: {
|
|
56
|
-
children: ReactNode;
|
|
57
|
-
}): React.JSX.Element;
|
|
58
51
|
export default Tooltip;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseShortcut } from "../../actions/Actions/shortcuts.js";
|
|
2
|
+
import { useHoverDelay } from "../HoverDelayGroup.js";
|
|
2
3
|
import { cloneTrigger } from "../floatingTrigger.js";
|
|
3
4
|
import NewZIndex from "../NewZIndex.js";
|
|
4
5
|
import Portal from "../Portal.js";
|
|
@@ -6,13 +7,12 @@ import { floatingMiddleware } from "../Popover.js";
|
|
|
6
7
|
import TooltipBox from "./Box.js";
|
|
7
8
|
import React, { useState } from "react";
|
|
8
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import {
|
|
10
|
+
import { autoUpdate, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, useTransitionStatus } from "@floating-ui/react";
|
|
10
11
|
//#region ../ui-public/src/overlays/Tooltip/index.tsx
|
|
11
12
|
var TOOLTIP_DELAY = {
|
|
12
13
|
open: 450,
|
|
13
14
|
close: 0
|
|
14
15
|
};
|
|
15
|
-
var TOOLTIP_GROUP_TIMEOUT = 300;
|
|
16
16
|
var TOOLTIP_FADE_OUT_MS = 200;
|
|
17
17
|
var TRANSFORM_ORIGIN = {
|
|
18
18
|
top: "50% 100%",
|
|
@@ -37,7 +37,10 @@ function Tooltip({ children, label, shortcut, long, placement = "top", offset =
|
|
|
37
37
|
transform: false,
|
|
38
38
|
middleware: floatingMiddleware(offset)
|
|
39
39
|
});
|
|
40
|
-
const {
|
|
40
|
+
const { delay, isInstantPhase } = useHoverDelay(context, {
|
|
41
|
+
enabled,
|
|
42
|
+
delay: TOOLTIP_DELAY
|
|
43
|
+
});
|
|
41
44
|
const { isMounted, status } = useTransitionStatus(context, { duration: {
|
|
42
45
|
open: 0,
|
|
43
46
|
close: isInstantPhase ? 0 : TOOLTIP_FADE_OUT_MS
|
|
@@ -47,7 +50,7 @@ function Tooltip({ children, label, shortcut, long, placement = "top", offset =
|
|
|
47
50
|
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
48
51
|
useHover(context, {
|
|
49
52
|
enabled,
|
|
50
|
-
delay
|
|
53
|
+
delay
|
|
51
54
|
}),
|
|
52
55
|
useFocus(context, { enabled }),
|
|
53
56
|
useDismiss(context, { enabled }),
|
|
@@ -70,16 +73,5 @@ function Tooltip({ children, label, shortcut, long, placement = "top", offset =
|
|
|
70
73
|
...getFloatingProps()
|
|
71
74
|
}) }) })] });
|
|
72
75
|
}
|
|
73
|
-
/**
|
|
74
|
-
* The tooltips in this group share one delay: after the first tooltip
|
|
75
|
-
* opens, the next tooltip opens immediately. Put it once around the app.
|
|
76
|
-
*/
|
|
77
|
-
function TooltipDelayGroup({ children }) {
|
|
78
|
-
return /* @__PURE__ */ jsx(NextFloatingDelayGroup, {
|
|
79
|
-
delay: TOOLTIP_DELAY,
|
|
80
|
-
timeoutMs: TOOLTIP_GROUP_TIMEOUT,
|
|
81
|
-
children
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
76
|
//#endregion
|
|
85
|
-
export {
|
|
77
|
+
export { Tooltip as default };
|
|
@@ -33,6 +33,11 @@ export type ListDetailPageProps = {
|
|
|
33
33
|
* The options of the "⋯" menu of the title bar (Dropdown Option elements)
|
|
34
34
|
*/
|
|
35
35
|
menu?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* A menu after the title that changes how the list shows (the layout, the
|
|
38
|
+
* order)
|
|
39
|
+
*/
|
|
40
|
+
display?: ReactNode;
|
|
36
41
|
/** The list loads in the background. The title bar shows a small spinner. */
|
|
37
42
|
busy?: boolean;
|
|
38
43
|
/**
|
|
@@ -87,7 +92,7 @@ type ListDetailPageContent =
|
|
|
87
92
|
* page gives the data, the filter form, the table and the panel. Put it in
|
|
88
93
|
* the Main of the app.
|
|
89
94
|
*/
|
|
90
|
-
declare function ListDetailPage({ detail, title, help, subtitle, menu, busy, filter, controls, button, footer, state, overview, children, }: ListDetailPageProps): React.JSX.Element;
|
|
95
|
+
declare function ListDetailPage({ detail, title, help, subtitle, menu, display, busy, filter, controls, button, footer, state, overview, children, }: ListDetailPageProps): React.JSX.Element;
|
|
91
96
|
declare const _default: React.MemoExoticComponent<typeof ListDetailPage>;
|
|
92
97
|
export default _default;
|
|
93
98
|
/**
|
|
@@ -28,7 +28,7 @@ function getPaginatedListState(isEmpty, isFiltering) {
|
|
|
28
28
|
* page gives the data, the filter form, the table and the panel. Put it in
|
|
29
29
|
* the Main of the app.
|
|
30
30
|
*/
|
|
31
|
-
function ListDetailPage({ detail, title, help, subtitle, menu, busy, filter, controls, button, footer, state, overview, children }) {
|
|
31
|
+
function ListDetailPage({ detail, title, help, subtitle, menu, display, busy, filter, controls, button, footer, state, overview, children }) {
|
|
32
32
|
const { t, tm, tc } = useTranslation();
|
|
33
33
|
const titleText = tm(title);
|
|
34
34
|
const listState = state === "no-results" ? "ready" : state;
|
|
@@ -49,6 +49,7 @@ function ListDetailPage({ detail, title, help, subtitle, menu, busy, filter, con
|
|
|
49
49
|
}),
|
|
50
50
|
/* @__PURE__ */ jsx(Pane_default.Header.Subtitle, { children: subtitle && tc(subtitle) }),
|
|
51
51
|
/* @__PURE__ */ jsx(Pane_default.Header.Menu, { children: menu }),
|
|
52
|
+
/* @__PURE__ */ jsx(Pane_default.Header.Display, { children: display }),
|
|
52
53
|
busy && /* @__PURE__ */ jsx(Pane_default.Header.Spinner, {}),
|
|
53
54
|
/* @__PURE__ */ jsxs(Pane_default.Header.Button, { children: [
|
|
54
55
|
controls,
|
|
@@ -2,7 +2,7 @@ import { getPaginatedListState, type ListDetailPageState, useOpenRowRoute, useRe
|
|
|
2
2
|
import { getListDetailMaxWidth, useIsListDetailOpen } from './Split.js';
|
|
3
3
|
import { ListDetailWidthsProvider } from './Widths.js';
|
|
4
4
|
export declare const ListDetail: {
|
|
5
|
-
Page: import("react").MemoExoticComponent<({ detail, title, help, subtitle, menu, busy, filter, controls, button, footer, state, overview, children, }: import("./Page.js").ListDetailPageProps) => import("react").JSX.Element>;
|
|
5
|
+
Page: import("react").MemoExoticComponent<({ detail, title, help, subtitle, menu, display, busy, filter, controls, button, footer, state, overview, children, }: import("./Page.js").ListDetailPageProps) => import("react").JSX.Element>;
|
|
6
6
|
Split: import("react").MemoExoticComponent<({ detail, children }: import("./Split.js").ListDetailSplitProps) => import("react").JSX.Element>;
|
|
7
7
|
Panel: import("react").MemoExoticComponent<({ title, state, fetching, actions, toolbarAction, entity, children, }: import("./Panel.js").ListDetailPanelProps) => import("react").JSX.Element>;
|
|
8
8
|
Overview: import("react").MemoExoticComponent<({ children }: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datocms-react-ui",
|
|
3
|
-
"version": "3.1.0-next.
|
|
3
|
+
"version": "3.1.0-next.3",
|
|
4
4
|
"description": "React components to use inside DatoCMS plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"@react-hook/merged-ref": "^1.3.0",
|
|
52
52
|
"classnames": "^2.3.1",
|
|
53
53
|
"copy-to-clipboard": "^3.3.1",
|
|
54
|
-
"cuid": "^2.1.8",
|
|
55
54
|
"date-fns": "^4.1.0",
|
|
56
55
|
"fuzzyjs": "^4.0.4",
|
|
57
56
|
"intersection-observer": "^0.12.0",
|