@adecore/ui 0.53.2 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js +1 -1
- 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-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 +1 -1
- 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-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/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);
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
2
|
import { Tabs } from '@base-ui/react/tabs';
|
|
3
|
+
import clsx from 'clsx';
|
|
6
4
|
import { Search, X } from 'lucide-react';
|
|
5
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { CloseButton } from "../CloseButton.js";
|
|
8
8
|
import { DialogDescription, DialogPopup, DialogRoot, DialogTitle } from "../dialog/parts.js";
|
|
9
9
|
import { ErrorBoundary } from "../ErrorBoundary.js";
|
|
10
10
|
import { Icon } from "../Icon.js";
|
|
11
11
|
import { IconButton } from "../IconButton.js";
|
|
12
|
-
import { LazyBoundary } from "../LazyBoundary.js";
|
|
13
12
|
import { Input } from "../Input.js";
|
|
13
|
+
import { LazyBoundary } from "../LazyBoundary.js";
|
|
14
|
+
import { ScrollArea } from "../ScrollArea.js";
|
|
14
15
|
import { Select } from "../Select.js";
|
|
15
16
|
import { SettingsTargetContext } from './target.js';
|
|
16
|
-
/*
|
|
17
|
+
/* A pane that is not split scrolls as one column: the panel's own props land on the viewport, which stays the tab panel. */
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
function renderScrollingPanel({
|
|
20
|
+
ref,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /*#__PURE__*/_jsx(ScrollArea, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
className: "min-h-0 min-w-0 grow",
|
|
27
|
+
viewportClassName: className,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/* How far a pane with a hero scrolls before the title bar over it is filled in. */
|
|
18
32
|
const BAR_FILL_DISTANCE = 70;
|
|
19
33
|
const NAV_ITEM = 'flex h-8 min-w-0 shrink-0 items-center gap-2.5 rounded-md px-2.5 text-sm focus-visible:-outline-offset-2 text-text-muted hover:bg-surface-hover hover:text-text data-active:bg-surface-active data-active:text-text';
|
|
20
34
|
function NavTab(t0) {
|
|
@@ -121,9 +135,9 @@ function SettingsNav(t0) {
|
|
|
121
135
|
}
|
|
122
136
|
let t5;
|
|
123
137
|
if ($[6] !== t4) {
|
|
124
|
-
t5 = /*#__PURE__*/_jsx(
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
t5 = /*#__PURE__*/_jsx(ScrollArea, {
|
|
139
|
+
viewportRef: list,
|
|
140
|
+
viewportClassName: "scroll-fade-y flex flex-col gap-3.5",
|
|
127
141
|
children: t4
|
|
128
142
|
});
|
|
129
143
|
$[6] = t4;
|
|
@@ -349,8 +363,9 @@ function SearchResults({
|
|
|
349
363
|
})
|
|
350
364
|
});
|
|
351
365
|
}
|
|
352
|
-
return /*#__PURE__*/_jsx(
|
|
353
|
-
|
|
366
|
+
return /*#__PURE__*/_jsx(ScrollArea, {
|
|
367
|
+
render: /*#__PURE__*/_jsx("ul", {}),
|
|
368
|
+
viewportClassName: "flex flex-col gap-0.5",
|
|
354
369
|
"aria-label": t('settings.search.results'),
|
|
355
370
|
children: results.map(result => /*#__PURE__*/_jsx("li", {
|
|
356
371
|
children: /*#__PURE__*/_jsxs("button", {
|
|
@@ -751,7 +766,8 @@ export function SettingsDialog(t0) {
|
|
|
751
766
|
return /*#__PURE__*/_jsx(Tabs.Panel, {
|
|
752
767
|
value: entry_2.id,
|
|
753
768
|
keepMounted: false,
|
|
754
|
-
className: clsx("flex min-h-0 min-w-0 grow flex-col outline-none", !entry_2.split && "gap-7
|
|
769
|
+
className: clsx("flex min-h-0 min-w-0 grow flex-col outline-none", !entry_2.split && "gap-7 px-8 pb-10 max-[960px]:px-4", !entry_2.split && !Hero && "scroll-fade-top pt-1"),
|
|
770
|
+
render: entry_2.split ? undefined : renderScrollingPanel,
|
|
755
771
|
onScroll: event => {
|
|
756
772
|
const top = event.currentTarget.scrollTop;
|
|
757
773
|
event.currentTarget.toggleAttribute("data-fade-start", top > 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
3
2
|
import clsx from 'clsx';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
4
|
import { Icon } from "../Icon.js";
|
|
5
5
|
import { mergeRefs } from '../merge-refs.js';
|
|
6
6
|
import { useSettingsTarget } from './target.js';
|
package/dist/tabs/parts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
2
1
|
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
3
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
4
4
|
export type TabsValue = BaseTabs.Tab.Value;
|
|
5
5
|
export type TabsVariant = 'line' | 'pill';
|
|
6
6
|
export type TabsRootProps = Omit<ComponentProps<typeof BaseTabs.Root>, 'onValueChange'> & {
|
package/dist/tabs/parts.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import { ChevronDown, X } from 'lucide-react';
|
|
6
|
+
import { Children, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
7
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
7
|
-
import { useRender } from '@base-ui/react/use-render';
|
|
8
8
|
import { withClass } from '../class-name.js';
|
|
9
9
|
import { formatNumber } from '../format/number.js';
|
|
10
10
|
import { Icon } from "../Icon.js";
|
package/dist/testing/dedupe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Glob, plugin } from 'bun';
|
|
1
2
|
import { existsSync, readdirSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
3
|
import { dirname, join, sep } from 'node:path';
|
|
3
|
-
import { Glob, plugin } from 'bun';
|
|
4
4
|
/*
|
|
5
5
|
* What `resolve.dedupe` does for Vite, for `bun test` in an app that links a checkout: a second React,
|
|
6
6
|
* i18next or Base UI breaks every hook, word and compound part. Bun has no dedupe and its resolve hook
|