@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.
Files changed (184) 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.d.ts +1 -1
  18. package/dist/FileIcon.js +44 -36
  19. package/dist/Icon.d.ts +1 -1
  20. package/dist/IconButton.d.ts +3 -3
  21. package/dist/IconButton.js +2 -2
  22. package/dist/IconPicker.js +35 -32
  23. package/dist/Input.d.ts +1 -1
  24. package/dist/ListRow.js +1 -1
  25. package/dist/MiddleTruncate.js +2 -2
  26. package/dist/PanelEmpty.d.ts +1 -1
  27. package/dist/PanelHeader.d.ts +1 -1
  28. package/dist/PanelHeader.js +1 -1
  29. package/dist/ProjectSwitcher.js +1 -1
  30. package/dist/PromptDialog.d.ts +1 -1
  31. package/dist/ScrollArea.d.ts +12 -0
  32. package/dist/ScrollArea.js +144 -0
  33. package/dist/SectionLabel.js +1 -1
  34. package/dist/SegmentBar.js +1 -1
  35. package/dist/Segmented.d.ts +1 -1
  36. package/dist/Select.d.ts +1 -1
  37. package/dist/Select.js +22 -16
  38. package/dist/SelectSearch.js +49 -33
  39. package/dist/ShortcutHints.js +1 -1
  40. package/dist/Slider.js +2 -2
  41. package/dist/SlidingColumn.js +1 -1
  42. package/dist/SplitButton.js +1 -1
  43. package/dist/Surface.js +1 -1
  44. package/dist/Switch.js +1 -1
  45. package/dist/TextMenu.js +2 -2
  46. package/dist/Toasts.js +2 -2
  47. package/dist/Tooltip.d.ts +1 -1
  48. package/dist/Tooltip.js +1 -1
  49. package/dist/UIProvider.d.ts +1 -1
  50. package/dist/Waveform.js +1 -1
  51. package/dist/Wipe.js +2 -2
  52. package/dist/combobox/parts.d.ts +3 -3
  53. package/dist/combobox/parts.js +53 -32
  54. package/dist/command-palette/parts.d.ts +1 -1
  55. package/dist/command-palette/parts.js +22 -7
  56. package/dist/command-palette/virtual.js +4 -4
  57. package/dist/dialog/parts.d.ts +1 -1
  58. package/dist/dialog/parts.js +2 -2
  59. package/dist/file-icon.d.ts +2 -0
  60. package/dist/file-icon.js +12 -0
  61. package/dist/file-tree/parts.d.ts +2 -2
  62. package/dist/file-tree/parts.js +3 -3
  63. package/dist/file-tree/use-file-tree-shift.d.ts +1 -1
  64. package/dist/file-tree/use-file-tree-shift.js +1 -1
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.js +2 -0
  67. package/dist/key-value-list/parts.js +1 -1
  68. package/dist/menu/parts.d.ts +3 -3
  69. package/dist/menu/parts.js +46 -30
  70. package/dist/popover/parts.d.ts +3 -3
  71. package/dist/popover/parts.js +110 -71
  72. package/dist/project-switcher-row.js +1 -1
  73. package/dist/scrollbar-geometry.d.ts +15 -0
  74. package/dist/scrollbar-geometry.js +48 -0
  75. package/dist/settings/MasterDetail.js +40 -30
  76. package/dist/settings/SettingsDialog.d.ts +1 -1
  77. package/dist/settings/SettingsDialog.js +27 -11
  78. package/dist/settings/SettingsRow.d.ts +1 -1
  79. package/dist/settings/SettingsRow.js +1 -1
  80. package/dist/settings/SettingsSection.d.ts +1 -1
  81. package/dist/tabs/parts.d.ts +1 -1
  82. package/dist/tabs/parts.js +3 -3
  83. package/dist/testing/dedupe.js +1 -1
  84. package/dist/theme.css +91 -1
  85. package/dist/tree/parts.js +2 -2
  86. package/dist/useOverlayScrollbars.d.ts +7 -0
  87. package/dist/useOverlayScrollbars.js +281 -0
  88. package/dist/workspace/PaneBar.js +2 -2
  89. package/dist/workspace/SplitView.d.ts +1 -1
  90. package/dist/workspace/SplitView.js +4 -4
  91. package/dist/workspace/TabStrip.d.ts +1 -1
  92. package/dist/workspace/TabStrip.js +2 -2
  93. package/dist/workspace/Workspace.d.ts +1 -1
  94. package/dist/workspace/Workspace.js +2 -2
  95. package/dist/workspace/WorkspaceRail.js +1 -1
  96. package/dist/workspace/WorkspaceTopRow.js +1 -1
  97. package/package.json +1 -1
  98. package/src/AccentSwatches.tsx +1 -1
  99. package/src/Banner.tsx +1 -1
  100. package/src/Button.tsx +1 -1
  101. package/src/ButtonGroup.tsx +1 -1
  102. package/src/Checkbox.tsx +2 -2
  103. package/src/ChoiceCards.tsx +3 -3
  104. package/src/CloseButton.tsx +2 -2
  105. package/src/ColorSwatch.tsx +2 -2
  106. package/src/ColorWheelPicker.tsx +1 -1
  107. package/src/ColumnResizeHandle.tsx +1 -1
  108. package/src/CopyButton.tsx +1 -1
  109. package/src/DockShell.tsx +1 -1
  110. package/src/EmptyState.tsx +2 -2
  111. package/src/ErrorBoundary.tsx +4 -3
  112. package/src/Field.tsx +2 -2
  113. package/src/FileIcon.tsx +15 -6
  114. package/src/Icon.tsx +2 -2
  115. package/src/IconButton.tsx +3 -3
  116. package/src/IconPicker.tsx +7 -6
  117. package/src/Input.tsx +2 -2
  118. package/src/Kbd.tsx +1 -1
  119. package/src/ListRow.tsx +1 -1
  120. package/src/Meter.tsx +1 -1
  121. package/src/MiddleTruncate.tsx +2 -2
  122. package/src/PanelEmpty.tsx +2 -2
  123. package/src/PanelHeader.tsx +2 -2
  124. package/src/Pill.tsx +1 -1
  125. package/src/ProjectSwitcher.tsx +2 -2
  126. package/src/PromptDialog.tsx +1 -1
  127. package/src/RelativeTime.tsx +1 -1
  128. package/src/ScrollArea.tsx +47 -0
  129. package/src/SectionLabel.tsx +1 -1
  130. package/src/SegmentBar.tsx +1 -1
  131. package/src/Segmented.tsx +1 -1
  132. package/src/Select.tsx +6 -2
  133. package/src/SelectSearch.tsx +19 -12
  134. package/src/Separator.tsx +1 -1
  135. package/src/ShortcutHints.tsx +1 -1
  136. package/src/Skeleton.tsx +1 -1
  137. package/src/Slider.tsx +2 -2
  138. package/src/SlidingColumn.tsx +1 -1
  139. package/src/Spinner.tsx +1 -1
  140. package/src/SplitButton.tsx +1 -1
  141. package/src/Stepper.tsx +1 -1
  142. package/src/Surface.tsx +1 -1
  143. package/src/Switch.tsx +2 -2
  144. package/src/TextMenu.tsx +2 -2
  145. package/src/Tile.tsx +1 -1
  146. package/src/Toasts.tsx +2 -2
  147. package/src/Tooltip.tsx +2 -2
  148. package/src/UIProvider.tsx +1 -1
  149. package/src/Waveform.tsx +1 -1
  150. package/src/Wipe.tsx +2 -2
  151. package/src/ZoomControls.tsx +1 -1
  152. package/src/combobox/parts.tsx +9 -4
  153. package/src/command-palette/parts.tsx +25 -19
  154. package/src/command-palette/virtual.tsx +4 -4
  155. package/src/dialog/parts.tsx +2 -2
  156. package/src/file-icon.ts +15 -0
  157. package/src/file-tree/parts.tsx +6 -6
  158. package/src/file-tree/use-empty-lines.ts +1 -1
  159. package/src/file-tree/use-file-tree-shift.tsx +2 -2
  160. package/src/file-tree/use-slots.ts +2 -2
  161. package/src/index.ts +2 -0
  162. package/src/key-value-list/parts.tsx +1 -1
  163. package/src/menu/parts.tsx +11 -6
  164. package/src/popover/parts.tsx +13 -5
  165. package/src/project-switcher-row.tsx +2 -2
  166. package/src/scrollbar-geometry.ts +67 -0
  167. package/src/select-shared.ts +1 -1
  168. package/src/settings/DetailHeader.tsx +1 -1
  169. package/src/settings/MasterDetail.tsx +9 -6
  170. package/src/settings/SettingsDialog.tsx +16 -9
  171. package/src/settings/SettingsRow.tsx +1 -1
  172. package/src/settings/SettingsSection.tsx +1 -1
  173. package/src/tabs/parts.tsx +4 -4
  174. package/src/testing/dedupe.ts +1 -1
  175. package/src/theme.css +91 -1
  176. package/src/tree/parts.tsx +2 -2
  177. package/src/useOverlayScrollbars.tsx +263 -0
  178. package/src/workspace/DropPreview.tsx +1 -1
  179. package/src/workspace/PaneBar.tsx +2 -2
  180. package/src/workspace/SplitView.tsx +5 -5
  181. package/src/workspace/TabStrip.tsx +3 -3
  182. package/src/workspace/Workspace.tsx +2 -2
  183. package/src/workspace/WorkspaceRail.tsx +1 -1
  184. package/src/workspace/WorkspaceTopRow.tsx +1 -1
@@ -1,7 +1,7 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useState } from 'react';
3
2
  import clsx from 'clsx';
4
3
  import { ChevronDown } from 'lucide-react';
4
+ import { useState } from 'react';
5
5
  import { splitFrameClass, splitHalfClass } from './button-class.js';
6
6
  import { Icon } from "./Icon.js";
7
7
  import { MenuPopup, MenuRoot, MenuTrigger } from "./menu/parts.js";
package/dist/Surface.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import clsx from 'clsx';
3
2
  import { useRender } from '@base-ui/react/use-render';
3
+ import clsx from 'clsx';
4
4
  const FLOAT = 'border border-border bg-[color-mix(in_srgb,var(--surface-raised)_88%,transparent)] shadow-float backdrop-blur-[14px]';
5
5
  /*
6
6
  * The glass card that floats over the content under it: a dock, a banner, a toast, a find bar, a
package/dist/Switch.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import clsx from 'clsx';
3
2
  import { Switch as BaseSwitch } from '@base-ui/react/switch';
3
+ import clsx from 'clsx';
4
4
  /* On or off, as a switch rather than a checkbox: a setting that takes effect the moment it flips. */
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  export function Switch(t0) {
package/dist/TextMenu.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useRef, useState } from 'react';
3
2
  import { Copy, Scan } from 'lucide-react';
3
+ import { useRef, useState } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { copyText } from './clipboard.js';
6
6
  import { Icon } from "./Icon.js";
7
7
  import { Kbd } from "./Kbd.js";
8
- import { mergeRefs } from './merge-refs.js';
9
8
  import { ContextMenuRoot, ContextMenuTrigger, MenuItem, MenuPopup, MenuSeparator } from "./menu/parts.js";
9
+ import { mergeRefs } from './merge-refs.js';
10
10
  import { isApplePlatform } from './platform.js';
11
11
  import { selectAllWithin, selectionWithin } from './selection.js';
12
12
  import { EDIT_SHORTCUTS, matchesShortcut } from './shortcut.js';
package/dist/Toasts.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useState } from 'react';
3
2
  import clsx from 'clsx';
4
- import { useTranslation } from 'react-i18next';
5
3
  import { CircleAlert, CircleCheck, Trash, X } from 'lucide-react';
4
+ import { useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { useStore } from 'zustand';
7
7
  import { Button } from "./Button.js";
8
8
  import { Icon } from "./Icon.js";
package/dist/Tooltip.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
2
1
  import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
2
+ import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
3
3
  import type { Shortcut } from './shortcut.ts';
4
4
  export type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
5
5
  export declare function TooltipProvider({ children }: {
package/dist/Tooltip.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import 'react';
3
2
  import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
3
+ import 'react';
4
4
  import { Kbd } from "./Kbd.js";
5
5
  import { registerShortcutHint } from './shortcut-hints.js';
6
6
  /* One provider per app. Tooltips share a delay, so moving along a row of buttons feels instant. `UIProvider` mounts it. */
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
1
  import type { i18n as I18n } from 'i18next';
2
+ import { type ReactNode } from 'react';
3
3
  import { type FormatSource } from './format/locale.ts';
4
4
  export interface UIProviderProps {
5
5
  i18n: I18n;
package/dist/Waveform.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useRef } from 'react';
3
2
  import clsx from 'clsx';
3
+ import { useRef } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { formatClockDuration } from './format/duration.js';
6
6
  import { mergeRefs } from './merge-refs.js';
package/dist/Wipe.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useRef } from 'react';
3
2
  import clsx from 'clsx';
4
3
  import { ChevronsLeftRight } from 'lucide-react';
5
- import { Icon } from "./Icon.js";
4
+ import { useRef } from 'react';
6
5
  import { formatPercent } from './format/number.js';
6
+ import { Icon } from "./Icon.js";
7
7
  import { mergeRefs } from './merge-refs.js';
8
8
  import { splitAt, splitForKey } from './wipe-split.js';
9
9
  /* It fills the positioned element it sits in. A plain line handle is dragged anywhere along its height. */
@@ -1,6 +1,6 @@
1
- import type { ComponentProps, ReactNode } from 'react';
2
- import type { LucideIcon } from 'lucide-react';
3
1
  import { Autocomplete } from '@base-ui/react/autocomplete';
2
+ import type { LucideIcon } from 'lucide-react';
3
+ import { type ComponentProps, type ReactNode } from 'react';
4
4
  import { type PlacementKey } from '../placement.ts';
5
5
  import type { Shortcut } from '../shortcut.ts';
6
6
  export declare const ComboboxRoot: typeof Autocomplete.Root;
@@ -13,7 +13,7 @@ export type ComboboxInputProps = Omit<ComponentProps<typeof Autocomplete.Input>,
13
13
  export declare function ComboboxInput({ size, mono, icon, className, id, ...props }: ComboboxInputProps): import("react").JSX.Element;
14
14
  type Placement = Pick<ComponentProps<typeof Autocomplete.Positioner>, PlacementKey>;
15
15
  export type ComboboxPopupProps = ComponentProps<typeof Autocomplete.Popup> & Placement;
16
- export declare function ComboboxPopup({ side, align, sideOffset, className, ...props }: ComboboxPopupProps): import("react").JSX.Element;
16
+ export declare function ComboboxPopup({ side, align, sideOffset, className, ref, ...props }: ComboboxPopupProps): import("react").JSX.Element;
17
17
  export declare function ComboboxList(props: ComponentProps<typeof Autocomplete.List>): import("react").JSX.Element;
18
18
  export type ComboboxItemProps = ComponentProps<typeof Autocomplete.Item> & {
19
19
  icon?: ReactNode;
@@ -1,14 +1,17 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { Autocomplete } from '@base-ui/react/autocomplete';
2
3
  import clsx from 'clsx';
4
+ import { useState } from 'react';
3
5
  import { useTranslation } from 'react-i18next';
4
- import { Autocomplete } from '@base-ui/react/autocomplete';
5
6
  import { withClass } from '../class-name.js';
6
7
  import { fieldControlProps, useFieldControl } from '../field-context.js';
7
8
  import { Icon } from "../Icon.js";
8
9
  import { Kbd } from "../Kbd.js";
9
10
  import { MENU_LABEL } from "../menu/parts.js";
11
+ import { mergeRefs } from '../merge-refs.js';
10
12
  import { splitPlacement } from '../placement.js';
11
13
  import { renderPositioner } from '../popup-layer.js';
14
+ import { useOverlayScrollbars } from "../useOverlayScrollbars.js";
12
15
  /* It takes no room while it has nothing to say. */
13
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
17
  const LIST_NOTE = 'text-center text-xs text-text-faint not-empty:px-3 not-empty:py-4';
@@ -172,9 +175,10 @@ export function ComboboxInput(t0) {
172
175
  return t15;
173
176
  }
174
177
  export function ComboboxPopup(t0) {
175
- const $ = _c(17);
178
+ const $ = _c(22);
176
179
  let align;
177
180
  let className;
181
+ let ref;
178
182
  let side;
179
183
  let sideOffset;
180
184
  let t1;
@@ -184,9 +188,11 @@ export function ComboboxPopup(t0) {
184
188
  align: t3,
185
189
  sideOffset: t4,
186
190
  className: t5,
191
+ ref: t6,
187
192
  ...props
188
193
  } = t0;
189
194
  className = t5;
195
+ ref = t6;
190
196
  side = t2 === undefined ? "bottom" : t2;
191
197
  align = t3 === undefined ? "start" : t3;
192
198
  sideOffset = t4 === undefined ? 6 : t4;
@@ -194,60 +200,75 @@ export function ComboboxPopup(t0) {
194
200
  $[0] = t0;
195
201
  $[1] = align;
196
202
  $[2] = className;
197
- $[3] = side;
198
- $[4] = sideOffset;
199
- $[5] = t1;
203
+ $[3] = ref;
204
+ $[4] = side;
205
+ $[5] = sideOffset;
206
+ $[6] = t1;
200
207
  } else {
201
208
  align = $[1];
202
209
  className = $[2];
203
- side = $[3];
204
- sideOffset = $[4];
205
- t1 = $[5];
210
+ ref = $[3];
211
+ side = $[4];
212
+ sideOffset = $[5];
213
+ t1 = $[6];
206
214
  }
207
215
  const [placement, popupProps] = t1;
216
+ const [popup, setPopup] = useState(null);
217
+ const scrollbars = useOverlayScrollbars(popup);
208
218
  let t2;
209
- if ($[6] !== className) {
210
- t2 = withClass("menu-popup min-w-(--anchor-width)", className);
211
- $[6] = className;
212
- $[7] = t2;
219
+ if ($[7] !== ref) {
220
+ t2 = mergeRefs(setPopup, ref);
221
+ $[7] = ref;
222
+ $[8] = t2;
213
223
  } else {
214
- t2 = $[7];
224
+ t2 = $[8];
215
225
  }
216
226
  let t3;
217
- if ($[8] !== popupProps || $[9] !== t2) {
218
- t3 = /*#__PURE__*/_jsx(Autocomplete.Popup, {
219
- className: t2,
220
- ...popupProps
221
- });
222
- $[8] = popupProps;
223
- $[9] = t2;
227
+ if ($[9] !== className) {
228
+ t3 = withClass("menu-popup min-w-(--anchor-width)", className);
229
+ $[9] = className;
224
230
  $[10] = t3;
225
231
  } else {
226
232
  t3 = $[10];
227
233
  }
228
234
  let t4;
229
- if ($[11] !== align || $[12] !== placement || $[13] !== side || $[14] !== sideOffset || $[15] !== t3) {
230
- t4 = /*#__PURE__*/_jsx(Autocomplete.Portal, {
231
- children: /*#__PURE__*/_jsx(Autocomplete.Positioner, {
235
+ if ($[11] !== popupProps || $[12] !== t2 || $[13] !== t3) {
236
+ t4 = /*#__PURE__*/_jsx(Autocomplete.Popup, {
237
+ ref: t2,
238
+ className: t3,
239
+ ...popupProps
240
+ });
241
+ $[11] = popupProps;
242
+ $[12] = t2;
243
+ $[13] = t3;
244
+ $[14] = t4;
245
+ } else {
246
+ t4 = $[14];
247
+ }
248
+ let t5;
249
+ if ($[15] !== align || $[16] !== placement || $[17] !== scrollbars || $[18] !== side || $[19] !== sideOffset || $[20] !== t4) {
250
+ t5 = /*#__PURE__*/_jsx(Autocomplete.Portal, {
251
+ children: /*#__PURE__*/_jsxs(Autocomplete.Positioner, {
232
252
  className: "popup-positioner",
233
253
  render: renderPositioner,
234
254
  ...placement,
235
255
  side: side,
236
256
  align: align,
237
257
  sideOffset: sideOffset,
238
- children: t3
258
+ children: [t4, scrollbars]
239
259
  })
240
260
  });
241
- $[11] = align;
242
- $[12] = placement;
243
- $[13] = side;
244
- $[14] = sideOffset;
245
- $[15] = t3;
246
- $[16] = t4;
261
+ $[15] = align;
262
+ $[16] = placement;
263
+ $[17] = scrollbars;
264
+ $[18] = side;
265
+ $[19] = sideOffset;
266
+ $[20] = t4;
267
+ $[21] = t5;
247
268
  } else {
248
- t4 = $[16];
269
+ t5 = $[21];
249
270
  }
250
- return t4;
271
+ return t5;
251
272
  }
252
273
  export function ComboboxList(props) {
253
274
  const $ = _c(5);
@@ -1,6 +1,6 @@
1
- import { type ComponentProps, type ReactNode } from 'react';
2
1
  import { Autocomplete } from '@base-ui/react/autocomplete';
3
2
  import { useRender } from '@base-ui/react/use-render';
3
+ import { type ComponentProps, type ReactNode } from 'react';
4
4
  import { DialogRoot, type DialogPopupProps } from '../dialog/parts.tsx';
5
5
  declare const SIZE: {
6
6
  readonly md: 'w-[576px]';
@@ -1,17 +1,18 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useContext, useLayoutEffect, useRef, useState } from 'react';
3
- import { flushSync } from 'react-dom';
2
+ import { Autocomplete } from '@base-ui/react/autocomplete';
3
+ import { useRender } from '@base-ui/react/use-render';
4
4
  import clsx from 'clsx';
5
5
  import { Search } from 'lucide-react';
6
+ import { useContext, useLayoutEffect, useRef, useState } from 'react';
7
+ import { flushSync } from 'react-dom';
6
8
  import { useTranslation } from 'react-i18next';
7
- import { Autocomplete } from '@base-ui/react/autocomplete';
8
- import { useRender } from '@base-ui/react/use-render';
9
9
  import { withClass } from '../class-name.js';
10
10
  import { DialogPopup, DialogRoot } from "../dialog/parts.js";
11
11
  import { Icon } from "../Icon.js";
12
12
  import { Kbd } from "../Kbd.js";
13
13
  import { mergeRefs } from '../merge-refs.js';
14
14
  import { KEY_SHORTCUTS } from '../shortcut.js';
15
+ import { useOverlayScrollbars } from "../useOverlayScrollbars.js";
15
16
  import { PaletteRefsContext } from './context.js';
16
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const NO_ITEMS = [];
@@ -306,7 +307,7 @@ export function CommandPaletteInput(t0) {
306
307
  }
307
308
  /* It scrolls on its own, so the field and the footer stay put. */
308
309
  export function CommandPaletteList(t0) {
309
- const $ = _c(21);
310
+ const $ = _c(24);
310
311
  let className;
311
312
  let onFocus;
312
313
  let props;
@@ -333,10 +334,12 @@ export function CommandPaletteList(t0) {
333
334
  t
334
335
  } = useTranslation("ui");
335
336
  const refs = useContext(PaletteRefsContext);
337
+ const [list, setList] = useState(null);
338
+ const scrollbars = useOverlayScrollbars(list);
336
339
  const t1 = refs?.list;
337
340
  let t2;
338
341
  if ($[5] !== ref || $[6] !== t1) {
339
- t2 = mergeRefs(ref, t1);
342
+ t2 = mergeRefs(ref, t1, setList);
340
343
  $[5] = ref;
341
344
  $[6] = t1;
342
345
  $[7] = t2;
@@ -396,7 +399,19 @@ export function CommandPaletteList(t0) {
396
399
  } else {
397
400
  t6 = $[20];
398
401
  }
399
- return t6;
402
+ let t7;
403
+ if ($[21] !== scrollbars || $[22] !== t6) {
404
+ t7 = /*#__PURE__*/_jsxs("div", {
405
+ className: "relative flex min-h-0 flex-col",
406
+ children: [t6, scrollbars]
407
+ });
408
+ $[21] = scrollbars;
409
+ $[22] = t6;
410
+ $[23] = t7;
411
+ } else {
412
+ t7 = $[23];
413
+ }
414
+ return t7;
400
415
  }
401
416
  export function CommandPaletteFooter(t0) {
402
417
  const $ = _c(14);
@@ -1,10 +1,10 @@
1
- import { Fragment, useLayoutEffect, useMemo, useRef } from 'react';
2
- import { useVirtualizer } from '@tanstack/react-virtual';
3
1
  import { Autocomplete } from '@base-ui/react/autocomplete';
4
- import { CommandPaletteList } from "./parts.js";
5
- import { useCommandPaletteVirtualScroll } from './context.js';
2
+ import { useVirtualizer } from '@tanstack/react-virtual';
3
+ import { Fragment, useLayoutEffect, useMemo, useRef } from 'react';
6
4
  import { MENU_LABEL } from "../menu/parts.js";
7
5
  import { mergeRefs } from '../merge-refs.js';
6
+ import { useCommandPaletteVirtualScroll } from './context.js';
7
+ import { CommandPaletteList } from "./parts.js";
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  function virtualRowsOf(values, labelled) {
10
10
  const groups = [];
@@ -1,6 +1,6 @@
1
- import { type ComponentProps } from 'react';
2
1
  import { Dialog as BaseDialog } from '@base-ui/react/dialog';
3
2
  import { useRender } from '@base-ui/react/use-render';
3
+ import { type ComponentProps } from 'react';
4
4
  declare const SIZE: {
5
5
  readonly sm: 'w-[420px] p-5';
6
6
  };
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { createContext, useContext, useState } from 'react';
3
- import clsx from 'clsx';
4
2
  import { Dialog as BaseDialog } from '@base-ui/react/dialog';
5
3
  import { useRender } from '@base-ui/react/use-render';
4
+ import clsx from 'clsx';
5
+ import { createContext, useContext, useState } from 'react';
6
6
  import { withClass } from '../class-name.js';
7
7
  import { useDialogLayer } from '../dialog-layer.js';
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -2,5 +2,7 @@ import { type FileTreeIconConfig } from '@pierre/trees';
2
2
  export declare const FILE_TREE_ICONS: FileTreeIconConfig;
3
3
  export declare const fileIconFor: (path: string) => string;
4
4
  export declare function setFileIconOverride(next: ((path: string) => string | null) | null): void;
5
+ export declare function subscribeFileIconOverride(onChange: () => void): () => void;
6
+ export declare const fileIconOverrideVersion: () => number;
5
7
  export declare function fileIconOverrideFor(path: string): string | null;
6
8
  export declare const mountFileIconSprite: () => void;
package/dist/file-icon.js CHANGED
@@ -25,10 +25,22 @@ const resolveIcon = (...args) => {
25
25
  */
26
26
  export const fileIconFor = path => resolveIcon('file-tree-icon-file', path).name;
27
27
  let override = null;
28
+ let overrideVersion = 0;
29
+ const overrideListeners = new Set();
28
30
  /* What an app knows better about a file's icon: the address of an svg, or null for the icon this set has. */
29
31
  export function setFileIconOverride(next) {
30
32
  override = next;
33
+ overrideVersion++;
34
+ overrideListeners.forEach(listener => listener());
31
35
  }
36
+ export function subscribeFileIconOverride(onChange) {
37
+ overrideListeners.add(onChange);
38
+ return () => {
39
+ overrideListeners.delete(onChange);
40
+ };
41
+ }
42
+ /* A mounted icon reads this so it draws again once the override changes. */
43
+ export const fileIconOverrideVersion = () => overrideVersion;
32
44
  export function fileIconOverrideFor(path) {
33
45
  return override?.(path) ?? null;
34
46
  }
@@ -1,8 +1,8 @@
1
- import { type ReactNode } from 'react';
2
1
  import { useRender } from '@base-ui/react/use-render';
3
- import { type FileTreeProps as PierreProps } from '@pierre/trees/react';
4
2
  import type { FileTree, FileTreeVisibleRow } from '@pierre/trees';
3
+ import { type FileTreeProps as PierreProps } from '@pierre/trees/react';
5
4
  import type { LucideIcon } from 'lucide-react';
5
+ import { type ReactNode } from 'react';
6
6
  import type { FileTreeEmptyLabel } from './empty-lines.ts';
7
7
  import { type FileTreeDecorationOrder } from './use-slots.ts';
8
8
  export type FileTreeRootProps = useRender.ComponentProps<'div'> & {
@@ -1,10 +1,10 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
3
- import { createPortal } from 'react-dom';
4
2
  import { useRender } from '@base-ui/react/use-render';
5
3
  import { FileTree as PierreFileTree } from '@pierre/trees/react';
6
- import { useTranslation } from 'react-i18next';
7
4
  import clsx from 'clsx';
5
+ import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
6
+ import { createPortal } from 'react-dom';
7
+ import { useTranslation } from 'react-i18next';
8
8
  import { Icon } from "../Icon.js";
9
9
  import { mergeRefs } from '../merge-refs.js';
10
10
  import { directoryHandle, extendsSelection, followFocus, movesFocus, menuTargetsOf, rowPathOf, visibleRows } from './helpers.js';
@@ -1,5 +1,5 @@
1
- import { type ReactElement } from 'react';
2
1
  import type { FileTree } from '@pierre/trees';
2
+ import { type ReactElement } from 'react';
3
3
  export declare function useFileTreeShift(model: FileTree, resetKey?: string): {
4
4
  attach(node: HTMLElement | null): void;
5
5
  bar: ReactElement;
@@ -1,7 +1,7 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import 'react';
3
- import { useTreeShift } from "../tree/use-tree-shift.js";
4
3
  import { shiftNeed } from '../tree/shift.js';
4
+ import { useTreeShift } from "../tree/use-tree-shift.js";
5
5
  const ROWS = '[data-type="item"]:not([data-item-parked="true"])';
6
6
  function boxesOf(element) {
7
7
  return element.getClientRects().length > 0 ? [element] : [...element.children].flatMap(child => boxesOf(child));
package/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ export { Pill, type PillProps } from './Pill.tsx';
48
48
  export { PromptDialog, type PromptDialogProps } from './PromptDialog.tsx';
49
49
  export { RelativeTime, type RelativeTimeProps } from './RelativeTime.tsx';
50
50
  export { ProjectSwitcher, ProjectSwitcherGroups, type ProjectSwitcherItem, type ProjectSwitcherProps } from './ProjectSwitcher.tsx';
51
+ export { ScrollArea, type ScrollAreaProps } from './ScrollArea.tsx';
51
52
  export { SectionLabel, type SectionLabelProps } from './SectionLabel.tsx';
52
53
  export { SegmentBar, type SegmentBarPart, type SegmentBarProps } from './SegmentBar.tsx';
53
54
  export { Segmented, type SegmentedOption, type SegmentedProps } from './Segmented.tsx';
@@ -92,6 +93,7 @@ export { clampColumnSize, useColumnResize, type ColumnEdge, type ColumnResize, t
92
93
  export { useContentSize, type ContentSize } from './useContentSize.ts';
93
94
  export { useMeasuredWidth } from './useMeasuredWidth.ts';
94
95
  export { useNow, useTickingText } from './useNow.ts';
96
+ export { useOverlayScrollbars, type OverlayScrollbarsOptions, type ScrollAreaAxis } from './useOverlayScrollbars.tsx';
95
97
  export { useFileTree, type FileTreeOptions } from './file-tree/use-file-tree.ts';
96
98
  export type { FileTreeRootProps } from './file-tree/parts.tsx';
97
99
  export type { FileTree as FileTreeModel, FileTreeVisibleRow, FileTreeDragAndDropConfig, FileTreeDropContext, FileTreeDropResult } from '@pierre/trees';
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ export { Pill } from "./Pill.js";
45
45
  export { PromptDialog } from "./PromptDialog.js";
46
46
  export { RelativeTime } from "./RelativeTime.js";
47
47
  export { ProjectSwitcher, ProjectSwitcherGroups } from "./ProjectSwitcher.js";
48
+ export { ScrollArea } from "./ScrollArea.js";
48
49
  export { SectionLabel } from "./SectionLabel.js";
49
50
  export { SegmentBar } from "./SegmentBar.js";
50
51
  export { Segmented } from "./Segmented.js";
@@ -86,6 +87,7 @@ export { clampColumnSize, useColumnResize } from './useColumnResize.js';
86
87
  export { useContentSize } from './useContentSize.js';
87
88
  export { useMeasuredWidth } from './useMeasuredWidth.js';
88
89
  export { useNow, useTickingText } from './useNow.js';
90
+ export { useOverlayScrollbars } from "./useOverlayScrollbars.js";
89
91
  export { useFileTree } from './file-tree/use-file-tree.js';
90
92
  export { Workspace } from "./workspace/Workspace.js";
91
93
  export { WorkspaceRail, WorkspaceRailSeparator, WorkspaceRailSpacer } from "./workspace/WorkspaceRail.js";
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import clsx from 'clsx';
3
2
  import { useRender } from '@base-ui/react/use-render';
3
+ import clsx from 'clsx';
4
4
  /* Every item is a subgrid of the list, so the names line up across rows and a hairline runs under both columns. */
5
5
  export function KeyValueListRoot(t0) {
6
6
  const $ = _c(16);
@@ -1,9 +1,9 @@
1
- import { type ComponentProps, type ReactNode, type Ref } from 'react';
2
- import { type LucideIcon } from 'lucide-react';
3
1
  import { ContextMenu as BaseContextMenu } from '@base-ui/react/context-menu';
4
2
  import { Menu as BaseMenu } from '@base-ui/react/menu';
5
3
  import { Separator as BaseSeparator } from '@base-ui/react/separator';
6
4
  import { useRender } from '@base-ui/react/use-render';
5
+ import { type LucideIcon } from 'lucide-react';
6
+ import { type ComponentProps, type ReactNode, type Ref } from 'react';
7
7
  import { type PlacementKey } from '../placement.ts';
8
8
  type PositionerProps = ComponentProps<typeof BaseMenu.Positioner>;
9
9
  type Placement = Pick<PositionerProps, PlacementKey>;
@@ -14,7 +14,7 @@ export declare function MenuSubmenuRoot(props: ComponentProps<typeof BaseMenu.Su
14
14
  export declare const MenuTrigger: BaseMenu.Trigger;
15
15
  export declare const ContextMenuTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
16
16
  export type MenuPopupProps = ComponentProps<typeof BaseMenu.Popup> & Placement;
17
- export declare function MenuPopup({ className, ...props }: MenuPopupProps): import("react").JSX.Element;
17
+ export declare function MenuPopup({ className, ref, ...props }: MenuPopupProps): import("react").JSX.Element;
18
18
  type ItemLook = {
19
19
  unstyled?: boolean;
20
20
  };