@adecore/ui 0.53.3 → 0.54.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/Banner.d.ts +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/ChoiceCards.d.ts +1 -1
- package/dist/ChoiceCards.js +2 -2
- package/dist/CloseButton.js +1 -1
- package/dist/ColorSwatch.d.ts +1 -1
- package/dist/ColorSwatch.js +1 -1
- package/dist/ColorWheelPicker.js +1 -1
- package/dist/CopyButton.js +1 -1
- package/dist/DockShell.js +1 -1
- package/dist/EmptyState.d.ts +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/ErrorBoundary.js +122 -112
- package/dist/Field.d.ts +1 -1
- package/dist/Field.js +2 -2
- package/dist/FileIcon.d.ts +1 -1
- package/dist/FileIcon.js +44 -36
- package/dist/Icon.d.ts +1 -1
- package/dist/IconButton.d.ts +3 -3
- package/dist/IconButton.js +2 -2
- package/dist/IconPicker.js +35 -32
- package/dist/Input.d.ts +1 -1
- package/dist/ListRow.js +1 -1
- package/dist/MiddleTruncate.js +2 -2
- package/dist/PanelEmpty.d.ts +1 -1
- package/dist/PanelHeader.d.ts +1 -1
- package/dist/PanelHeader.js +1 -1
- package/dist/ProjectSwitcher.js +1 -1
- package/dist/PromptDialog.d.ts +1 -1
- package/dist/ScrollArea.d.ts +12 -0
- package/dist/ScrollArea.js +144 -0
- package/dist/SectionLabel.js +1 -1
- package/dist/SegmentBar.js +1 -1
- package/dist/Segmented.d.ts +1 -1
- package/dist/Select.d.ts +1 -1
- package/dist/Select.js +22 -16
- package/dist/SelectSearch.js +49 -33
- package/dist/ShortcutHints.js +1 -1
- package/dist/Slider.js +2 -2
- package/dist/SlidingColumn.js +1 -1
- package/dist/SplitButton.js +1 -1
- package/dist/Surface.js +1 -1
- package/dist/Switch.js +1 -1
- package/dist/TextMenu.js +2 -2
- package/dist/Toasts.js +2 -2
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/UIProvider.d.ts +1 -1
- package/dist/Waveform.js +1 -1
- package/dist/Wipe.js +2 -2
- package/dist/combobox/parts.d.ts +3 -3
- package/dist/combobox/parts.js +53 -32
- package/dist/command-palette/parts.d.ts +1 -1
- package/dist/command-palette/parts.js +22 -7
- package/dist/command-palette/virtual.js +4 -4
- package/dist/dialog/parts.d.ts +1 -1
- package/dist/dialog/parts.js +2 -2
- package/dist/file-icon.d.ts +2 -0
- package/dist/file-icon.js +12 -0
- package/dist/file-tree/parts.d.ts +2 -2
- package/dist/file-tree/parts.js +3 -3
- package/dist/file-tree/use-file-tree-shift.d.ts +1 -1
- package/dist/file-tree/use-file-tree-shift.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/key-value-list/parts.js +1 -1
- package/dist/menu/parts.d.ts +3 -3
- package/dist/menu/parts.js +46 -30
- package/dist/popover/parts.d.ts +3 -3
- package/dist/popover/parts.js +110 -71
- package/dist/project-switcher-row.js +1 -1
- package/dist/scrollbar-geometry.d.ts +15 -0
- package/dist/scrollbar-geometry.js +48 -0
- package/dist/settings/MasterDetail.js +40 -30
- package/dist/settings/SettingsDialog.d.ts +1 -1
- package/dist/settings/SettingsDialog.js +27 -11
- package/dist/settings/SettingsRow.d.ts +1 -1
- package/dist/settings/SettingsRow.js +1 -1
- package/dist/settings/SettingsSection.d.ts +1 -1
- package/dist/tabs/parts.d.ts +1 -1
- package/dist/tabs/parts.js +3 -3
- package/dist/testing/dedupe.js +1 -1
- package/dist/theme.css +91 -1
- package/dist/tree/parts.js +2 -2
- package/dist/useOverlayScrollbars.d.ts +7 -0
- package/dist/useOverlayScrollbars.js +281 -0
- package/dist/workspace/PaneBar.js +2 -2
- package/dist/workspace/SplitView.d.ts +1 -1
- package/dist/workspace/SplitView.js +4 -4
- package/dist/workspace/TabStrip.d.ts +1 -1
- package/dist/workspace/TabStrip.js +2 -2
- package/dist/workspace/Workspace.d.ts +1 -1
- package/dist/workspace/Workspace.js +2 -2
- package/dist/workspace/WorkspaceRail.js +1 -1
- package/dist/workspace/WorkspaceTopRow.js +1 -1
- package/package.json +1 -1
- package/src/AccentSwatches.tsx +1 -1
- package/src/Banner.tsx +1 -1
- package/src/Button.tsx +1 -1
- package/src/ButtonGroup.tsx +1 -1
- package/src/Checkbox.tsx +2 -2
- package/src/ChoiceCards.tsx +3 -3
- package/src/CloseButton.tsx +2 -2
- package/src/ColorSwatch.tsx +2 -2
- package/src/ColorWheelPicker.tsx +1 -1
- package/src/ColumnResizeHandle.tsx +1 -1
- package/src/CopyButton.tsx +1 -1
- package/src/DockShell.tsx +1 -1
- package/src/EmptyState.tsx +2 -2
- package/src/ErrorBoundary.tsx +4 -3
- package/src/Field.tsx +2 -2
- package/src/FileIcon.tsx +15 -6
- package/src/Icon.tsx +2 -2
- package/src/IconButton.tsx +3 -3
- package/src/IconPicker.tsx +7 -6
- package/src/Input.tsx +2 -2
- package/src/Kbd.tsx +1 -1
- package/src/ListRow.tsx +1 -1
- package/src/Meter.tsx +1 -1
- package/src/MiddleTruncate.tsx +2 -2
- package/src/PanelEmpty.tsx +2 -2
- package/src/PanelHeader.tsx +2 -2
- package/src/Pill.tsx +1 -1
- package/src/ProjectSwitcher.tsx +2 -2
- package/src/PromptDialog.tsx +1 -1
- package/src/RelativeTime.tsx +1 -1
- package/src/ScrollArea.tsx +47 -0
- package/src/SectionLabel.tsx +1 -1
- package/src/SegmentBar.tsx +1 -1
- package/src/Segmented.tsx +1 -1
- package/src/Select.tsx +6 -2
- package/src/SelectSearch.tsx +19 -12
- package/src/Separator.tsx +1 -1
- package/src/ShortcutHints.tsx +1 -1
- package/src/Skeleton.tsx +1 -1
- package/src/Slider.tsx +2 -2
- package/src/SlidingColumn.tsx +1 -1
- package/src/Spinner.tsx +1 -1
- package/src/SplitButton.tsx +1 -1
- package/src/Stepper.tsx +1 -1
- package/src/Surface.tsx +1 -1
- package/src/Switch.tsx +2 -2
- package/src/TextMenu.tsx +2 -2
- package/src/Tile.tsx +1 -1
- package/src/Toasts.tsx +2 -2
- package/src/Tooltip.tsx +2 -2
- package/src/UIProvider.tsx +1 -1
- package/src/Waveform.tsx +1 -1
- package/src/Wipe.tsx +2 -2
- package/src/ZoomControls.tsx +1 -1
- package/src/combobox/parts.tsx +9 -4
- package/src/command-palette/parts.tsx +25 -19
- package/src/command-palette/virtual.tsx +4 -4
- package/src/dialog/parts.tsx +2 -2
- package/src/file-icon.ts +15 -0
- package/src/file-tree/parts.tsx +6 -6
- package/src/file-tree/use-empty-lines.ts +1 -1
- package/src/file-tree/use-file-tree-shift.tsx +2 -2
- package/src/file-tree/use-slots.ts +2 -2
- package/src/index.ts +2 -0
- package/src/key-value-list/parts.tsx +1 -1
- package/src/menu/parts.tsx +11 -6
- package/src/popover/parts.tsx +13 -5
- package/src/project-switcher-row.tsx +2 -2
- package/src/scrollbar-geometry.ts +67 -0
- package/src/select-shared.ts +1 -1
- package/src/settings/DetailHeader.tsx +1 -1
- package/src/settings/MasterDetail.tsx +9 -6
- package/src/settings/SettingsDialog.tsx +16 -9
- package/src/settings/SettingsRow.tsx +1 -1
- package/src/settings/SettingsSection.tsx +1 -1
- package/src/tabs/parts.tsx +4 -4
- package/src/testing/dedupe.ts +1 -1
- package/src/theme.css +91 -1
- package/src/tree/parts.tsx +2 -2
- package/src/useOverlayScrollbars.tsx +263 -0
- package/src/workspace/DropPreview.tsx +1 -1
- package/src/workspace/PaneBar.tsx +2 -2
- package/src/workspace/SplitView.tsx +5 -5
- package/src/workspace/TabStrip.tsx +3 -3
- package/src/workspace/Workspace.tsx +2 -2
- package/src/workspace/WorkspaceRail.tsx +1 -1
- package/src/workspace/WorkspaceTopRow.tsx +1 -1
package/dist/menu/parts.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { Check, ChevronRight } from 'lucide-react';
|
|
5
2
|
import { ContextMenu as BaseContextMenu } from '@base-ui/react/context-menu';
|
|
6
3
|
import { Menu as BaseMenu } from '@base-ui/react/menu';
|
|
7
4
|
import { Separator as BaseSeparator } from '@base-ui/react/separator';
|
|
8
5
|
import { useRender } from '@base-ui/react/use-render';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { Check, ChevronRight } from 'lucide-react';
|
|
8
|
+
import { createContext, useContext, useState } from 'react';
|
|
9
9
|
import { withClass } from '../class-name.js';
|
|
10
10
|
import { Icon } from "../Icon.js";
|
|
11
|
-
import {
|
|
11
|
+
import { mergeRefs } from '../merge-refs.js';
|
|
12
12
|
import { splitPlacement } from '../placement.js';
|
|
13
13
|
import { renderPositioner } from '../popup-layer.js';
|
|
14
|
-
import {
|
|
14
|
+
import { Tooltip } from "../Tooltip.js";
|
|
15
|
+
import { useOverlayScrollbars } from "../useOverlayScrollbars.js";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
17
|
const MenuKindContext = createContext('menu');
|
|
16
18
|
/* A context menu opens at the pointer, which its positioner already knows. A submenu is pulled up by the popup's padding so its first row lines up with the row that opened it. */
|
|
17
19
|
const PLACEMENT = {
|
|
@@ -86,41 +88,54 @@ export function MenuSubmenuRoot(props) {
|
|
|
86
88
|
export const MenuTrigger = BaseMenu.Trigger;
|
|
87
89
|
export const ContextMenuTrigger = BaseContextMenu.Trigger;
|
|
88
90
|
export function MenuPopup(t0) {
|
|
89
|
-
const $ = _c(
|
|
91
|
+
const $ = _c(16);
|
|
90
92
|
const {
|
|
91
93
|
className,
|
|
94
|
+
ref,
|
|
92
95
|
...props
|
|
93
96
|
} = t0;
|
|
94
97
|
const defaults = PLACEMENT[useContext(MenuKindContext)];
|
|
95
98
|
const [placement, popupProps] = splitPlacement(props);
|
|
99
|
+
const [popup, setPopup] = useState(null);
|
|
100
|
+
const scrollbars = useOverlayScrollbars(popup);
|
|
96
101
|
const t1 = placement.side ?? defaults.side;
|
|
97
102
|
const t2 = placement.align ?? defaults.align;
|
|
98
103
|
const t3 = placement.sideOffset ?? defaults.sideOffset;
|
|
99
104
|
const t4 = placement.alignOffset ?? defaults.alignOffset;
|
|
100
105
|
let t5;
|
|
101
|
-
if ($[0] !==
|
|
102
|
-
t5 =
|
|
103
|
-
$[0] =
|
|
106
|
+
if ($[0] !== ref) {
|
|
107
|
+
t5 = mergeRefs(setPopup, ref);
|
|
108
|
+
$[0] = ref;
|
|
104
109
|
$[1] = t5;
|
|
105
110
|
} else {
|
|
106
111
|
t5 = $[1];
|
|
107
112
|
}
|
|
108
113
|
let t6;
|
|
109
|
-
if ($[2] !==
|
|
110
|
-
t6 =
|
|
111
|
-
|
|
114
|
+
if ($[2] !== className) {
|
|
115
|
+
t6 = withClass("menu-popup", className);
|
|
116
|
+
$[2] = className;
|
|
117
|
+
$[3] = t6;
|
|
118
|
+
} else {
|
|
119
|
+
t6 = $[3];
|
|
120
|
+
}
|
|
121
|
+
let t7;
|
|
122
|
+
if ($[4] !== popupProps || $[5] !== t5 || $[6] !== t6) {
|
|
123
|
+
t7 = /*#__PURE__*/_jsx(BaseMenu.Popup, {
|
|
124
|
+
ref: t5,
|
|
125
|
+
className: t6,
|
|
112
126
|
...popupProps
|
|
113
127
|
});
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
128
|
+
$[4] = popupProps;
|
|
129
|
+
$[5] = t5;
|
|
130
|
+
$[6] = t6;
|
|
131
|
+
$[7] = t7;
|
|
117
132
|
} else {
|
|
118
|
-
|
|
133
|
+
t7 = $[7];
|
|
119
134
|
}
|
|
120
|
-
let
|
|
121
|
-
if ($[
|
|
122
|
-
|
|
123
|
-
children: /*#__PURE__*/
|
|
135
|
+
let t8;
|
|
136
|
+
if ($[8] !== placement || $[9] !== scrollbars || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4 || $[14] !== t7) {
|
|
137
|
+
t8 = /*#__PURE__*/_jsx(BaseMenu.Portal, {
|
|
138
|
+
children: /*#__PURE__*/_jsxs(BaseMenu.Positioner, {
|
|
124
139
|
className: "popup-positioner",
|
|
125
140
|
render: renderPositioner,
|
|
126
141
|
...placement,
|
|
@@ -128,20 +143,21 @@ export function MenuPopup(t0) {
|
|
|
128
143
|
align: t2,
|
|
129
144
|
sideOffset: t3,
|
|
130
145
|
alignOffset: t4,
|
|
131
|
-
children:
|
|
146
|
+
children: [t7, scrollbars]
|
|
132
147
|
})
|
|
133
148
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
149
|
+
$[8] = placement;
|
|
150
|
+
$[9] = scrollbars;
|
|
151
|
+
$[10] = t1;
|
|
152
|
+
$[11] = t2;
|
|
153
|
+
$[12] = t3;
|
|
154
|
+
$[13] = t4;
|
|
155
|
+
$[14] = t7;
|
|
156
|
+
$[15] = t8;
|
|
141
157
|
} else {
|
|
142
|
-
|
|
158
|
+
t8 = $[15];
|
|
143
159
|
}
|
|
144
|
-
return
|
|
160
|
+
return t8;
|
|
145
161
|
}
|
|
146
162
|
export function MenuItem(t0) {
|
|
147
163
|
const $ = _c(10);
|
package/dist/popover/parts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
1
|
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
3
2
|
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';
|
|
3
|
+
import { type ComponentProps } from 'react';
|
|
4
4
|
import { type PlacementKey } from '../placement.ts';
|
|
5
5
|
declare const POPUP_VARIANT: {
|
|
6
6
|
readonly menu: 'menu-popup';
|
|
@@ -17,11 +17,11 @@ export declare const PopoverDescription: import("react").ForwardRefExoticCompone
|
|
|
17
17
|
export type PopoverPopupProps = ComponentProps<typeof BasePopover.Popup> & Placement & {
|
|
18
18
|
variant?: PopupVariant;
|
|
19
19
|
};
|
|
20
|
-
export declare function PopoverPopup({ variant, side, align, sideOffset, className, ...props }: PopoverPopupProps): import("react").JSX.Element;
|
|
20
|
+
export declare function PopoverPopup({ variant, side, align, sideOffset, className, ref, ...props }: PopoverPopupProps): import("react").JSX.Element;
|
|
21
21
|
export declare const PreviewCardRoot: <Payload>(props: BasePreviewCard.Root.Props<Payload>) => React.JSX.Element;
|
|
22
22
|
export declare const PreviewCardTrigger: BasePreviewCard.Trigger;
|
|
23
23
|
export type PreviewCardPopupProps = ComponentProps<typeof BasePreviewCard.Popup> & Placement & {
|
|
24
24
|
variant?: PopupVariant;
|
|
25
25
|
};
|
|
26
|
-
export declare function PreviewCardPopup({ variant, side, align, sideOffset, className, ...props }: PreviewCardPopupProps): import("react").JSX.Element;
|
|
26
|
+
export declare function PreviewCardPopup({ variant, side, align, sideOffset, className, ref, ...props }: PreviewCardPopupProps): import("react").JSX.Element;
|
|
27
27
|
export {};
|
package/dist/popover/parts.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
3
3
|
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';
|
|
4
|
+
import { useState } from 'react';
|
|
4
5
|
import { withClass } from '../class-name.js';
|
|
6
|
+
import { mergeRefs } from '../merge-refs.js';
|
|
5
7
|
import { splitPlacement } from '../placement.js';
|
|
6
8
|
import { renderPositioner } from '../popup-layer.js';
|
|
9
|
+
import { useOverlayScrollbars } from "../useOverlayScrollbars.js";
|
|
7
10
|
/* `picker` is a card whose content runs to its edges, `plain` leaves the surface to the caller. */
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
12
|
const POPUP_VARIANT = {
|
|
10
13
|
menu: 'menu-popup',
|
|
11
14
|
picker: 'picker-popup',
|
|
@@ -17,9 +20,10 @@ export const PopoverClose = BasePopover.Close;
|
|
|
17
20
|
export const PopoverTitle = BasePopover.Title;
|
|
18
21
|
export const PopoverDescription = BasePopover.Description;
|
|
19
22
|
export function PopoverPopup(t0) {
|
|
20
|
-
const $ = _c(
|
|
23
|
+
const $ = _c(24);
|
|
21
24
|
let align;
|
|
22
25
|
let className;
|
|
26
|
+
let ref;
|
|
23
27
|
let side;
|
|
24
28
|
let sideOffset;
|
|
25
29
|
let t1;
|
|
@@ -31,9 +35,11 @@ export function PopoverPopup(t0) {
|
|
|
31
35
|
align: t4,
|
|
32
36
|
sideOffset: t5,
|
|
33
37
|
className: t6,
|
|
38
|
+
ref: t7,
|
|
34
39
|
...props
|
|
35
40
|
} = t0;
|
|
36
41
|
className = t6;
|
|
42
|
+
ref = t7;
|
|
37
43
|
variant = t2 === undefined ? "menu" : t2;
|
|
38
44
|
side = t3 === undefined ? "bottom" : t3;
|
|
39
45
|
align = t4 === undefined ? "start" : t4;
|
|
@@ -42,72 +48,88 @@ export function PopoverPopup(t0) {
|
|
|
42
48
|
$[0] = t0;
|
|
43
49
|
$[1] = align;
|
|
44
50
|
$[2] = className;
|
|
45
|
-
$[3] =
|
|
46
|
-
$[4] =
|
|
47
|
-
$[5] =
|
|
48
|
-
$[6] =
|
|
51
|
+
$[3] = ref;
|
|
52
|
+
$[4] = side;
|
|
53
|
+
$[5] = sideOffset;
|
|
54
|
+
$[6] = t1;
|
|
55
|
+
$[7] = variant;
|
|
49
56
|
} else {
|
|
50
57
|
align = $[1];
|
|
51
58
|
className = $[2];
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
ref = $[3];
|
|
60
|
+
side = $[4];
|
|
61
|
+
sideOffset = $[5];
|
|
62
|
+
t1 = $[6];
|
|
63
|
+
variant = $[7];
|
|
56
64
|
}
|
|
57
65
|
const [placement, popupProps] = t1;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
$[8] =
|
|
64
|
-
$[9] =
|
|
66
|
+
const [popup, setPopup] = useState(null);
|
|
67
|
+
const scrollbars = useOverlayScrollbars(popup);
|
|
68
|
+
let t2;
|
|
69
|
+
if ($[8] !== ref) {
|
|
70
|
+
t2 = mergeRefs(setPopup, ref);
|
|
71
|
+
$[8] = ref;
|
|
72
|
+
$[9] = t2;
|
|
65
73
|
} else {
|
|
66
|
-
|
|
74
|
+
t2 = $[9];
|
|
67
75
|
}
|
|
76
|
+
const t3 = POPUP_VARIANT[variant];
|
|
68
77
|
let t4;
|
|
69
|
-
if ($[10] !==
|
|
70
|
-
t4 =
|
|
71
|
-
|
|
72
|
-
...popupProps
|
|
73
|
-
});
|
|
74
|
-
$[10] = popupProps;
|
|
78
|
+
if ($[10] !== className || $[11] !== t3) {
|
|
79
|
+
t4 = withClass(t3, className);
|
|
80
|
+
$[10] = className;
|
|
75
81
|
$[11] = t3;
|
|
76
82
|
$[12] = t4;
|
|
77
83
|
} else {
|
|
78
84
|
t4 = $[12];
|
|
79
85
|
}
|
|
80
86
|
let t5;
|
|
81
|
-
if ($[13] !==
|
|
82
|
-
t5 = /*#__PURE__*/_jsx(BasePopover.
|
|
83
|
-
|
|
87
|
+
if ($[13] !== popupProps || $[14] !== t2 || $[15] !== t4) {
|
|
88
|
+
t5 = /*#__PURE__*/_jsx(BasePopover.Popup, {
|
|
89
|
+
ref: t2,
|
|
90
|
+
className: t4,
|
|
91
|
+
...popupProps
|
|
92
|
+
});
|
|
93
|
+
$[13] = popupProps;
|
|
94
|
+
$[14] = t2;
|
|
95
|
+
$[15] = t4;
|
|
96
|
+
$[16] = t5;
|
|
97
|
+
} else {
|
|
98
|
+
t5 = $[16];
|
|
99
|
+
}
|
|
100
|
+
let t6;
|
|
101
|
+
if ($[17] !== align || $[18] !== placement || $[19] !== scrollbars || $[20] !== side || $[21] !== sideOffset || $[22] !== t5) {
|
|
102
|
+
t6 = /*#__PURE__*/_jsx(BasePopover.Portal, {
|
|
103
|
+
children: /*#__PURE__*/_jsxs(BasePopover.Positioner, {
|
|
84
104
|
className: "popup-positioner",
|
|
85
105
|
render: renderPositioner,
|
|
86
106
|
...placement,
|
|
87
107
|
side: side,
|
|
88
108
|
align: align,
|
|
89
109
|
sideOffset: sideOffset,
|
|
90
|
-
children:
|
|
110
|
+
children: [t5, scrollbars]
|
|
91
111
|
})
|
|
92
112
|
});
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
113
|
+
$[17] = align;
|
|
114
|
+
$[18] = placement;
|
|
115
|
+
$[19] = scrollbars;
|
|
116
|
+
$[20] = side;
|
|
117
|
+
$[21] = sideOffset;
|
|
118
|
+
$[22] = t5;
|
|
119
|
+
$[23] = t6;
|
|
99
120
|
} else {
|
|
100
|
-
|
|
121
|
+
t6 = $[23];
|
|
101
122
|
}
|
|
102
|
-
return
|
|
123
|
+
return t6;
|
|
103
124
|
}
|
|
104
125
|
export const PreviewCardRoot = BasePreviewCard.Root;
|
|
105
126
|
export const PreviewCardTrigger = BasePreviewCard.Trigger;
|
|
106
127
|
/* A card that opens while the pointer rests on its trigger, drawn like a popover. */
|
|
107
128
|
export function PreviewCardPopup(t0) {
|
|
108
|
-
const $ = _c(
|
|
129
|
+
const $ = _c(24);
|
|
109
130
|
let align;
|
|
110
131
|
let className;
|
|
132
|
+
let ref;
|
|
111
133
|
let side;
|
|
112
134
|
let sideOffset;
|
|
113
135
|
let t1;
|
|
@@ -119,9 +141,11 @@ export function PreviewCardPopup(t0) {
|
|
|
119
141
|
align: t4,
|
|
120
142
|
sideOffset: t5,
|
|
121
143
|
className: t6,
|
|
144
|
+
ref: t7,
|
|
122
145
|
...props
|
|
123
146
|
} = t0;
|
|
124
147
|
className = t6;
|
|
148
|
+
ref = t7;
|
|
125
149
|
variant = t2 === undefined ? "menu" : t2;
|
|
126
150
|
side = t3 === undefined ? "bottom" : t3;
|
|
127
151
|
align = t4 === undefined ? "start" : t4;
|
|
@@ -130,61 +154,76 @@ export function PreviewCardPopup(t0) {
|
|
|
130
154
|
$[0] = t0;
|
|
131
155
|
$[1] = align;
|
|
132
156
|
$[2] = className;
|
|
133
|
-
$[3] =
|
|
134
|
-
$[4] =
|
|
135
|
-
$[5] =
|
|
136
|
-
$[6] =
|
|
157
|
+
$[3] = ref;
|
|
158
|
+
$[4] = side;
|
|
159
|
+
$[5] = sideOffset;
|
|
160
|
+
$[6] = t1;
|
|
161
|
+
$[7] = variant;
|
|
137
162
|
} else {
|
|
138
163
|
align = $[1];
|
|
139
164
|
className = $[2];
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
165
|
+
ref = $[3];
|
|
166
|
+
side = $[4];
|
|
167
|
+
sideOffset = $[5];
|
|
168
|
+
t1 = $[6];
|
|
169
|
+
variant = $[7];
|
|
144
170
|
}
|
|
145
171
|
const [placement, popupProps] = t1;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
$[8] =
|
|
152
|
-
$[9] =
|
|
172
|
+
const [popup, setPopup] = useState(null);
|
|
173
|
+
const scrollbars = useOverlayScrollbars(popup);
|
|
174
|
+
let t2;
|
|
175
|
+
if ($[8] !== ref) {
|
|
176
|
+
t2 = mergeRefs(setPopup, ref);
|
|
177
|
+
$[8] = ref;
|
|
178
|
+
$[9] = t2;
|
|
153
179
|
} else {
|
|
154
|
-
|
|
180
|
+
t2 = $[9];
|
|
155
181
|
}
|
|
182
|
+
const t3 = POPUP_VARIANT[variant];
|
|
156
183
|
let t4;
|
|
157
|
-
if ($[10] !==
|
|
158
|
-
t4 =
|
|
159
|
-
|
|
160
|
-
...popupProps
|
|
161
|
-
});
|
|
162
|
-
$[10] = popupProps;
|
|
184
|
+
if ($[10] !== className || $[11] !== t3) {
|
|
185
|
+
t4 = withClass(t3, className);
|
|
186
|
+
$[10] = className;
|
|
163
187
|
$[11] = t3;
|
|
164
188
|
$[12] = t4;
|
|
165
189
|
} else {
|
|
166
190
|
t4 = $[12];
|
|
167
191
|
}
|
|
168
192
|
let t5;
|
|
169
|
-
if ($[13] !==
|
|
170
|
-
t5 = /*#__PURE__*/_jsx(BasePreviewCard.
|
|
171
|
-
|
|
193
|
+
if ($[13] !== popupProps || $[14] !== t2 || $[15] !== t4) {
|
|
194
|
+
t5 = /*#__PURE__*/_jsx(BasePreviewCard.Popup, {
|
|
195
|
+
ref: t2,
|
|
196
|
+
className: t4,
|
|
197
|
+
...popupProps
|
|
198
|
+
});
|
|
199
|
+
$[13] = popupProps;
|
|
200
|
+
$[14] = t2;
|
|
201
|
+
$[15] = t4;
|
|
202
|
+
$[16] = t5;
|
|
203
|
+
} else {
|
|
204
|
+
t5 = $[16];
|
|
205
|
+
}
|
|
206
|
+
let t6;
|
|
207
|
+
if ($[17] !== align || $[18] !== placement || $[19] !== scrollbars || $[20] !== side || $[21] !== sideOffset || $[22] !== t5) {
|
|
208
|
+
t6 = /*#__PURE__*/_jsx(BasePreviewCard.Portal, {
|
|
209
|
+
children: /*#__PURE__*/_jsxs(BasePreviewCard.Positioner, {
|
|
172
210
|
className: "z-(--z-popup)",
|
|
173
211
|
...placement,
|
|
174
212
|
side: side,
|
|
175
213
|
align: align,
|
|
176
214
|
sideOffset: sideOffset,
|
|
177
|
-
children:
|
|
215
|
+
children: [t5, scrollbars]
|
|
178
216
|
})
|
|
179
217
|
});
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
218
|
+
$[17] = align;
|
|
219
|
+
$[18] = placement;
|
|
220
|
+
$[19] = scrollbars;
|
|
221
|
+
$[20] = side;
|
|
222
|
+
$[21] = sideOffset;
|
|
223
|
+
$[22] = t5;
|
|
224
|
+
$[23] = t6;
|
|
186
225
|
} else {
|
|
187
|
-
|
|
226
|
+
t6 = $[23];
|
|
188
227
|
}
|
|
189
|
-
return
|
|
228
|
+
return t6;
|
|
190
229
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { MoreHorizontal } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import * as Menu from './menu/index.parts.js';
|
|
6
6
|
import { Tooltip } from "./Tooltip.js";
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const MIN_THUMB = 24;
|
|
2
|
+
export declare const PAGE_SHARE = 0.9;
|
|
3
|
+
export interface ScrollMetrics {
|
|
4
|
+
readonly track: number;
|
|
5
|
+
readonly view: number;
|
|
6
|
+
readonly content: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Thumb {
|
|
9
|
+
readonly size: number;
|
|
10
|
+
readonly offset: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function overflows(view: number, content: number): boolean;
|
|
13
|
+
export declare function thumbOf({ track, view, content }: ScrollMetrics, position: number): Thumb;
|
|
14
|
+
export declare function scrollAfterDrag(metrics: ScrollMetrics, start: number, moved: number): number;
|
|
15
|
+
export declare function pageToward(pointer: number, thumbStart: number, thumbEnd: number, view: number): number;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* A thumb never gets shorter than this, so a long list keeps one a pointer can grab. */
|
|
2
|
+
export const MIN_THUMB = 24;
|
|
3
|
+
/* A press on the track moves this share of the visible length, so a line of the old view stays in sight. */
|
|
4
|
+
export const PAGE_SHARE = 0.9;
|
|
5
|
+
/* Whether an axis has anything to scroll; a pixel of rounding is not worth a bar. */
|
|
6
|
+
export function overflows(view, content) {
|
|
7
|
+
return content - view > 1;
|
|
8
|
+
}
|
|
9
|
+
/* The thumb's length and its distance from the start of the track, in whole pixels. */
|
|
10
|
+
export function thumbOf({
|
|
11
|
+
track,
|
|
12
|
+
view,
|
|
13
|
+
content
|
|
14
|
+
}, position) {
|
|
15
|
+
const range = content - view;
|
|
16
|
+
if (range <= 0 || track <= 0) {
|
|
17
|
+
return {
|
|
18
|
+
size: Math.max(0, Math.round(track)),
|
|
19
|
+
offset: 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const size = Math.min(Math.round(track), Math.max(MIN_THUMB, Math.round(track * view / content)));
|
|
23
|
+
const progress = Math.min(1, Math.max(0, position / range));
|
|
24
|
+
return {
|
|
25
|
+
size,
|
|
26
|
+
offset: Math.round((track - size) * progress)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/* The scroll position after the thumb moved `moved` pixels from where a drag started. */
|
|
30
|
+
export function scrollAfterDrag(metrics, start, moved) {
|
|
31
|
+
const range = metrics.content - metrics.view;
|
|
32
|
+
const free = metrics.track - thumbOf(metrics, start).size;
|
|
33
|
+
if (range <= 0 || free <= 0) {
|
|
34
|
+
return start;
|
|
35
|
+
}
|
|
36
|
+
return Math.min(range, Math.max(0, start + moved * range / free));
|
|
37
|
+
}
|
|
38
|
+
/* How far a press on the track at `pointer` scrolls: a page toward the pointer, nothing on the thumb itself. */
|
|
39
|
+
export function pageToward(pointer, thumbStart, thumbEnd, view) {
|
|
40
|
+
const page = Math.round(view * PAGE_SHARE);
|
|
41
|
+
if (pointer < thumbStart) {
|
|
42
|
+
return -page;
|
|
43
|
+
}
|
|
44
|
+
if (pointer > thumbEnd) {
|
|
45
|
+
return page;
|
|
46
|
+
}
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { ScrollArea } from "../ScrollArea.js";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
const LIST_WIDTHS = {
|
|
5
6
|
280: 'w-70',
|
|
@@ -8,7 +9,7 @@ const LIST_WIDTHS = {
|
|
|
8
9
|
};
|
|
9
10
|
/* Its section must be `split`, so the dialog hands the pane its whole height instead of a padded scrolling column. */
|
|
10
11
|
export function MasterDetail(t0) {
|
|
11
|
-
const $ = _c(
|
|
12
|
+
const $ = _c(16);
|
|
12
13
|
const {
|
|
13
14
|
list,
|
|
14
15
|
listWidth,
|
|
@@ -25,59 +26,68 @@ export function MasterDetail(t0) {
|
|
|
25
26
|
} else {
|
|
26
27
|
t1 = $[1];
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
t3 = clsx("flex shrink-0 flex-col gap-0.5 overflow-y-auto border-r border-border p-2 max-[640px]:max-h-60 max-[640px]:w-auto max-[640px]:border-r-0 max-[640px]:border-b", t2);
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t2 = /*#__PURE__*/_jsx("nav", {});
|
|
32
32
|
$[2] = t2;
|
|
33
|
-
$[3] = t3;
|
|
34
33
|
} else {
|
|
35
|
-
|
|
34
|
+
t2 = $[2];
|
|
36
35
|
}
|
|
36
|
+
const t3 = LIST_WIDTHS[listWidth];
|
|
37
37
|
let t4;
|
|
38
|
-
if ($[
|
|
39
|
-
t4 =
|
|
38
|
+
if ($[3] !== t3) {
|
|
39
|
+
t4 = clsx("shrink-0 border-r border-border max-[640px]:max-h-60 max-[640px]:w-auto max-[640px]:border-r-0 max-[640px]:border-b", t3);
|
|
40
|
+
$[3] = t3;
|
|
41
|
+
$[4] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t4 = $[4];
|
|
44
|
+
}
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[5] !== list || $[6] !== listLabel || $[7] !== t4) {
|
|
47
|
+
t5 = /*#__PURE__*/_jsx(ScrollArea, {
|
|
48
|
+
render: t2,
|
|
40
49
|
"aria-label": listLabel,
|
|
41
|
-
className:
|
|
50
|
+
className: t4,
|
|
51
|
+
viewportClassName: "flex flex-col gap-0.5 p-2",
|
|
42
52
|
children: list
|
|
43
53
|
});
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
$[6] = t3;
|
|
54
|
+
$[5] = list;
|
|
55
|
+
$[6] = listLabel;
|
|
47
56
|
$[7] = t4;
|
|
57
|
+
$[8] = t5;
|
|
48
58
|
} else {
|
|
49
|
-
|
|
59
|
+
t5 = $[8];
|
|
50
60
|
}
|
|
51
|
-
let
|
|
52
|
-
if ($[
|
|
53
|
-
|
|
54
|
-
className: "
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[9] !== detail) {
|
|
63
|
+
t6 = /*#__PURE__*/_jsx(ScrollArea, {
|
|
64
|
+
className: "grow",
|
|
55
65
|
children: /*#__PURE__*/_jsx("div", {
|
|
56
66
|
className: "flex min-w-0 flex-col gap-7 px-8 pt-6 pb-10 max-[960px]:px-4",
|
|
57
67
|
children: detail
|
|
58
68
|
})
|
|
59
69
|
});
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
70
|
+
$[9] = detail;
|
|
71
|
+
$[10] = t6;
|
|
62
72
|
} else {
|
|
63
|
-
|
|
73
|
+
t6 = $[10];
|
|
64
74
|
}
|
|
65
|
-
let
|
|
66
|
-
if ($[
|
|
67
|
-
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[11] !== ref || $[12] !== t1 || $[13] !== t5 || $[14] !== t6) {
|
|
77
|
+
t7 = /*#__PURE__*/_jsxs("div", {
|
|
68
78
|
ref: ref,
|
|
69
79
|
className: t1,
|
|
70
|
-
children: [
|
|
80
|
+
children: [t5, t6]
|
|
71
81
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[12] = t4;
|
|
82
|
+
$[11] = ref;
|
|
83
|
+
$[12] = t1;
|
|
75
84
|
$[13] = t5;
|
|
76
85
|
$[14] = t6;
|
|
86
|
+
$[15] = t7;
|
|
77
87
|
} else {
|
|
78
|
-
|
|
88
|
+
t7 = $[15];
|
|
79
89
|
}
|
|
80
|
-
return
|
|
90
|
+
return t7;
|
|
81
91
|
}
|
|
82
92
|
export function MasterItem(t0) {
|
|
83
93
|
const $ = _c(9);
|