@pzerelles/headlessui-svelte 2.1.2-next.10 → 2.1.2-next.11

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 (68) hide show
  1. package/dist/hooks/use-did-element-move.svelte.js +5 -10
  2. package/dist/internal/FloatingProvider.svelte +12 -0
  3. package/dist/internal/FloatingProvider.svelte.d.ts +22 -0
  4. package/dist/internal/floating-provider.svelte.d.ts +3 -0
  5. package/dist/internal/floating-provider.svelte.js +206 -0
  6. package/dist/internal/floating.svelte.d.ts +48 -23
  7. package/dist/internal/floating.svelte.js +78 -260
  8. package/dist/internal/inner.svelte.d.ts +91 -0
  9. package/dist/internal/inner.svelte.js +202 -0
  10. package/dist/listbox/Listbox.svelte +34 -51
  11. package/dist/listbox/Listbox.svelte.d.ts +2 -53
  12. package/dist/listbox/ListboxButton.svelte +7 -6
  13. package/dist/listbox/ListboxOption.svelte +6 -3
  14. package/dist/listbox/ListboxOptions.svelte +51 -50
  15. package/dist/listbox/context.svelte.d.ts +75 -0
  16. package/dist/listbox/context.svelte.js +36 -0
  17. package/dist/menu/Menu.svelte +2 -2
  18. package/dist/menu/MenuButton.svelte +4 -2
  19. package/dist/menu/MenuItems.svelte +15 -11
  20. package/dist/tabs/TabGroup.svelte.d.ts +1 -1
  21. package/dist/utils/ElementOrComponent.svelte +1 -1
  22. package/dist/utils/floating-ui/svelte/components/FloatingNode.svelte +17 -0
  23. package/dist/utils/floating-ui/svelte/components/FloatingNode.svelte.d.ts +23 -0
  24. package/dist/utils/floating-ui/svelte/components/FloatingTree.svelte +50 -0
  25. package/dist/utils/floating-ui/svelte/components/FloatingTree.svelte.d.ts +41 -0
  26. package/dist/utils/floating-ui/svelte/hooks/useFloating.svelte.d.ts +6 -0
  27. package/dist/utils/floating-ui/svelte/hooks/useFloating.svelte.js +158 -0
  28. package/dist/utils/floating-ui/svelte/hooks/useFloatingRootContext.svelte.d.ts +11 -0
  29. package/dist/utils/floating-ui/svelte/hooks/useFloatingRootContext.svelte.js +53 -0
  30. package/dist/utils/floating-ui/svelte/hooks/useId.svelte.d.ts +9 -0
  31. package/dist/utils/floating-ui/svelte/hooks/useId.svelte.js +28 -0
  32. package/dist/utils/floating-ui/svelte/hooks/useInteractions.svelte.d.ts +23 -0
  33. package/dist/utils/floating-ui/svelte/hooks/useInteractions.svelte.js +72 -0
  34. package/dist/utils/floating-ui/svelte/index.d.ts +5 -0
  35. package/dist/utils/floating-ui/svelte/index.js +5 -0
  36. package/dist/utils/floating-ui/svelte/inner.svelte.d.ts +83 -0
  37. package/dist/utils/floating-ui/svelte/inner.svelte.js +178 -0
  38. package/dist/utils/floating-ui/svelte/types.d.ts +114 -0
  39. package/dist/utils/floating-ui/svelte/types.js +1 -0
  40. package/dist/utils/floating-ui/svelte/utils/createPubSub.d.ts +5 -0
  41. package/dist/utils/floating-ui/svelte/utils/createPubSub.js +14 -0
  42. package/dist/utils/floating-ui/svelte/utils/getFloatingFocusElement.d.ts +2 -0
  43. package/dist/utils/floating-ui/svelte/utils/getFloatingFocusElement.js +13 -0
  44. package/dist/utils/floating-ui/svelte/utils/log.d.ts +2 -0
  45. package/dist/utils/floating-ui/svelte/utils/log.js +19 -0
  46. package/dist/utils/floating-ui/svelte/utils.d.ts +19 -0
  47. package/dist/utils/floating-ui/svelte/utils.js +136 -0
  48. package/dist/utils/floating-ui/svelte-dom/arrow.d.ts +22 -0
  49. package/dist/utils/floating-ui/svelte-dom/arrow.js +29 -0
  50. package/dist/utils/floating-ui/svelte-dom/index.d.ts +2 -0
  51. package/dist/utils/floating-ui/svelte-dom/index.js +2 -0
  52. package/dist/utils/floating-ui/svelte-dom/types.d.ts +80 -0
  53. package/dist/utils/floating-ui/svelte-dom/types.js +3 -0
  54. package/dist/utils/floating-ui/svelte-dom/useFloating.svelte.d.ts +6 -0
  55. package/dist/utils/floating-ui/svelte-dom/useFloating.svelte.js +183 -0
  56. package/dist/utils/floating-ui/svelte-dom/utils/deepEqual.d.ts +1 -0
  57. package/dist/utils/floating-ui/svelte-dom/utils/deepEqual.js +50 -0
  58. package/dist/utils/floating-ui/svelte-dom/utils/getDPR.d.ts +1 -0
  59. package/dist/utils/floating-ui/svelte-dom/utils/getDPR.js +7 -0
  60. package/dist/utils/floating-ui/svelte-dom/utils/roundByDPR.d.ts +1 -0
  61. package/dist/utils/floating-ui/svelte-dom/utils/roundByDPR.js +5 -0
  62. package/dist/utils/floating-ui/svelte-dom/utils/useLatestRef.d.ts +4 -0
  63. package/dist/utils/floating-ui/svelte-dom/utils/useLatestRef.js +7 -0
  64. package/dist/utils/style.d.ts +2 -0
  65. package/dist/utils/style.js +6 -0
  66. package/package.json +3 -2
  67. package/dist/listbox/ListboxStates.d.ts +0 -12
  68. package/dist/listbox/ListboxStates.js +0 -15
@@ -1,47 +1,54 @@
1
- /* eslint-disable @typescript-eslint/no-unused-expressions */
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- /* eslint-disable prefer-const */
1
+ import { useInteractions } from "../utils/floating-ui/svelte/index.js";
4
2
  import { useDisposables } from "../utils/disposables.js";
5
- import { computePosition } from "@floating-ui/dom";
6
- import { flip as flipMiddleware,
7
- //inner as innerMiddleware,
8
- offset as offsetMiddleware, shift as shiftMiddleware, size as sizeMiddleware, } from "@floating-ui/core";
9
- /*import {
10
- autoUpdate,
11
- useFloating as _useFloating,
12
- //useInnerOffset,
13
- useInteractions,
14
- //type InnerProps,
15
- type UseFloatingReturn,
16
- } from "@skeletonlabs/floating-ui-svelte"*/
17
- import { getContext, setContext, untrack } from "svelte";
18
- export function useResolvedAnchor(anchor) {
19
- if (!anchor)
20
- return null; // Disable entirely
21
- if (typeof anchor === "string")
22
- return { to: anchor }; // Simple string based value,
23
- return anchor; // User-provided value
3
+ import { getContext, untrack } from "svelte";
4
+ export { useFloatingProvider } from "./floating-provider.svelte.js";
5
+ export function useResolvedAnchor(options) {
6
+ const { anchor } = $derived(options);
7
+ return {
8
+ get anchor() {
9
+ if (!anchor)
10
+ return null; // Disable entirely
11
+ if (typeof anchor === "string")
12
+ return { to: anchor }; // Simple string based value,
13
+ return anchor; // User-provided value
14
+ },
15
+ };
24
16
  }
25
- export function useFloating() {
26
- return getContext("FloatingContext");
17
+ export function useFloatingReference() {
18
+ const context = getContext("FloatingContext");
19
+ return {
20
+ get setReference() {
21
+ return context.setReference;
22
+ },
23
+ };
24
+ }
25
+ export function useFloatingReferenceProps() {
26
+ const context = getContext("FloatingContext");
27
+ return {
28
+ get getReferenceProps() {
29
+ return context.getReferenceProps;
30
+ },
31
+ };
27
32
  }
28
33
  export function useFloatingPanelProps() {
29
- const { getFloatingProps, slot } = getContext("FloatingContext");
34
+ const context = getContext("FloatingContext");
35
+ const { getFloatingProps, slot } = $derived(context);
30
36
  return (...args) => {
31
37
  return Object.assign({}, getFloatingProps(...args), {
32
38
  "data-anchor": slot.anchor,
33
39
  });
34
40
  };
35
41
  }
36
- export function useFloatingPanel(options) {
37
- const placement = $derived.by(() => {
38
- if (options.placement === false)
39
- return null; // Disable entirely
40
- if (typeof options.placement === "string")
41
- return { to: options.placement }; // Simple string based value
42
- return options.placement;
43
- });
44
- const updatePlacementConfig = getContext("PlacementContext");
42
+ export function useFloatingPanel(options = { placement: null }) {
43
+ const placement = $derived(options.placement === false
44
+ ? null
45
+ : typeof options.placement === "string"
46
+ ? { to: options.placement }
47
+ : options.placement);
48
+ //if (placement === false) placement = null // Disable entirely
49
+ //if (typeof placement === "string") placement = { to: placement } // Simple string based value
50
+ const placementContext = getContext("PlacementContext");
51
+ const { updatePlacementConfig } = $derived(placementContext);
45
52
  const trigger = $derived(JSON.stringify(placement, typeof HTMLElement !== "undefined"
46
53
  ? (_, v) => {
47
54
  if (v instanceof HTMLElement) {
@@ -62,233 +69,41 @@ export function useFloatingPanel(options) {
62
69
  get setFloating() {
63
70
  return context.setFloating;
64
71
  },
65
- get style() {
72
+ get styles() {
66
73
  return placement ? context.styles : undefined;
67
74
  },
68
75
  };
69
76
  }
70
- // TODO: Make this a config part of the `config`. Just need to decide on a name.
71
- //let MINIMUM_ITEMS_VISIBLE = 4
72
- export const createFloatingContext = ({ enabled = true } = {}) => {
73
- let config = $state(null);
74
- //let innerOffset = $state(0)
75
- //let overflowRef = $state<HTMLElement | null>(null)
76
- let referenceEl = $state(null);
77
- let floatingEl = $state(null);
78
- $effect(() => useFixScrollingPixel(floatingEl));
79
- const isEnabled = $derived(enabled && config !== null && floatingEl !== null);
80
- const { to: placement = "bottom", gap = 0, offset = 0, padding = 0, inner, } = $derived(useResolvedConfig({
81
- get config() {
82
- return config;
83
- },
84
- get element() {
85
- return floatingEl;
86
- },
87
- }));
88
- const [to, align = "center"] = $derived(placement.split(" "));
89
- // Reset
90
- $effect(() => {
91
- if (!isEnabled)
92
- return;
93
- //innerOffset = 0
94
- });
95
- let floatingStyles = $state();
96
- let context = $state();
97
- let currentComputeId = $state(0);
77
+ export function useFixScrollingPixel(options) {
78
+ const { element } = $derived(options);
98
79
  $effect(() => {
99
- if (!referenceEl || !floatingEl)
80
+ if (!element)
100
81
  return;
101
- const computeId = untrack(() => currentComputeId + 1);
102
- currentComputeId = computeId;
103
- computePosition(referenceEl, floatingEl, {
104
- placement: to === "selection"
105
- ? align === "center"
106
- ? "bottom"
107
- : `bottom-${align}`
108
- : align === "center"
109
- ? `${to}`
110
- : `${to}-${align}`,
111
- // This component will be used in combination with a `Portal`, which means the floating
112
- // element will be rendered outside of the current DOM tree.
113
- strategy: "absolute",
114
- middleware: [
115
- // - The `mainAxis` is set to `gap` which defines the gap between the panel and the
116
- // trigger/reference.
117
- // - The `crossAxis` is set to `offset` which nudges the panel from its original position.
118
- //
119
- // When we are showing the panel on top of the selected item, we don't want a gap between the
120
- // reference and the panel, therefore setting the `mainAxis` to `0`.
121
- offsetMiddleware({
122
- mainAxis: to === "selection" ? 0 : gap,
123
- crossAxis: offset,
124
- }),
125
- // When the panel overflows the viewport, we will try to nudge the panel to the other side to
126
- // ensure it's not clipped. We use the `padding` to define the minimum space between the
127
- // panel and the viewport.
128
- shiftMiddleware({ padding }),
129
- // The `flip` middleware will swap the `placement` of the panel if there is not enough room.
130
- // This is not compatible with the `inner` middleware (which is only enabled when `to` is set
131
- // to "selection").
132
- to !== "selection" && flipMiddleware({ padding }),
133
- // The `inner` middleware will ensure the panel is always fully visible on screen and
134
- // positioned on top of the reference and moved to the currently selected item.
135
- to === "selection" && inner
136
- ? null /* TODO: use inner when available: innerMiddleware({
137
- ...inner,
138
- padding, // For overflow detection
139
- overflowRef,
140
- offset: innerOffset,
141
- minItemsVisible: MINIMUM_ITEMS_VISIBLE,
142
- referenceOverflowThreshold: padding,
143
- onFallbackChange(fallback) {
144
- if (!fallback) return
145
- let parent = context.elements.floating
146
- if (!parent) return
147
- let scrollPaddingBottom =
148
- parseFloat(getComputedStyle(parent!).scrollPaddingBottom) || 0
149
-
150
- // We want at least X visible items, but if there are less than X items in the list,
151
- // we want to show as many as possible.
152
- let missing = Math.min(MINIMUM_ITEMS_VISIBLE, parent.childElementCount)
153
-
154
- let elementHeight = 0
155
- let elementAmountVisible = 0
156
-
157
- for (let child of context.elements.floating?.childNodes ?? []) {
158
- if (child instanceof HTMLElement) {
159
- let childTop = child.offsetTop
160
- // It can be that the child is fully visible, but we also want to keep the scroll
161
- // padding into account to ensure the UI looks good. Therefore we fake that the
162
- // bottom of the child is actually `scrollPaddingBottom` amount of pixels lower.
163
- let childBottom = childTop + child.clientHeight + scrollPaddingBottom
164
-
165
- let parentTop = parent.scrollTop
166
- let parentBottom = parentTop + parent.clientHeight
167
-
168
- // Figure out if the child is fully visible in the scroll parent.
169
- if (childTop >= parentTop && childBottom <= parentBottom) {
170
- missing--
171
- } else {
172
- // Not fully visible, so we will use this child to calculate the height of
173
- // each item. We will also use this to calculate how much of the item is
174
- // already visible.
175
- elementAmountVisible = Math.max(
176
- 0,
177
- Math.min(childBottom, parentBottom) - Math.max(childTop, parentTop)
178
- )
179
- elementHeight = child.clientHeight
180
- break
181
- }
182
- }
183
- }
184
-
185
- // There are fewer visible items than we want, so we will try to nudge the offset
186
- // to show more items.
187
- if (missing >= 1) {
188
- setInnerOffset((existingOffset) => {
189
- let newInnerOffset =
190
- elementHeight * missing - // `missing` amount of `elementHeight`
191
- elementAmountVisible + // The amount of the last item that is visible
192
- scrollPaddingBottom // The scroll padding to ensure the UI looks good
193
-
194
- // Nudged enough already, no need to continue
195
- if (existingOffset >= newInnerOffset) {
196
- return existingOffset
197
- }
198
-
199
- return newInnerOffset
200
- })
201
- }
202
- },
203
- })*/
204
- : null,
205
- // The `size` middleware will ensure the panel is never bigger than the viewport minus the
206
- // provided `padding` that we want.
207
- sizeMiddleware({
208
- padding,
209
- apply({ availableWidth, availableHeight, elements }) {
210
- Object.assign(elements.floating.style, {
211
- overflow: "auto",
212
- maxWidth: `${availableWidth}px`,
213
- maxHeight: `min(var(--anchor-max-height, 100vh), ${availableHeight}px)`,
214
- });
215
- },
216
- }),
217
- ].filter(Boolean),
218
- }).then((res) => {
219
- if (currentComputeId === computeId) {
220
- // Ensure only the last compute updates the context if multiple are running in parallel
221
- context = res;
222
- const { x, y } = res;
223
- floatingStyles = `position: absolute; left: ${x}px; top: ${y}px;`;
224
- }
82
+ untrack(() => {
83
+ let observer = new MutationObserver(() => {
84
+ let maxHeight = window.getComputedStyle(element).maxHeight;
85
+ let maxHeightFloat = parseFloat(maxHeight);
86
+ if (isNaN(maxHeightFloat))
87
+ return;
88
+ let maxHeightInt = parseInt(maxHeight);
89
+ if (isNaN(maxHeightInt))
90
+ return;
91
+ if (maxHeightFloat !== maxHeightInt) {
92
+ element.style.maxHeight = `${Math.ceil(maxHeightFloat)}px`;
93
+ }
94
+ });
95
+ observer.observe(element, {
96
+ attributes: true,
97
+ attributeFilter: ["style"],
98
+ });
99
+ return () => {
100
+ observer.disconnect();
101
+ };
225
102
  });
226
103
  });
227
- // Calculate placement information to expose as data attributes
228
- let [exposedTo = to, exposedAlign = align] = context?.placement.split("-") ?? [];
229
- // If user-land code is using custom styles specifically for `bottom`, but
230
- // they chose `selection`, then we want to make sure to map it to selection
231
- // again otherwise styles could be wrong.
232
- if (to === "selection")
233
- exposedTo = "selection";
234
- const data = $derived({
235
- anchor: [exposedTo, exposedAlign].filter(Boolean).join(" "),
236
- });
237
- /*let innerOffsetConfig = useInnerOffset(context, {
238
- overflowRef,
239
- onChange: setInnerOffset,
240
- })*/
241
- const getReferenceProps = () => ({});
242
- const getFloatingProps = () => ({});
243
- /*let { getReferenceProps, getFloatingProps } = useInteractions([
244
- innerOffsetConfig
245
- ])*/
246
- const floatingContext = {
247
- setFloating: (floating) => {
248
- floatingEl = floating || null;
249
- },
250
- setReference: (reference) => {
251
- referenceEl = reference || null;
252
- },
253
- get styles() {
254
- return floatingStyles;
255
- },
256
- getReferenceProps,
257
- getFloatingProps,
258
- get slot() {
259
- return data;
260
- },
261
- };
262
- setContext("FloatingContext", floatingContext);
263
- setContext("PlacementContext", (value) => {
264
- config = value;
265
- });
266
- return floatingContext;
267
- };
268
- function useFixScrollingPixel(element) {
269
- if (!element)
270
- return;
271
- let observer = new MutationObserver(() => {
272
- let maxHeight = window.getComputedStyle(element).maxHeight;
273
- let maxHeightFloat = parseFloat(maxHeight);
274
- if (isNaN(maxHeightFloat))
275
- return;
276
- let maxHeightInt = parseInt(maxHeight);
277
- if (isNaN(maxHeightInt))
278
- return;
279
- if (maxHeightFloat !== maxHeightInt) {
280
- element.style.maxHeight = `${Math.ceil(maxHeightFloat)}px`;
281
- }
282
- });
283
- observer.observe(element, {
284
- attributes: true,
285
- attributeFilter: ["style"],
286
- });
287
- return () => {
288
- observer.disconnect();
289
- };
290
104
  }
291
- function useResolvedConfig({ config, element, }) {
105
+ export function useResolvedConfig(options) {
106
+ const { config, element } = $derived(options);
292
107
  const gap = useResolvePxValue({
293
108
  get input() {
294
109
  return config?.gap ?? "var(--anchor-gap, 0)";
@@ -299,7 +114,7 @@ function useResolvedConfig({ config, element, }) {
299
114
  });
300
115
  const offset = useResolvePxValue({
301
116
  get input() {
302
- return config?.gap ?? "var(--anchor-offset, 0)";
117
+ return config?.offset ?? "var(--anchor-offset, 0)";
303
118
  },
304
119
  get element() {
305
120
  return element;
@@ -307,7 +122,7 @@ function useResolvedConfig({ config, element, }) {
307
122
  });
308
123
  const padding = useResolvePxValue({
309
124
  get input() {
310
- return config?.gap ?? "var(--anchor-padding, 0)";
125
+ return config?.padding ?? "var(--anchor-padding, 0)";
311
126
  },
312
127
  get element() {
313
128
  return element;
@@ -331,7 +146,8 @@ function useResolvedConfig({ config, element, }) {
331
146
  },
332
147
  };
333
148
  }
334
- function useResolvePxValue({ input, element, defaultValue, }) {
149
+ function useResolvePxValue(options) {
150
+ const { input, element, defaultValue } = $derived(options);
335
151
  let d = useDisposables();
336
152
  const computeValue = (value, element) => {
337
153
  // Nullish
@@ -415,14 +231,16 @@ function useResolvePxValue({ input, element, defaultValue, }) {
415
231
  };
416
232
  // Calculate the value immediately when the input or element changes. Later we can setup a watcher
417
233
  // to track the value changes over time.
418
- const immediateValue = computeValue(input, element)[0];
419
- let value = $state(immediateValue);
234
+ const immediateValue = $derived(computeValue(input, element)[0]);
235
+ let explicitValue = $state();
236
+ const setValue = (value) => (explicitValue = value);
237
+ const value = explicitValue ?? immediateValue;
420
238
  $effect(() => {
421
- let [newValue, watcher] = computeValue(input, element);
422
- value = newValue;
239
+ const [value, watcher] = computeValue(input, element);
240
+ setValue(value);
423
241
  if (!watcher)
424
242
  return;
425
- return watcher((_value) => (value = _value));
243
+ return watcher(setValue);
426
244
  });
427
245
  return {
428
246
  get value() {
@@ -0,0 +1,91 @@
1
+ import { type DetectOverflowOptions, type Middleware, type SideObject, type Derivable } from "@floating-ui/dom";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import type { MutableRefObject } from "../utils/ref.svelte.js";
4
+ export declare function warn(...messages: string[]): void;
5
+ export declare function error(...messages: string[]): void;
6
+ export interface ElementProps {
7
+ reference?: HTMLAttributes<Element>;
8
+ floating?: HTMLAttributes<HTMLElement>;
9
+ item?: HTMLAttributes<HTMLElement> | ((props: Record<string, any>) => HTMLAttributes<HTMLElement>);
10
+ }
11
+ export declare function getUserAgent(): string;
12
+ export interface InnerProps extends DetectOverflowOptions {
13
+ /**
14
+ * A ref which contains an array of HTML elements.
15
+ * @default empty list
16
+ */
17
+ listRef: MutableRefObject<Array<HTMLElement | null>>;
18
+ /**
19
+ * The index of the active (focused or highlighted) item in the list.
20
+ * @default 0
21
+ */
22
+ index: number;
23
+ /**
24
+ * Callback invoked when the fallback state changes.
25
+ */
26
+ onFallbackChange?: null | ((fallback: boolean) => void);
27
+ /**
28
+ * The offset to apply to the floating element.
29
+ * @default 0
30
+ */
31
+ offset?: number;
32
+ /**
33
+ * A ref which contains the overflow of the floating element.
34
+ */
35
+ overflowRef?: MutableRefObject<SideObject | null>;
36
+ /**
37
+ * An optional ref containing an HTMLElement. This may be used as the
38
+ * scrolling container instead of the floating element — for instance,
39
+ * to position inner elements as direct children without being interfered by
40
+ * scrolling layout.
41
+ */
42
+ scrollRef?: MutableRefObject<HTMLElement | null>;
43
+ /**
44
+ * The minimum number of items that should be visible in the list.
45
+ * @default 4
46
+ */
47
+ minItemsVisible?: number;
48
+ /**
49
+ * The threshold for the reference element's overflow in pixels.
50
+ * @default 0
51
+ */
52
+ referenceOverflowThreshold?: number;
53
+ }
54
+ /**
55
+ * Positions the floating element such that an inner element inside of it is
56
+ * anchored to the reference element.
57
+ * @see https://floating-ui.com/docs/inner
58
+ */
59
+ export declare const inner: (props: InnerProps | Derivable<InnerProps>) => Middleware;
60
+ export interface UseInnerOffsetProps {
61
+ /**
62
+ * Whether the Hook is enabled, including all internal Effects and event
63
+ * handlers.
64
+ * @default true
65
+ */
66
+ enabled?: boolean;
67
+ /**
68
+ * A ref which contains the overflow of the floating element.
69
+ */
70
+ overflowRef: MutableRefObject<SideObject | null>;
71
+ /**
72
+ * An optional ref containing an HTMLElement. This may be used as the
73
+ * scrolling container instead of the floating element — for instance,
74
+ * to position inner elements as direct children without being interfered by
75
+ * scrolling layout.
76
+ */
77
+ scrollRef?: MutableRefObject<HTMLElement | null>;
78
+ /**
79
+ * Callback invoked when the offset changes.
80
+ */
81
+ onChange: (offset: number | ((offset: number) => number)) => void;
82
+ }
83
+ /**
84
+ * Changes the `inner` middleware's `offset` upon a `wheel` event to
85
+ * expand the floating element's height, revealing more list items.
86
+ * @see https://floating-ui.com/docs/inner
87
+ */
88
+ export declare function useInnerOffset(options: {
89
+ context: FloatingRootContext;
90
+ props: UseInnerOffsetProps;
91
+ }): ElementProps;