@adecore/ui 0.53.3 → 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.
Files changed (180) hide show
  1. package/dist/Banner.d.ts +1 -1
  2. package/dist/ButtonGroup.js +1 -1
  3. package/dist/Checkbox.js +1 -1
  4. package/dist/ChoiceCards.d.ts +1 -1
  5. package/dist/ChoiceCards.js +2 -2
  6. package/dist/CloseButton.js +1 -1
  7. package/dist/ColorSwatch.d.ts +1 -1
  8. package/dist/ColorSwatch.js +1 -1
  9. package/dist/ColorWheelPicker.js +1 -1
  10. package/dist/CopyButton.js +1 -1
  11. package/dist/DockShell.js +1 -1
  12. package/dist/EmptyState.d.ts +1 -1
  13. package/dist/EmptyState.js +1 -1
  14. package/dist/ErrorBoundary.js +122 -112
  15. package/dist/Field.d.ts +1 -1
  16. package/dist/Field.js +2 -2
  17. package/dist/FileIcon.js +1 -1
  18. package/dist/Icon.d.ts +1 -1
  19. package/dist/IconButton.d.ts +3 -3
  20. package/dist/IconButton.js +2 -2
  21. package/dist/IconPicker.js +35 -32
  22. package/dist/Input.d.ts +1 -1
  23. package/dist/ListRow.js +1 -1
  24. package/dist/MiddleTruncate.js +2 -2
  25. package/dist/PanelEmpty.d.ts +1 -1
  26. package/dist/PanelHeader.d.ts +1 -1
  27. package/dist/PanelHeader.js +1 -1
  28. package/dist/ProjectSwitcher.js +1 -1
  29. package/dist/PromptDialog.d.ts +1 -1
  30. package/dist/ScrollArea.d.ts +12 -0
  31. package/dist/ScrollArea.js +144 -0
  32. package/dist/SectionLabel.js +1 -1
  33. package/dist/SegmentBar.js +1 -1
  34. package/dist/Segmented.d.ts +1 -1
  35. package/dist/Select.d.ts +1 -1
  36. package/dist/Select.js +22 -16
  37. package/dist/SelectSearch.js +49 -33
  38. package/dist/ShortcutHints.js +1 -1
  39. package/dist/Slider.js +2 -2
  40. package/dist/SlidingColumn.js +1 -1
  41. package/dist/SplitButton.js +1 -1
  42. package/dist/Surface.js +1 -1
  43. package/dist/Switch.js +1 -1
  44. package/dist/TextMenu.js +2 -2
  45. package/dist/Toasts.js +2 -2
  46. package/dist/Tooltip.d.ts +1 -1
  47. package/dist/Tooltip.js +1 -1
  48. package/dist/UIProvider.d.ts +1 -1
  49. package/dist/Waveform.js +1 -1
  50. package/dist/Wipe.js +2 -2
  51. package/dist/combobox/parts.d.ts +3 -3
  52. package/dist/combobox/parts.js +53 -32
  53. package/dist/command-palette/parts.d.ts +1 -1
  54. package/dist/command-palette/parts.js +22 -7
  55. package/dist/command-palette/virtual.js +4 -4
  56. package/dist/dialog/parts.d.ts +1 -1
  57. package/dist/dialog/parts.js +2 -2
  58. package/dist/file-tree/parts.d.ts +2 -2
  59. package/dist/file-tree/parts.js +3 -3
  60. package/dist/file-tree/use-file-tree-shift.d.ts +1 -1
  61. package/dist/file-tree/use-file-tree-shift.js +1 -1
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.js +2 -0
  64. package/dist/key-value-list/parts.js +1 -1
  65. package/dist/menu/parts.d.ts +3 -3
  66. package/dist/menu/parts.js +46 -30
  67. package/dist/popover/parts.d.ts +3 -3
  68. package/dist/popover/parts.js +110 -71
  69. package/dist/project-switcher-row.js +1 -1
  70. package/dist/scrollbar-geometry.d.ts +15 -0
  71. package/dist/scrollbar-geometry.js +48 -0
  72. package/dist/settings/MasterDetail.js +40 -30
  73. package/dist/settings/SettingsDialog.d.ts +1 -1
  74. package/dist/settings/SettingsDialog.js +27 -11
  75. package/dist/settings/SettingsRow.d.ts +1 -1
  76. package/dist/settings/SettingsRow.js +1 -1
  77. package/dist/settings/SettingsSection.d.ts +1 -1
  78. package/dist/tabs/parts.d.ts +1 -1
  79. package/dist/tabs/parts.js +3 -3
  80. package/dist/testing/dedupe.js +1 -1
  81. package/dist/theme.css +91 -1
  82. package/dist/tree/parts.js +2 -2
  83. package/dist/useOverlayScrollbars.d.ts +7 -0
  84. package/dist/useOverlayScrollbars.js +281 -0
  85. package/dist/workspace/PaneBar.js +2 -2
  86. package/dist/workspace/SplitView.d.ts +1 -1
  87. package/dist/workspace/SplitView.js +4 -4
  88. package/dist/workspace/TabStrip.d.ts +1 -1
  89. package/dist/workspace/TabStrip.js +2 -2
  90. package/dist/workspace/Workspace.d.ts +1 -1
  91. package/dist/workspace/Workspace.js +2 -2
  92. package/dist/workspace/WorkspaceRail.js +1 -1
  93. package/dist/workspace/WorkspaceTopRow.js +1 -1
  94. package/package.json +1 -1
  95. package/src/AccentSwatches.tsx +1 -1
  96. package/src/Banner.tsx +1 -1
  97. package/src/Button.tsx +1 -1
  98. package/src/ButtonGroup.tsx +1 -1
  99. package/src/Checkbox.tsx +2 -2
  100. package/src/ChoiceCards.tsx +3 -3
  101. package/src/CloseButton.tsx +2 -2
  102. package/src/ColorSwatch.tsx +2 -2
  103. package/src/ColorWheelPicker.tsx +1 -1
  104. package/src/ColumnResizeHandle.tsx +1 -1
  105. package/src/CopyButton.tsx +1 -1
  106. package/src/DockShell.tsx +1 -1
  107. package/src/EmptyState.tsx +2 -2
  108. package/src/ErrorBoundary.tsx +4 -3
  109. package/src/Field.tsx +2 -2
  110. package/src/FileIcon.tsx +1 -1
  111. package/src/Icon.tsx +2 -2
  112. package/src/IconButton.tsx +3 -3
  113. package/src/IconPicker.tsx +7 -6
  114. package/src/Input.tsx +2 -2
  115. package/src/Kbd.tsx +1 -1
  116. package/src/ListRow.tsx +1 -1
  117. package/src/Meter.tsx +1 -1
  118. package/src/MiddleTruncate.tsx +2 -2
  119. package/src/PanelEmpty.tsx +2 -2
  120. package/src/PanelHeader.tsx +2 -2
  121. package/src/Pill.tsx +1 -1
  122. package/src/ProjectSwitcher.tsx +2 -2
  123. package/src/PromptDialog.tsx +1 -1
  124. package/src/RelativeTime.tsx +1 -1
  125. package/src/ScrollArea.tsx +47 -0
  126. package/src/SectionLabel.tsx +1 -1
  127. package/src/SegmentBar.tsx +1 -1
  128. package/src/Segmented.tsx +1 -1
  129. package/src/Select.tsx +6 -2
  130. package/src/SelectSearch.tsx +19 -12
  131. package/src/Separator.tsx +1 -1
  132. package/src/ShortcutHints.tsx +1 -1
  133. package/src/Skeleton.tsx +1 -1
  134. package/src/Slider.tsx +2 -2
  135. package/src/SlidingColumn.tsx +1 -1
  136. package/src/Spinner.tsx +1 -1
  137. package/src/SplitButton.tsx +1 -1
  138. package/src/Stepper.tsx +1 -1
  139. package/src/Surface.tsx +1 -1
  140. package/src/Switch.tsx +2 -2
  141. package/src/TextMenu.tsx +2 -2
  142. package/src/Tile.tsx +1 -1
  143. package/src/Toasts.tsx +2 -2
  144. package/src/Tooltip.tsx +2 -2
  145. package/src/UIProvider.tsx +1 -1
  146. package/src/Waveform.tsx +1 -1
  147. package/src/Wipe.tsx +2 -2
  148. package/src/ZoomControls.tsx +1 -1
  149. package/src/combobox/parts.tsx +9 -4
  150. package/src/command-palette/parts.tsx +25 -19
  151. package/src/command-palette/virtual.tsx +4 -4
  152. package/src/dialog/parts.tsx +2 -2
  153. package/src/file-tree/parts.tsx +6 -6
  154. package/src/file-tree/use-empty-lines.ts +1 -1
  155. package/src/file-tree/use-file-tree-shift.tsx +2 -2
  156. package/src/file-tree/use-slots.ts +2 -2
  157. package/src/index.ts +2 -0
  158. package/src/key-value-list/parts.tsx +1 -1
  159. package/src/menu/parts.tsx +11 -6
  160. package/src/popover/parts.tsx +13 -5
  161. package/src/project-switcher-row.tsx +2 -2
  162. package/src/scrollbar-geometry.ts +67 -0
  163. package/src/select-shared.ts +1 -1
  164. package/src/settings/DetailHeader.tsx +1 -1
  165. package/src/settings/MasterDetail.tsx +9 -6
  166. package/src/settings/SettingsDialog.tsx +16 -9
  167. package/src/settings/SettingsRow.tsx +1 -1
  168. package/src/settings/SettingsSection.tsx +1 -1
  169. package/src/tabs/parts.tsx +4 -4
  170. package/src/testing/dedupe.ts +1 -1
  171. package/src/theme.css +91 -1
  172. package/src/tree/parts.tsx +2 -2
  173. package/src/useOverlayScrollbars.tsx +263 -0
  174. package/src/workspace/DropPreview.tsx +1 -1
  175. package/src/workspace/PaneBar.tsx +2 -2
  176. package/src/workspace/SplitView.tsx +5 -5
  177. package/src/workspace/TabStrip.tsx +3 -3
  178. package/src/workspace/Workspace.tsx +2 -2
  179. package/src/workspace/WorkspaceRail.tsx +1 -1
  180. package/src/workspace/WorkspaceTopRow.tsx +1 -1
@@ -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(19);
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] = side;
46
- $[4] = sideOffset;
47
- $[5] = t1;
48
- $[6] = variant;
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
- side = $[3];
53
- sideOffset = $[4];
54
- t1 = $[5];
55
- variant = $[6];
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 t2 = POPUP_VARIANT[variant];
59
- let t3;
60
- if ($[7] !== className || $[8] !== t2) {
61
- t3 = withClass(t2, className);
62
- $[7] = className;
63
- $[8] = t2;
64
- $[9] = t3;
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
- t3 = $[9];
74
+ t2 = $[9];
67
75
  }
76
+ const t3 = POPUP_VARIANT[variant];
68
77
  let t4;
69
- if ($[10] !== popupProps || $[11] !== t3) {
70
- t4 = /*#__PURE__*/_jsx(BasePopover.Popup, {
71
- className: t3,
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] !== align || $[14] !== placement || $[15] !== side || $[16] !== sideOffset || $[17] !== t4) {
82
- t5 = /*#__PURE__*/_jsx(BasePopover.Portal, {
83
- children: /*#__PURE__*/_jsx(BasePopover.Positioner, {
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: t4
110
+ children: [t5, scrollbars]
91
111
  })
92
112
  });
93
- $[13] = align;
94
- $[14] = placement;
95
- $[15] = side;
96
- $[16] = sideOffset;
97
- $[17] = t4;
98
- $[18] = t5;
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
- t5 = $[18];
121
+ t6 = $[23];
101
122
  }
102
- return t5;
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(19);
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] = side;
134
- $[4] = sideOffset;
135
- $[5] = t1;
136
- $[6] = variant;
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
- side = $[3];
141
- sideOffset = $[4];
142
- t1 = $[5];
143
- variant = $[6];
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 t2 = POPUP_VARIANT[variant];
147
- let t3;
148
- if ($[7] !== className || $[8] !== t2) {
149
- t3 = withClass(t2, className);
150
- $[7] = className;
151
- $[8] = t2;
152
- $[9] = t3;
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
- t3 = $[9];
180
+ t2 = $[9];
155
181
  }
182
+ const t3 = POPUP_VARIANT[variant];
156
183
  let t4;
157
- if ($[10] !== popupProps || $[11] !== t3) {
158
- t4 = /*#__PURE__*/_jsx(BasePreviewCard.Popup, {
159
- className: t3,
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] !== align || $[14] !== placement || $[15] !== side || $[16] !== sideOffset || $[17] !== t4) {
170
- t5 = /*#__PURE__*/_jsx(BasePreviewCard.Portal, {
171
- children: /*#__PURE__*/_jsx(BasePreviewCard.Positioner, {
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: t4
215
+ children: [t5, scrollbars]
178
216
  })
179
217
  });
180
- $[13] = align;
181
- $[14] = placement;
182
- $[15] = side;
183
- $[16] = sideOffset;
184
- $[17] = t4;
185
- $[18] = t5;
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
- t5 = $[18];
226
+ t6 = $[23];
188
227
  }
189
- return t5;
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(15);
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
- const t2 = LIST_WIDTHS[listWidth];
29
- let t3;
30
- if ($[2] !== t2) {
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
- t3 = $[3];
34
+ t2 = $[2];
36
35
  }
36
+ const t3 = LIST_WIDTHS[listWidth];
37
37
  let t4;
38
- if ($[4] !== list || $[5] !== listLabel || $[6] !== t3) {
39
- t4 = /*#__PURE__*/_jsx("nav", {
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: t3,
50
+ className: t4,
51
+ viewportClassName: "flex flex-col gap-0.5 p-2",
42
52
  children: list
43
53
  });
44
- $[4] = list;
45
- $[5] = listLabel;
46
- $[6] = t3;
54
+ $[5] = list;
55
+ $[6] = listLabel;
47
56
  $[7] = t4;
57
+ $[8] = t5;
48
58
  } else {
49
- t4 = $[7];
59
+ t5 = $[8];
50
60
  }
51
- let t5;
52
- if ($[8] !== detail) {
53
- t5 = /*#__PURE__*/_jsx("div", {
54
- className: "min-h-0 min-w-0 grow overflow-y-auto",
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
- $[8] = detail;
61
- $[9] = t5;
70
+ $[9] = detail;
71
+ $[10] = t6;
62
72
  } else {
63
- t5 = $[9];
73
+ t6 = $[10];
64
74
  }
65
- let t6;
66
- if ($[10] !== ref || $[11] !== t1 || $[12] !== t4 || $[13] !== t5) {
67
- t6 = /*#__PURE__*/_jsxs("div", {
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: [t4, t5]
80
+ children: [t5, t6]
71
81
  });
72
- $[10] = ref;
73
- $[11] = t1;
74
- $[12] = t4;
82
+ $[11] = ref;
83
+ $[12] = t1;
75
84
  $[13] = t5;
76
85
  $[14] = t6;
86
+ $[15] = t7;
77
87
  } else {
78
- t6 = $[14];
88
+ t7 = $[15];
79
89
  }
80
- return t6;
90
+ return t7;
81
91
  }
82
92
  export function MasterItem(t0) {
83
93
  const $ = _c(9);
@@ -1,5 +1,5 @@
1
- import { type ComponentType, type ReactNode, type Ref } from 'react';
2
1
  import { type LucideIcon } from 'lucide-react';
2
+ import { type ComponentType, type ReactNode, type Ref } from 'react';
3
3
  export interface SettingsSectionEntry {
4
4
  id: string;
5
5
  icon: LucideIcon;
@@ -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
- /* How far a pane with a hero scrolls before the title bar over it is filled in. */
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("div", {
125
- ref: list,
126
- className: "scroll-fade-y flex min-h-0 flex-col gap-3.5 overflow-y-auto",
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("ul", {
353
- className: "flex min-h-0 flex-col gap-0.5 overflow-y-auto",
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 overflow-y-auto px-8 pb-10 max-[960px]:px-4", !entry_2.split && !Hero && "scroll-fade-top pt-1"),
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,5 +1,5 @@
1
- import { type ReactNode, type Ref } from 'react';
2
1
  import type { LucideIcon } from 'lucide-react';
2
+ import { type ReactNode, type Ref } from 'react';
3
3
  export interface SettingsRowProps {
4
4
  label: ReactNode;
5
5
  description?: ReactNode;
@@ -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';
@@ -1,5 +1,5 @@
1
- import type { ReactNode, Ref } from 'react';
2
1
  import type { LucideIcon } from 'lucide-react';
2
+ import type { ReactNode, Ref } from 'react';
3
3
  export interface SettingsSectionProps {
4
4
  title?: string;
5
5
  description?: ReactNode;
@@ -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'> & {
@@ -1,10 +1,10 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { Children, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
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";
@@ -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