@sheetxl/utils-react 0.7.26 → 0.7.28-beta.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 (154) hide show
  1. package/browser/cjs/C7jPCqFJNiWyD2pr.cjs +1 -0
  2. package/browser/cjs/CyWMySHsu-RvsIGs.cjs +1 -0
  3. package/browser/cjs/DZSvmqU8nRas1uz6.cjs +1 -0
  4. package/browser/cjs/index.cjs +5 -7
  5. package/browser/esm/CD4Q4NRTfHSJirLz.mjs +139 -0
  6. package/browser/esm/DAwEWkKjQCR-nguL.mjs +2171 -0
  7. package/browser/esm/DUF3Ugd4Z1SDNXPb.mjs +390 -0
  8. package/browser/esm/index.mjs +6128 -1806
  9. package/licenses/dependencies.txt +246 -39
  10. package/node/esm/DA8vLJ8AED3TYoSo.mjs +2171 -0
  11. package/node/esm/DKS7p6NraAuZKdCC.mjs +139 -0
  12. package/node/esm/index.mjs +5141 -1774
  13. package/package.json +8 -5
  14. package/types/index.d.ts +2 -2043
  15. package/types/src/animation/AnimationModeContext.d.ts +10 -0
  16. package/types/src/animation/index.d.ts +3 -0
  17. package/types/src/animation/useAnimatedMeasure.d.ts +39 -0
  18. package/types/src/command/ActivationTracker.d.ts +53 -0
  19. package/types/src/command/CommandAnchorProvider.d.ts +64 -0
  20. package/types/src/command/CommandButtonEntryLabel.d.ts +25 -0
  21. package/types/src/command/CommandButtonRegistry.d.ts +159 -0
  22. package/types/src/command/CommandButtonRegistryContext.d.ts +35 -0
  23. package/types/src/command/CommandCatalog.d.ts +155 -0
  24. package/types/src/command/CommandCatalogResource.d.ts +7 -0
  25. package/types/src/command/CommandCatalogService.d.ts +61 -0
  26. package/types/src/command/CommandChainContext.d.ts +32 -0
  27. package/types/src/command/CommandFallbackContext.d.ts +30 -0
  28. package/types/src/command/CommandFocusContext.d.ts +21 -0
  29. package/types/src/command/CommandRegistry.d.ts +164 -0
  30. package/types/src/command/CommandRegistryContext.d.ts +16 -0
  31. package/types/src/command/CommandResolver.d.ts +162 -0
  32. package/types/src/command/CommandScope.d.ts +343 -0
  33. package/types/src/command/CommandScopeContext.d.ts +205 -0
  34. package/types/src/command/FocusActivation.d.ts +140 -0
  35. package/types/src/command/ICommand.d.ts +31 -0
  36. package/types/src/command/ICommandDefinition.d.ts +82 -0
  37. package/types/src/command/KeyBindingDispatcher.d.ts +150 -0
  38. package/types/src/command/LayerActivation.d.ts +45 -0
  39. package/types/src/command/Types.d.ts +80 -0
  40. package/types/src/command/createResolvedCommand.d.ts +91 -0
  41. package/types/src/command/index.d.ts +26 -0
  42. package/types/src/command/reduceDefinitions.d.ts +33 -0
  43. package/types/src/command/useCommands.d.ts +22 -0
  44. package/types/src/command/useContributeCommands.d.ts +18 -0
  45. package/types/src/components/FocusKeyNavigation.d.ts +22 -0
  46. package/types/src/components/ITooltip.d.ts +38 -0
  47. package/types/src/components/RoundedTab.d.ts +26 -0
  48. package/types/src/components/index.d.ts +4 -0
  49. package/types/src/error/ErrorPanel.d.ts +14 -0
  50. package/types/src/error/ReactErrorBoundary.d.ts +7 -0
  51. package/types/src/error/UncaughtErrorBoundary.d.ts +5 -0
  52. package/types/src/error/index.d.ts +4 -0
  53. package/types/src/float/FloatPanel.d.ts +57 -0
  54. package/types/src/float/FloatPopper.d.ts +85 -0
  55. package/types/src/float/FloatPopup.d.ts +19 -0
  56. package/types/src/float/FloatProvider.d.ts +60 -0
  57. package/types/src/float/FloatStackContext.d.ts +25 -0
  58. package/types/src/float/FloatTooltip.d.ts +22 -0
  59. package/types/src/float/FloatUtils.d.ts +55 -0
  60. package/types/src/float/_FloatUtils.d.ts +51 -0
  61. package/types/src/float/index.d.ts +9 -0
  62. package/types/src/float/useFloatStack.d.ts +92 -0
  63. package/types/src/hooks/LanguageState.d.ts +15 -0
  64. package/types/src/hooks/index.d.ts +19 -0
  65. package/types/src/hooks/useBoundSyncExternalStore.d.ts +23 -0
  66. package/types/src/hooks/useCallbackRef.d.ts +11 -0
  67. package/types/src/hooks/useDevicePixelRatio.d.ts +37 -0
  68. package/types/src/hooks/useEditMode.d.ts +66 -0
  69. package/types/src/hooks/useGlobalClipboard.d.ts +7 -0
  70. package/types/src/hooks/useId.d.ts +9 -0
  71. package/types/src/hooks/useImperativeElement.d.ts +3 -0
  72. package/types/src/hooks/useLanguage.d.ts +13 -0
  73. package/types/src/hooks/useMouseDownAndHoldListener.d.ts +13 -0
  74. package/types/src/hooks/useNotifier.d.ts +330 -0
  75. package/types/src/hooks/useOnClickOrFocusAway.d.ts +8 -0
  76. package/types/src/hooks/useOptionalBoundSyncExternalStore.d.ts +20 -0
  77. package/types/src/hooks/useOptionalSyncExternalStore.d.ts +18 -0
  78. package/types/src/hooks/useSynchronizedPointerHandler.d.ts +54 -0
  79. package/types/src/hooks/useTextareaCaretRect.d.ts +85 -0
  80. package/types/src/hooks/useTraceUpdate.d.ts +2 -0
  81. package/types/src/hooks/useTranslator.d.ts +32 -0
  82. package/types/src/icons/DynamicIcon.d.ts +17 -0
  83. package/types/src/icons/DynamicIconService.d.ts +39 -0
  84. package/types/src/icons/ErrorIcon.d.ts +6 -0
  85. package/types/src/icons/Types.d.ts +81 -0
  86. package/types/src/icons/WalkingIcon.d.ts +27 -0
  87. package/types/src/icons/_Utils.d.ts +3 -0
  88. package/types/src/icons/index.d.ts +5 -0
  89. package/types/src/icons/packs/Base.d.ts +4 -0
  90. package/types/src/icons/packs/Conditional.d.ts +4 -0
  91. package/types/src/index.d.ts +18 -0
  92. package/types/src/loading/LoadingPanel.d.ts +31 -0
  93. package/types/src/loading/index.d.ts +2 -0
  94. package/types/src/persistence/InMemoryStore.d.ts +12 -0
  95. package/types/src/persistence/LocalStorageStore.d.ts +15 -0
  96. package/types/src/persistence/PersistenceStateProvider.d.ts +3 -0
  97. package/types/src/persistence/Types.d.ts +95 -0
  98. package/types/src/persistence/_Context.d.ts +9 -0
  99. package/types/src/persistence/index.d.ts +6 -0
  100. package/types/src/persistence/usePersistenceState.d.ts +33 -0
  101. package/types/src/react-resizable/Resizable.d.ts +30 -0
  102. package/types/src/react-resizable/ResizableBox.d.ts +18 -0
  103. package/types/src/react-resizable/index.d.ts +11 -0
  104. package/types/src/react-resizable/propTypes.d.ts +56 -0
  105. package/types/src/react-resizable/utils.d.ts +3 -0
  106. package/types/src/scroll/AxisViewport.d.ts +73 -0
  107. package/types/src/scroll/IScrollPane.d.ts +63 -0
  108. package/types/src/scroll/IScrollbar.d.ts +94 -0
  109. package/types/src/scroll/NativeScrollbar.d.ts +7 -0
  110. package/types/src/scroll/ScrollButton.d.ts +29 -0
  111. package/types/src/scroll/ScrollPane.d.ts +4 -0
  112. package/types/src/scroll/Scrollbar.d.ts +4 -0
  113. package/types/src/scroll/TouchThumbContext.d.ts +93 -0
  114. package/types/src/scroll/TouchThumbHandle.d.ts +64 -0
  115. package/types/src/scroll/TrackDrag.d.ts +107 -0
  116. package/types/src/scroll/Utils.d.ts +8 -0
  117. package/types/src/scroll/Viewport.d.ts +285 -0
  118. package/types/src/scroll/VirtualScrollbar.d.ts +49 -0
  119. package/types/src/scroll/index.d.ts +14 -0
  120. package/types/src/scroll/scrollbarTheming.d.ts +27 -0
  121. package/types/src/scroll/useWheelScroll.d.ts +27 -0
  122. package/types/src/scroller/Scroller.d.ts +260 -0
  123. package/types/src/scroller/animate.d.ts +30 -0
  124. package/types/src/scroller/index.d.ts +2 -0
  125. package/types/src/singletonHook/components/SingleItemContainer.d.ts +6 -0
  126. package/types/src/singletonHook/components/SingletonHooksContainer.d.ts +7 -0
  127. package/types/src/singletonHook/index.d.ts +11 -0
  128. package/types/src/singletonHook/singletonHook.d.ts +6 -0
  129. package/types/src/singletonHook/utils/env.d.ts +4 -0
  130. package/types/src/singletonHook/utils/env.native.d.ts +1 -0
  131. package/types/src/singletonHook/utils/warning.d.ts +2 -0
  132. package/types/src/splitPane/SplitPane.d.ts +91 -0
  133. package/types/src/splitPane/SplitPaneResizer.d.ts +11 -0
  134. package/types/src/splitPane/index.d.ts +3 -0
  135. package/types/src/theme/TokenTheme.d.ts +196 -0
  136. package/types/src/theme/TokenThemeProvider.d.ts +97 -0
  137. package/types/src/theme/buildThemeCSS.d.ts +54 -0
  138. package/types/src/theme/createThemeVars.d.ts +15 -0
  139. package/types/src/theme/defaultTheme.d.ts +15 -0
  140. package/types/src/theme/index.d.ts +9 -0
  141. package/types/src/theme/resolveTokens.d.ts +21 -0
  142. package/types/src/theme/themeAttrs.d.ts +32 -0
  143. package/types/src/theme/useResolvedThemeMode.d.ts +17 -0
  144. package/types/src/types/Types.d.ts +71 -0
  145. package/types/src/types/index.d.ts +2 -0
  146. package/types/src/utils/FullScreenPortal.d.ts +6 -0
  147. package/types/src/utils/PinchZoom.d.ts +3 -0
  148. package/types/src/utils/ReactUtils.d.ts +134 -0
  149. package/types/src/utils/index.d.ts +4 -0
  150. package/types/src/utils/useFullScreen.d.ts +47 -0
  151. package/browser/cjs/CPBtiUesoF7a_blY.cjs +0 -6
  152. package/browser/esm/B3-sQiNCaM33P0MK.mjs +0 -12
  153. package/node/assets/style.css +0 -1
  154. package/node/esm/C-L_tZzbahpe6TAI.mjs +0 -12
@@ -0,0 +1,30 @@
1
+ import { ResizeHandleAxis, DefaultProps, Props, DragCallbackData } from './propTypes';
2
+ import * as React from 'react';
3
+ export default class Resizable extends React.Component<Props, {}> {
4
+ static propTypes: {
5
+ [key: string]: any;
6
+ };
7
+ static defaultProps: DefaultProps;
8
+ handleRefs: {
9
+ [key in ResizeHandleAxis]?: React.RefObject<HTMLElement | null>;
10
+ };
11
+ lastHandleRect: DOMRect | null;
12
+ slack: [number, number] | null;
13
+ lastSize: {
14
+ width: number;
15
+ height: number;
16
+ } | null;
17
+ componentWillUnmount(): void;
18
+ resetData(): void;
19
+ runConstraints(width: number, height: number): [number, number];
20
+ /**
21
+ * Wrapper around drag events to provide more useful data.
22
+ *
23
+ * @param {String} handlerName Handler name to wrap.
24
+ * @return {Function} Handler function.
25
+ */
26
+ resizeHandler(handlerName: 'onResize' | 'onResizeStart' | 'onResizeStop', axis: ResizeHandleAxis): (e: React.SyntheticEvent, data: DragCallbackData) => void;
27
+ renderResizeHandle(handleAxis: ResizeHandleAxis, ref: React.RefObject<HTMLElement | null>): React.ReactNode;
28
+ render(): React.ReactNode;
29
+ }
30
+ //# sourceMappingURL=Resizable.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { Props as ResizableProps, ResizeCallbackData, ResizableBoxState } from './propTypes';
2
+ import * as React from 'react';
3
+ type ResizableBoxProps = Omit<ResizableProps, 'children'> & {
4
+ style?: React.CSSProperties;
5
+ children?: React.ReactElement<any>;
6
+ className?: string | null;
7
+ };
8
+ export default class ResizableBox extends React.Component<ResizableBoxProps, ResizableBoxState> {
9
+ static propTypes: {
10
+ children: any;
11
+ };
12
+ state: ResizableBoxState;
13
+ static getDerivedStateFromProps(props: ResizableBoxProps, state: ResizableBoxState): ResizableBoxState | null;
14
+ onResize: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
15
+ render(): React.ReactNode;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=ResizableBox.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Vendored from `react-resizable` (https://github.com/react-grid-layout/react-resizable).
3
+ * MIT License — Copyright (c) 2016-2018 Samuel Reed.
4
+ *
5
+ * Inlined as TypeScript source so it bundles as ESM (the published package is CJS-only,
6
+ * which the rolldown/vite bundler cannot link to bundled ESM React). No logic changes.
7
+ */
8
+ export { default as Resizable } from './Resizable';
9
+ export { default as ResizableBox } from './ResizableBox';
10
+ export type { Axis, DefaultProps, DragCallbackData, Props, ReactRef, ResizableBoxState, ResizableState, ResizeCallbackData, ResizeHandleAxis, } from './propTypes';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { DraggableCore } from 'react-draggable';
2
+ import type * as React from 'react';
3
+ export type ReactRef<T extends HTMLElement> = {
4
+ current: T | null;
5
+ };
6
+ export type Axis = 'both' | 'x' | 'y' | 'none';
7
+ export type ResizeHandleAxis = 's' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne';
8
+ export type ResizableState = {};
9
+ export type ResizableBoxState = {
10
+ width: number;
11
+ height: number;
12
+ propsWidth: number;
13
+ propsHeight: number;
14
+ };
15
+ export type DragCallbackData = {
16
+ node: HTMLElement;
17
+ x: number;
18
+ y: number;
19
+ deltaX: number;
20
+ deltaY: number;
21
+ lastX: number;
22
+ lastY: number;
23
+ };
24
+ export type ResizeCallbackData = {
25
+ node: HTMLElement;
26
+ size: {
27
+ width: number;
28
+ height: number;
29
+ };
30
+ handle: ResizeHandleAxis;
31
+ };
32
+ export type DefaultProps = {
33
+ axis: Axis;
34
+ handleSize: [number, number];
35
+ lockAspectRatio: boolean;
36
+ minConstraints: [number, number];
37
+ maxConstraints: [number, number];
38
+ resizeHandles: ResizeHandleAxis[];
39
+ transformScale: number;
40
+ };
41
+ export type ResizeHandleFn = (resizeHandleAxis: ResizeHandleAxis, ref: React.RefObject<HTMLElement>) => React.ReactElement<any>;
42
+ export type Props = Partial<DefaultProps> & {
43
+ children: React.ReactElement<any>;
44
+ className?: string | null;
45
+ draggableOpts?: Partial<React.ComponentProps<typeof DraggableCore>> | null;
46
+ height: number;
47
+ handle?: React.ReactElement<any> | ResizeHandleFn;
48
+ onResizeStop?: ((e: React.SyntheticEvent, data: ResizeCallbackData) => any) | null;
49
+ onResizeStart?: ((e: React.SyntheticEvent, data: ResizeCallbackData) => any) | null;
50
+ onResize?: ((e: React.SyntheticEvent, data: ResizeCallbackData) => any) | null;
51
+ width: number;
52
+ };
53
+ export declare const resizableProps: {
54
+ [key: string]: any;
55
+ };
56
+ //# sourceMappingURL=propTypes.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare function cloneElement(element: React.ReactElement<any>, props: Record<string, any>): React.ReactElement<any>;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,73 @@
1
+ import { TopLeft, Size } from '@sheetxl/utils';
2
+ import { IViewport, Viewport, ViewportMetrics, ClampBounds } from './Viewport';
3
+ /**
4
+ * Per-axis routing over (up to) two {@link Viewport}s so one viewport can bind its horizontal and
5
+ * vertical axes to different controllers. Implements {@link IViewport}, so it is interchangeable with a
6
+ * plain {@link Viewport} anywhere a viewport is accepted (a grid, a ScrollPane).
7
+ *
8
+ * @remarks
9
+ * This is what lets grids share scroll WITHOUT sharing both axes:
10
+ * - A sheet **header** follows the main grid's vertical scroll (read-only) while owning its trivial
11
+ * horizontal — `_v` is the shared viewport (followed), `_h` is the header's own.
12
+ * - **Split** peers share one vertical viewport (a single rAF ticker ⇒ eased/momentum scroll stays
13
+ * frame-locked) while scrolling horizontally independently — `_v` shared, `_h` each their own.
14
+ *
15
+ * Horizontal reads/writes route to `_h`, vertical to `_v`. When both axes resolve to the SAME viewport
16
+ * (the common case: a standalone grid, or a main grid owning both) it collapses to 1:1 delegation. A
17
+ * FOLLOWED axis is read-only: no `setTarget`/`setBounds` — its owner drives it.
18
+ */
19
+ export declare class AxisViewport implements IViewport {
20
+ private readonly _h;
21
+ private readonly _v;
22
+ private readonly _followH;
23
+ private readonly _followV;
24
+ private readonly _zoomCtrl;
25
+ private _combined;
26
+ private _hSnap;
27
+ private _vSnap;
28
+ private _vp;
29
+ private _vpH;
30
+ private _vpV;
31
+ constructor(_h: Viewport, _v: Viewport, _followH: boolean, _followV: boolean, _zoomCtrl: Viewport);
32
+ /** Both axes on one viewport — the transparent 1:1 case. */
33
+ private get _same();
34
+ /** @inheritdoc ViewportStore.getSnapshot */
35
+ getSnapshot(): TopLeft;
36
+ /** @inheritdoc ViewportStore.getScroll */
37
+ getScroll(): TopLeft;
38
+ /** @inheritdoc ViewportStore.getTarget */
39
+ getTarget(): TopLeft;
40
+ /** @inheritdoc ViewportStore.isSettled */
41
+ isSettled(): boolean;
42
+ /** @inheritdoc ViewportStore.getZoom */
43
+ getZoom(): number;
44
+ /** @inheritdoc ViewportStore.getClient */
45
+ getClient(): Size;
46
+ /**
47
+ * @inheritdoc ViewportStore.isReady
48
+ * Ready when each source controller is ready on the axis it contributes (width from `_h`, height from
49
+ * `_v`) — so an own/throwaway controller with only one meaningful axis doesn't block on the other.
50
+ */
51
+ isReady(): boolean;
52
+ /** @inheritdoc ViewportStore.getMetrics */
53
+ getMetrics(): ViewportMetrics;
54
+ subscribe(listener: () => void): () => void;
55
+ /** @inheritdoc IViewport.setBounds */
56
+ setBounds(bounds: ClampBounds): void;
57
+ /** @inheritdoc IViewport.setSizes */
58
+ setSizes(width: number, height: number, totalWidth: number, totalHeight: number): void;
59
+ /** @inheritdoc IViewport.setTarget */
60
+ setTarget(left: number, top: number, animate?: boolean): boolean;
61
+ /** @inheritdoc IViewport.setZoom */
62
+ setZoom(zoom: number): void;
63
+ /**
64
+ * @inheritdoc IViewport.observe
65
+ * Route the observed element to each OWNED axis only. A followed axis is driven by its owner (the main
66
+ * grid's ScrollPane observes the shared controller), so we never observe it here — otherwise a header
67
+ * (or a split peer) would clobber the shared controller's cross axis with its own element size.
68
+ */
69
+ observe(el: Element | null): () => void;
70
+ /** @inheritdoc IViewport.setContent */
71
+ setContent(totalWidth: number, totalHeight: number, minLeft?: number, minTop?: number): void;
72
+ }
73
+ //# sourceMappingURL=AxisViewport.d.ts.map
@@ -0,0 +1,63 @@
1
+ import { Size } from '@sheetxl/utils';
2
+ import { IViewport } from './Viewport';
3
+ import { ScrollbarProps } from './IScrollbar';
4
+ /**
5
+ * Props for the scroll corner.
6
+ *
7
+ * @remarks
8
+ * This is the square area between the horizontal and vertical scrollbars.
9
+ * It will only be rendered if both scrollbars are visible.
10
+ */
11
+ export interface ScrollCornerProps extends React.HTMLAttributes<HTMLElement> {
12
+ /**
13
+ * The size of the scroll corner.
14
+ *
15
+ * @remarks
16
+ * Optional — the corner is a grid cell sized by the scrollbar gutters, so a renderer can simply fill
17
+ * its cell (`width/height: 100%`) rather than reading this.
18
+ */
19
+ size?: Size;
20
+ }
21
+ export interface IScrollPaneAttributes {
22
+ isScrollPane: () => true;
23
+ }
24
+ export interface IScrollPaneElement extends HTMLDivElement, IScrollPaneAttributes {
25
+ }
26
+ /**
27
+ * Properties for the ScrollPane
28
+ */
29
+ export interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivElement> {
30
+ /**
31
+ * The scroll viewport — an {@link IViewport} (a `Viewport`, or an `AxisViewport` for
32
+ * per-axis sharing). The ScrollPane **subscribes** to it for position + sizes and drives scroll into
33
+ * it (scrollbar/wheel/touch → `setTarget`).
34
+ */
35
+ viewport?: IViewport;
36
+ /**
37
+ * Disable mouse-wheel scrolling. Wheel (which drives the {@link ScrollPaneProps.viewport}) is on by
38
+ * default; set this to turn it off.
39
+ *
40
+ * @defaultValue false
41
+ */
42
+ disableMouseWheel?: boolean;
43
+ /**
44
+ * Wheel intercept. Return `false` to consume the event (skip scrolling) — e.g. ctrl/⌘+wheel zoom.
45
+ */
46
+ onWheelScroll?: (event: globalThis.WheelEvent) => boolean | void;
47
+ showHorizontalScrollbar?: boolean;
48
+ showVerticalScrollbar?: boolean;
49
+ renderScrollCorner?: (props: ScrollCornerProps) => React.ReactNode;
50
+ renderScrollbarHorizontal?: (props: ScrollbarProps) => React.ReactNode;
51
+ renderScrollbarVertical?: (props: ScrollbarProps) => React.ReactNode;
52
+ /**
53
+ * If touch is disabled.
54
+ *
55
+ * @defaultValue false unless no touch events are detected.
56
+ */
57
+ disableTouch?: boolean;
58
+ /**
59
+ * Reference to the scroll pane element
60
+ */
61
+ ref?: React.Ref<IScrollPaneElement>;
62
+ }
63
+ //# sourceMappingURL=IScrollPane.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { default as React } from 'react';
2
+ import { TouchThumbHandleProps } from './TouchThumbHandle';
3
+ import { ScrollButtonProps } from './ScrollButton';
4
+ import { TrackEdgeTick } from './TrackDrag';
5
+ export declare const ScrollbarOrientation: {
6
+ readonly Horizontal: "horizontal";
7
+ readonly Vertical: "vertical";
8
+ };
9
+ export type ScrollbarOrientation = typeof ScrollbarOrientation[keyof typeof ScrollbarOrientation];
10
+ /**
11
+ * The thumb-drag lifecycle event — fired by the desktop thumb and the touch grip alike.
12
+ *
13
+ * @remarks
14
+ * Carries the ELEMENT being dragged so drag UI needs no coordinate math or DOM spelunking: hand it to
15
+ * the float system as the anchor (a virtual reference + placement) and the tooltip infra does the
16
+ * rest — correct for the thumb and the grip, which live in different places.
17
+ */
18
+ export interface ThumbDragEvent {
19
+ /** `true` on grab, `false` on release. */
20
+ dragging: boolean;
21
+ /** The element being dragged — the scrollbar's thumb or the large touch grip. */
22
+ element: HTMLElement | null;
23
+ /** Which control is dragging. */
24
+ source: 'thumb' | 'touch';
25
+ }
26
+ export interface ScrollbarProps extends React.HTMLAttributes<HTMLElement> {
27
+ offset: number;
28
+ viewportSize: number;
29
+ totalSize: number;
30
+ orientation: ScrollbarOrientation;
31
+ onScrollOffset: (offset: number, viewportSize: number, totalSize: number) => void;
32
+ /**
33
+ * Add custom scrollButtons.
34
+ * This should only be set to true if you have used css styling to hide the default scrollButtons
35
+ * using:
36
+ ::-webkit-scrollbar-button: {
37
+ display: 'none'
38
+ }
39
+ *
40
+ * @defaultValue false
41
+ */
42
+ showCustomScrollButtons?: boolean;
43
+ /**
44
+ * The minimum size of the thumb in pixels.
45
+ *
46
+ * @defaultValue 24
47
+ */
48
+ minThumbSize?: number;
49
+ /**
50
+ * The maximum size of the thumb in pixels.
51
+ *
52
+ * @defaultValue undefined (no maximum size)
53
+ */
54
+ maxThumbSize?: number;
55
+ /**
56
+ * The amount to increment the scroll position when the scroll button is clicked.
57
+ * This can be a fixed number or a function that takes the current offset, viewport size,
58
+ * and total size and returns the increment amount.
59
+ */
60
+ scrollButtonIncrement?: number | ((offset: number, viewport: number, totalSize: number) => number);
61
+ scrollButtonInitialRepeatDelay?: number;
62
+ scrollButtonAdditionalRepeatDelay?: number;
63
+ renderScrollButtonStart?: (props: ScrollButtonProps) => React.ReactElement;
64
+ renderScrollButtonEnd?: (props: ScrollButtonProps) => React.ReactElement;
65
+ propsTouchThumb?: Partial<TouchThumbHandleProps>;
66
+ /**
67
+ * Called on a repeating tick while the thumb is dragged past a track end and held there. Advance the
68
+ * scroll one step and return whether more scroll remains (`false` stops the ticking).
69
+ *
70
+ * @remarks
71
+ * This is how an elastic/virtual wrapper (e.g. `VirtualScrollbar`) extends its region under a held
72
+ * thumb — the scrollbar itself has no elastic knowledge. Leave unset for a linear scrollbar: its
73
+ * thumb at the track end IS the real end, so there is nothing to extend.
74
+ */
75
+ onThumbEdgeHold?: (edge: -1 | 1, tick: TrackEdgeTick) => boolean;
76
+ /**
77
+ * Thumb-drag lifecycle — fired for both the desktop thumb and the touch grip (raw DOM events can't
78
+ * represent this faithfully: pointer capture retargets the release, and the engine filters
79
+ * non-primary/disabled presses). A virtual/elastic wrapper pins its region while a drag is in
80
+ * flight; a client anchors drag UI (tooltips) to {@link ThumbDragEvent.element}.
81
+ */
82
+ onThumbDrag?: (event: ThumbDragEvent) => void;
83
+ propsThumb?: React.HTMLAttributes<HTMLElement>;
84
+ /**
85
+ * Reference to the underling element
86
+ */
87
+ ref?: React.Ref<IScrollbarElement>;
88
+ }
89
+ export interface IScrollbarAttributes extends HTMLDivElement {
90
+ isScrollbar: () => true;
91
+ }
92
+ export interface IScrollbarElement extends IScrollbarAttributes, HTMLDivElement {
93
+ }
94
+ //# sourceMappingURL=IScrollbar.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { ScrollbarProps } from './IScrollbar';
3
+ /**
4
+ * Honors the scroll interface but uses native scrollbars.
5
+ */
6
+ export declare const NativeScrollbar: React.NamedExoticComponent<Omit<ScrollbarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ //# sourceMappingURL=NativeScrollbar.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ import { ScrollbarOrientation } from './IScrollbar';
3
+ export interface ScrollButtonProps extends React.HTMLAttributes<any> {
4
+ orientation?: ScrollbarOrientation;
5
+ isBefore?: boolean;
6
+ disabled?: boolean;
7
+ onMouseUp: (e: React.MouseEvent<any>) => void;
8
+ onMouseLeave: (e: React.MouseEvent<any>) => void;
9
+ onMouseDown: (e: React.MouseEvent<any>) => void;
10
+ onClick?: (e: React.MouseEvent<any>) => void;
11
+ ref?: React.Ref<any>;
12
+ }
13
+ /**
14
+ * Relies on external styling. Follows the styling of scrollbars pattern. @see https://css-tricks.com/custom-scrollbars-in-webkit/
15
+ * class of scrollbar-button, vertical or horizontal, end
16
+ */
17
+ export declare const defaultCreateScrollStartButton: (props: ScrollButtonProps) => React.ReactElement;
18
+ /**
19
+ * Relies on external styling. Follows the styling of scrollbars pattern.
20
+ *
21
+ * @see https://css-tricks.com/custom-scrollbars-in-webkit/
22
+ * class of scrollbar-button, vertical or horizontal, end
23
+ */
24
+ export declare const defaultCreateScrollEndButton: (props: ScrollButtonProps) => React.ReactElement;
25
+ /**
26
+ * TODO - implement styling support similar to other scroll buttons. Currently hardcoded
27
+ */
28
+ export declare const defaultCreateScrollEdgeButton: (props: ScrollButtonProps) => React.ReactElement;
29
+ //# sourceMappingURL=ScrollButton.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { IScrollPaneElement, ScrollPaneProps, ScrollCornerProps } from './IScrollPane';
2
+ export declare const ScrollPane: import('react').NamedExoticComponent<Omit<ScrollPaneProps, "ref"> & import('react').RefAttributes<IScrollPaneElement>>;
3
+ export declare const defaultRenderScrollCorner: (props: ScrollCornerProps) => import("react").JSX.Element;
4
+ //# sourceMappingURL=ScrollPane.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ScrollbarProps, IScrollbarElement } from './IScrollbar';
3
+ export declare const Scrollbar: React.NamedExoticComponent<Omit<ScrollbarProps, "ref"> & React.RefAttributes<IScrollbarElement>>;
4
+ //# sourceMappingURL=Scrollbar.d.ts.map
@@ -0,0 +1,93 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Geometry the {@link TouchThumbHandle} grips are drawn into. Published by the {@link ScrollPane}
4
+ * (the only component that knows the full viewport + both gutters) and consumed by the grips deep
5
+ * inside the scrollbar render chain.
6
+ *
7
+ * @remarks
8
+ * The grip's *position along its axis* still comes from its scrollbar's thumb (a virtual scrollbar
9
+ * maps scroll → thumb non-linearly, so only the scrollbar knows where the thumb sits). This frame
10
+ * supplies only the coordinate box: which element to draw into, the viewport size, the reserved
11
+ * corner, and the inset from the edge.
12
+ */
13
+ export interface TouchThumbFrame {
14
+ /**
15
+ * Positioned element the grips portal into — the grid viewport box (excludes the scrollbar
16
+ * gutters). Must be `position: relative` so the grips position in its content-relative coords.
17
+ */
18
+ portalTarget: HTMLElement | null;
19
+ /**
20
+ * Content-box width in px (the portal target's size). The vertical grip's cross edge sits at this
21
+ * minus {@link crossInset}, and it is the origin for {@link viewportWidth}.
22
+ */
23
+ width: number;
24
+ /**
25
+ * Content-box height in px (the portal target's size). The horizontal grip's cross edge sits at this
26
+ * minus {@link crossInset}, and it is the origin for {@link viewportHeight}.
27
+ */
28
+ height: number;
29
+ /**
30
+ * The scrollable viewport (cell-area) width in px — `<= ` {@link width}. The horizontal grip travels
31
+ * across this, offset from the left by `width - viewportWidth` (the row-header gutter), so it rides
32
+ * inside the visible cell area rather than the full grid box.
33
+ */
34
+ viewportWidth: number;
35
+ /**
36
+ * The scrollable viewport (cell-area) height in px — `<= ` {@link height}. The vertical grip travels
37
+ * across this, offset from the top by `height - viewportHeight` (the column-header gutter).
38
+ */
39
+ viewportHeight: number;
40
+ /**
41
+ * Reserve at the bottom for the vertical grip (px) so its lowest position clears the horizontal
42
+ * grip's virtual corner. `0` when there is no horizontal grip to avoid.
43
+ */
44
+ reserveVertical: number;
45
+ /**
46
+ * Reserve at the right for the horizontal grip (px) so its right-most position clears the vertical
47
+ * grip's virtual corner. `0` when there is no vertical grip to avoid.
48
+ */
49
+ reserveHorizontal: number;
50
+ /**
51
+ * Distance from the cross edge (right for vertical, bottom for horizontal) to the grip center (px).
52
+ */
53
+ crossInset: number;
54
+ }
55
+ /**
56
+ * Default grip size (thickness) in px. The long dimension is {@link TOUCH_THUMB_ASPECT} × this.
57
+ */
58
+ export declare const TOUCH_THUMB_SIZE = 22;
59
+ /** Long-axis multiplier for the grip (a slightly elongated pill). */
60
+ export declare const TOUCH_THUMB_ASPECT = 1.8;
61
+ /** Gap between a grip and the perpendicular grip's corner (used to size the corner reserve). */
62
+ export declare const TOUCH_THUMB_MARGIN = 8;
63
+ /** Gap between the grip's leading edge and the viewport start (top for vertical, left for horizontal). */
64
+ export declare const TOUCH_THUMB_MARGIN_START = 4;
65
+ /** Gap between the grip's outer edge and the viewport cross edge (right for vertical, bottom for horizontal). */
66
+ export declare const TOUCH_THUMB_MARGIN_CROSS = 8;
67
+ /**
68
+ * Gap between the grip's trailing edge and the corner reserve. Negative on purpose: the grip is a
69
+ * rounded pill, so letting it tuck slightly past the reserve brings the rounded corners visually
70
+ * closer to the corner without overlapping the perpendicular grip.
71
+ */
72
+ export declare const TOUCH_THUMB_MARGIN_END = -2;
73
+ /**
74
+ * Distance from the cross edge to the grip center. Half the grip thickness plus the cross margin keeps
75
+ * the grip's outer edge that margin inside the viewport edge.
76
+ */
77
+ export declare const touchThumbCrossInset: (size?: number) => number;
78
+ /**
79
+ * The corner reserve — how far short of the far edge a grip must stop so it clears the perpendicular
80
+ * grip. Sized so the grip's far extent leaves the other grip's near extent plus a margin.
81
+ */
82
+ export declare const touchThumbCornerReserve: (size?: number) => number;
83
+ export interface TouchThumbFrameProviderProps {
84
+ value: TouchThumbFrame | null;
85
+ children?: React.ReactNode;
86
+ }
87
+ export declare const TouchThumbFrameProvider: (props: TouchThumbFrameProviderProps) => React.ReactElement;
88
+ /**
89
+ * Read the {@link TouchThumbFrame} published by the enclosing {@link ScrollPane}. Returns `null`
90
+ * when the grip is rendered outside a ScrollPane (no frame to draw into).
91
+ */
92
+ export declare const useTouchThumbFrame: () => TouchThumbFrame | null;
93
+ //# sourceMappingURL=TouchThumbContext.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { default as React } from 'react';
2
+ import { ScrollbarOrientation, ThumbDragEvent } from './IScrollbar';
3
+ import { TrackEdgeTick } from './TrackDrag';
4
+ export interface TouchThumbHandleProps extends React.HTMLAttributes<HTMLElement> {
5
+ /**
6
+ * The orientation of the scrollbar.
7
+ */
8
+ orientation: ScrollbarOrientation;
9
+ size?: number;
10
+ borderColor?: string;
11
+ backgroundColor?: string;
12
+ borderWidth?: number;
13
+ fillColor?: string;
14
+ /**
15
+ * The thumb's position along its track as a fraction `[0, 1]`. Comes from the scrollbar's thumb — a
16
+ * virtual scrollbar maps scroll → thumb non-linearly (elastic), so only the scrollbar knows this.
17
+ * The grip is literally a touch-sized rendering of the thumb.
18
+ */
19
+ fraction?: number;
20
+ /**
21
+ * Called while dragging with the new position along the travel as a fraction `[0, 1]`. The scrollbar
22
+ * maps it back through its (possibly virtual) thumb space to a scroll offset.
23
+ */
24
+ onScrollToFraction?: (fraction: number) => void;
25
+ /**
26
+ * Called on a repeating tick while the grip is dragged past a travel end and held there — the same
27
+ * contract as `ScrollbarProps.onThumbEdgeHold` (a virtual scrollbar extends its elastic region,
28
+ * accelerating with hold time). Return `false` to stop the ticking (parked at the real end). Leave
29
+ * unset for a linear scrollbar: its end is the end.
30
+ */
31
+ onEdgeHold?: (edge: -1 | 1, tick: TrackEdgeTick) => boolean;
32
+ /**
33
+ * Drag lifecycle signal, carrying the grip ELEMENT (`source: 'touch'`) — same event shape as the
34
+ * desktop thumb's (`ScrollbarProps.onThumbDrag`). A virtual scrollbar pins its elastic region while
35
+ * dragging; a client anchors drag UI (e.g. a tooltip) to the element.
36
+ */
37
+ onDraggingChange?: (event: ThumbDragEvent) => void;
38
+ /**
39
+ * Indicate that a touch handling is being used
40
+ */
41
+ currentTouchAnchor?: string;
42
+ key?: string;
43
+ /**
44
+ * Ref for the TouchThumbHandle element
45
+ */
46
+ ref?: React.Ref<TouchThumbHandleElement>;
47
+ }
48
+ export interface TouchThumbHandleAttributes {
49
+ }
50
+ export interface TouchThumbHandleElement extends HTMLDivElement, TouchThumbHandleAttributes {
51
+ }
52
+ /**
53
+ * TouchThumbHandle component
54
+ *
55
+ * @remarks
56
+ * A large, touch-friendly proxy for a scrollbar thumb. It is a pure presentation of the thumb: it
57
+ * rides the thumb's fractional position and reports drag back as a fraction, so the (virtual)
58
+ * scrollbar owns all scroll math — including the elastic bounce, and (via {@link onEdgeHold}) the
59
+ * accelerating extend when the finger parks past a travel end. The {@link TouchThumbFrame} published
60
+ * by the enclosing `ScrollPane` tells it where to sit — inside the viewport, clear of the
61
+ * perpendicular grip's virtual corner.
62
+ */
63
+ export declare const TouchThumbHandle: React.NamedExoticComponent<Omit<TouchThumbHandleProps, "ref"> & React.RefAttributes<TouchThumbHandleElement>>;
64
+ //# sourceMappingURL=TouchThumbHandle.d.ts.map