@sheetxl/utils-react 0.8.0-beta.11 → 0.8.0-beta.13

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 (31) hide show
  1. package/browser/esm/{DmyXYEmBOLQfUC3S.mjs → C9cj9Q5Dz4HCqZD5.mjs} +2 -2
  2. package/browser/esm/{3j_xcvx6bFQsulwT.mjs → CBSoiJLg4s9wQNWS.mjs} +1 -1
  3. package/browser/esm/index.mjs +1057 -981
  4. package/browser/esm/qXzD8cuG5Vm6-bvO.mjs +100 -0
  5. package/node/esm/{B7T-c_PH7rtDuiLF.mjs → BMnj0YLpW6Ayd6Yv.mjs} +1 -1
  6. package/node/esm/CV1IAozST8HB0Ur0.mjs +100 -0
  7. package/node/esm/index.mjs +1484 -1406
  8. package/package.json +2 -2
  9. package/types/src/components/RenderSlot.d.ts +32 -0
  10. package/types/src/components/index.d.ts +1 -0
  11. package/types/src/float/FloatPanel.d.ts +7 -5
  12. package/types/src/float/FloatPopup.d.ts +1 -1
  13. package/types/src/float/FloatProvider.d.ts +3 -2
  14. package/types/src/float/FloatStackContext.d.ts +8 -0
  15. package/types/src/float/FloatUtils.d.ts +3 -2
  16. package/types/src/float/_FloatUtils.d.ts +6 -0
  17. package/types/src/float/useFloatStack.d.ts +6 -5
  18. package/types/src/hooks/useNotifier.d.ts +10 -2
  19. package/types/src/icons/packs/Base.json.d.ts +63 -0
  20. package/types/src/index.d.ts +1 -0
  21. package/types/src/lazy/lazyComponent.d.ts +9 -2
  22. package/types/src/render/PendingRender.d.ts +43 -0
  23. package/types/src/render/index.d.ts +2 -0
  24. package/types/src/scroll/IScrollPane.d.ts +7 -3
  25. package/types/src/scroll/IScrollbar.d.ts +5 -2
  26. package/types/src/scroll/ScrollButton.d.ts +3 -3
  27. package/types/src/scroll/VirtualScrollbar.d.ts +2 -1
  28. package/types/src/splitPane/SplitPane.d.ts +3 -1
  29. package/types/src/theme/zIndex.d.ts +2 -2
  30. package/browser/esm/IqQLdwJk1VA8hpDI.mjs +0 -100
  31. package/node/esm/DHJ2cDJlYQ1rBfYF.mjs +0 -100
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/utils-react",
3
3
  "description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
4
- "version": "0.8.0-beta.11",
4
+ "version": "0.8.0-beta.13",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@floating-ui/react-dom": "^2.1.9",
43
- "@sheetxl/utils": "^0.8.0-beta.11",
43
+ "@sheetxl/utils": "^0.8.0-beta.13",
44
44
  "clsx": "^2.1.1",
45
45
  "detect-it": "^4.0.1",
46
46
  "prop-types": "^15.8.1",
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * A render slot: given its props, returns what to draw. Hooks are allowed — a host mounts the slot through
4
+ * {@link RenderSlot}, so they belong to that component.
5
+ */
6
+ export type RenderSlotFn<P> = (props: P) => React.ReactNode;
7
+ export interface RenderSlotProps<P> {
8
+ /** The slot's renderer. `null` or `undefined` renders nothing. */
9
+ render: RenderSlotFn<P> | null | undefined;
10
+ /** Handed to `render`. */
11
+ props: P;
12
+ }
13
+ /**
14
+ * Mounts a render slot as its own component, so a renderer may call hooks however (and wherever) the host
15
+ * renders it — inside a `useMemo`, a conditional, or a portal built in an effect.
16
+ *
17
+ * @remarks
18
+ * Its type never changes, so an inline arrow passed as `render` does not remount it. A renderer's hooks
19
+ * therefore persist across renderers: swapping between two renderers that call different hooks breaks the
20
+ * hook order, the same as a component that changes the hooks it calls. Give the slot a `key` per renderer
21
+ * if a host must swap them.
22
+ *
23
+ * Draw functions on a hot path (`renderCell`) are called directly, not through a slot, and must not call
24
+ * hooks.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <RenderSlot render={renderCommentCard} props={{ sheet, coords, comment }} />
29
+ * ```
30
+ */
31
+ export declare const RenderSlot: <P>(slot: RenderSlotProps<P>) => React.ReactNode;
32
+ //# sourceMappingURL=RenderSlot.d.ts.map
@@ -1,3 +1,4 @@
1
1
  export * from './FocusKeyNavigation';
2
+ export * from './RenderSlot';
2
3
  export * from './RoundedTab';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { FloatPopperProps, FloatPopperPosition, FloatPopperAnchor } from './FloatPopper';
3
4
  import { FloatPopupPanelProps } from './FloatPopup';
4
5
  import { FloatReference } from './useFloatStack';
@@ -12,7 +13,8 @@ export interface FloatPanelProps extends Omit<React.HTMLAttributes<HTMLDivElemen
12
13
  anchorPosition?: FloatPopperPosition;
13
14
  label?: string;
14
15
  children?: React.ReactNode;
15
- createPopupPanel?: (props: FloatPopupPanelProps) => React.ReactElement | null;
16
+ /** The float's content. `null` renders the card empty. */
17
+ renderPopupPanel?: RenderSlotFn<FloatPopupPanelProps> | null;
16
18
  propsPopper?: Partial<FloatPopperProps>;
17
19
  onClosing?: () => void;
18
20
  onClose?: () => void;
@@ -28,7 +30,7 @@ export interface FloatPanelSurfaceProps extends Omit<React.HTMLAttributes<HTMLDi
28
30
  floatReference?: FloatReference;
29
31
  /** The element the float is positioned in, handed on to the content. */
30
32
  popupContainer?: HTMLElement;
31
- createPopupPanel?: (props: FloatPopupPanelProps) => React.ReactElement | null;
33
+ renderPopupPanel?: RenderSlotFn<FloatPopupPanelProps> | null;
32
34
  children?: React.ReactNode;
33
35
  ref?: React.Ref<HTMLDivElement>;
34
36
  }
@@ -38,7 +40,7 @@ export interface FloatPanelSurfaceProps extends Omit<React.HTMLAttributes<HTMLDi
38
40
  * @remarks
39
41
  * Separate from the positioning so a float positioned by something other than {@link FloatPopper}
40
42
  * (a grid float that follows its cell) wears the same card. Other attributes are handed to
41
- * `createPopupPanel`, not set on the card.
43
+ * `renderPopupPanel`, not set on the card.
42
44
  */
43
45
  export declare const FloatPanelSurface: React.NamedExoticComponent<Omit<FloatPanelSurfaceProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
46
  /**
@@ -48,7 +50,7 @@ export declare const FloatPanelSurface: React.NamedExoticComponent<Omit<FloatPan
48
50
  * `FloatPanel` pairs a {@link FloatPopper} (which positions content next to an
49
51
  * anchor element or point, renders it in a portal, flips it to stay on screen
50
52
  * and animates it in) with a styled, scrollable "card" surface. The content of
51
- * that card is supplied by {@link FloatPanelProps.createPopupPanel}.
53
+ * that card is supplied by {@link FloatPanelProps.renderPopupPanel}.
52
54
  *
53
55
  * @remarks
54
56
  * Most consumers do not render `FloatPanel` directly — {@link useFloatStack}
@@ -68,7 +70,7 @@ export declare const FloatPanelSurface: React.NamedExoticComponent<Omit<FloatPan
68
70
  * <FloatPanel
69
71
  * open={open}
70
72
  * anchorEl={anchorRef.current}
71
- * createPopupPanel={() => <MyMenu />}
73
+ * renderPopupPanel={() => <MyMenu />}
72
74
  * />
73
75
  * ```
74
76
  */
@@ -15,5 +15,5 @@ export interface FloatPopupPanelProps extends React.HTMLAttributes<HTMLDivElemen
15
15
  /**
16
16
  * Default popup panel (a simple flex column container).
17
17
  */
18
- export declare const defaultCreateFloatPopupPanel: (props: FloatPopupPanelProps) => React.ReactElement;
18
+ export declare const defaultRenderFloatPopupPanel: (props: FloatPopupPanelProps) => React.ReactElement;
19
19
  //# sourceMappingURL=FloatPopup.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { ThemeMode } from '../theme';
3
4
  import { FloatReference, RenderFloatPanel } from './useFloatStack';
4
5
  import { FloatPanelProps } from './FloatPanel';
@@ -11,8 +12,8 @@ export interface FloatProviderProps {
11
12
  * inherited from an outer provider (and ultimately the neutral `FloatPanel`).
12
13
  */
13
14
  renderFloatPanel?: RenderFloatPanel;
14
- /** Default panel-content factory for descendants. Inherited when omitted. */
15
- createPopupPanel?: (props: FloatPopupPanelProps) => any;
15
+ /** The default float content for descendants. Inherited when omitted. */
16
+ renderPopupPanel?: RenderSlotFn<FloatPopupPanelProps>;
16
17
  /** Extra props merged into the rendered panel. Inherited when omitted. */
17
18
  propsFloatPanel?: Partial<FloatPanelProps>;
18
19
  /**
@@ -22,4 +22,12 @@ export declare const FloatStackProvider: import('react').Provider<FloatReference
22
22
  * submenu. Such components are not reached by props, only by context.
23
23
  */
24
24
  export declare const useFloat: () => FloatReference | null;
25
+ /**
26
+ * Whether a popup (a menu, a picker, a panel) is showing that this component is not inside (reactive).
27
+ *
28
+ * @remarks
29
+ * For transient UI that stands aside while the user is in a popup. Content of the popup itself reads
30
+ * `false`, so a tooltip belonging to the menu still shows. A float with no popup (a toolbar) does not count.
31
+ */
32
+ export declare const useFloatPopupOpen: () => boolean;
25
33
  //# sourceMappingURL=FloatStackContext.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { RenderSlotFn } from '../components';
1
2
  import { FloatPanelProps } from './FloatPanel';
2
3
  import { FloatPopupPanelProps } from './FloatPopup';
3
4
  import { RenderFloatPanel } from './useFloatStack';
@@ -28,8 +29,8 @@ export interface FloatThemeScope {
28
29
  */
29
30
  export interface FloatSurface {
30
31
  renderFloatPanel?: RenderFloatPanel;
31
- /** Default panel-content factory, used when a float doesn't supply its own. */
32
- createPopupPanel?: (props: FloatPopupPanelProps) => any;
32
+ /** The default float content, used when a float doesn't supply its own. */
33
+ renderPopupPanel?: RenderSlotFn<FloatPopupPanelProps>;
33
34
  propsFloatPanel?: Partial<FloatPanelProps>;
34
35
  /**
35
36
  * The theme floats in this subtree open with (scope class(es) + surface + mode). Carried onto the float
@@ -41,6 +41,12 @@ export interface FloatRoot extends FloatReference {
41
41
  getChildRef(reference: FloatReference): FloatReference | null;
42
42
  /** `reference` plus its full open-child chain. */
43
43
  descendants(reference: FloatReference | null): Set<FloatReference>;
44
+ /** Record `reference` as showing a popup; the result records that it stopped. */
45
+ addOpenPopup(reference: FloatReference): () => void;
46
+ /** Whether a popup is showing that `enclosing` is not inside (`null` is inside none). */
47
+ isPopupOpenOutside(enclosing: FloatReference | null): boolean;
48
+ /** Called as popups show and stop showing. */
49
+ subscribeOpenPopups(listener: () => void): () => void;
44
50
  }
45
51
  /**
46
52
  * Creates an isolated root float (a {@link FloatReference} that also holds the
@@ -1,11 +1,12 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { FloatPopupPanelProps } from './FloatPopup';
3
4
  import { FloatPanelProps } from './FloatPanel';
4
5
  import { FloatPopperProps } from './FloatPopper';
5
6
  /**
6
7
  * Renders the floating panel for an open float.
7
8
  */
8
- export type RenderFloatPanel = (props: FloatPanelProps) => React.ReactElement;
9
+ export type RenderFloatPanel = RenderSlotFn<FloatPanelProps>;
9
10
  export interface FloatStackOptions {
10
11
  /**
11
12
  * Whether the panel grabs focus when it opens. @defaultValue `true` (menus / dialogs / anything the
@@ -31,13 +32,13 @@ export interface FloatStackOptions {
31
32
  onOpen?: () => void;
32
33
  onClose?: () => void;
33
34
  /**
34
- * If this returns `null` then will create a registered movable stacking.
35
- * This is done for toolbars and other permanent visible components that are integrated into the movable stack.
35
+ * The float's content. `null` shows no popup but keeps the float in the stack — for toolbars and other
36
+ * always-visible components that take part in the movable stacking.
36
37
  */
37
- createPopupPanel?: (props: FloatPopupPanelProps) => any;
38
+ renderPopupPanel?: RenderSlotFn<FloatPopupPanelProps> | null;
38
39
  /**
39
40
  * Passed to the underlying popup panel. `children` is excluded — content comes
40
- * from `createPopupPanel`, and this keeps the option compatible with richer
41
+ * from `renderPopupPanel`, and this keeps the option compatible with richer
41
42
  * surface popper types (e.g. MUI's render-prop `children`).
42
43
  */
43
44
  propsPopper?: Partial<Omit<FloatPopperProps, 'children' | 'ref'>>;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { NotifierOptions, INotifier } from '@sheetxl/utils';
3
4
  /**
4
5
  * Indicates the type of notification.
@@ -53,8 +54,15 @@ export interface InputOption {
53
54
  * close; use that when the reason only emerges from the attempt (a rejected password).
54
55
  */
55
56
  disabled?: boolean | (() => boolean);
56
- /** Per-option custom button render (replaces the former dialog-level `createOptionsButton`). */
57
- renderButton?: (props: React.HTMLAttributes<HTMLButtonElement> & React.Attributes, isDefaultOption: boolean) => React.ReactNode;
57
+ /** Render this option's button. Spread `buttonProps` on it. */
58
+ renderButton?: RenderSlotFn<OptionButtonRenderProps>;
59
+ }
60
+ /** What {@link InputOption.renderButton} is handed. */
61
+ export interface OptionButtonRenderProps {
62
+ /** The dialog's wiring for the button: its click, `type` and class. */
63
+ buttonProps: React.ButtonHTMLAttributes<HTMLButtonElement>;
64
+ /** The option is the dialog's default (its submit). */
65
+ isDefaultOption: boolean;
58
66
  }
59
67
  /** A dialog option: a plain label/identity `string`, or a rich {@link InputOption}. */
60
68
  export type OptionInput = string | InputOption;
@@ -344,6 +344,22 @@ declare const _default: {
344
344
  }
345
345
  ]
346
346
  },
347
+ "PendingResults": {
348
+ "svg": [
349
+ {
350
+ "d": "M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z",
351
+ "className": "fill"
352
+ }
353
+ ]
354
+ },
355
+ "RefreshAll": {
356
+ "svg": [
357
+ {
358
+ "d": "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",
359
+ "className": "fill"
360
+ }
361
+ ]
362
+ },
347
363
  "CellsFormat": {
348
364
  "svg": [
349
365
  {
@@ -432,6 +448,18 @@ declare const _default: {
432
448
  }
433
449
  ]
434
450
  },
451
+ "CheckboxInsert": {
452
+ "svg": [
453
+ {
454
+ "d": "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14z",
455
+ "className": "fill"
456
+ },
457
+ {
458
+ "d": "M17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z",
459
+ "className": "fill primary"
460
+ }
461
+ ]
462
+ },
435
463
  "ClearAll": {
436
464
  "svg": [
437
465
  {
@@ -1011,6 +1039,14 @@ declare const _default: {
1011
1039
  }
1012
1040
  ]
1013
1041
  },
1042
+ "Crop": {
1043
+ "svg": [
1044
+ {
1045
+ "d": "M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z",
1046
+ "className": "fill"
1047
+ }
1048
+ ]
1049
+ },
1014
1050
  "DrawAspect": {
1015
1051
  "svg": [
1016
1052
  {
@@ -2165,6 +2201,33 @@ declare const _default: {
2165
2201
  }
2166
2202
  ]
2167
2203
  },
2204
+ "InsertImageInCell": {
2205
+ "svg": [
2206
+ {
2207
+ "d": "M2 3h20v18H2zm1.5 1.5v3h3v-3zm4.5 0v3h8v-3zm9.5 0v3h3v-3zM3.5 9v3.25h3V9zm0 4.75v5.75h3v-5.75zM8 9v10.5h12.5V9zm1.5 1.5h9.5v7.5H9.5z",
2208
+ "fillRule": "evenodd",
2209
+ "className": "fill"
2210
+ },
2211
+ {
2212
+ "d": "M10.5 17l2.75-3.5 1.75 2.1 1.25-1.35L18 17zM15.75 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2z",
2213
+ "className": "fill primary"
2214
+ }
2215
+ ]
2216
+ },
2217
+ "InsertImageOverCells": {
2218
+ "svg": [
2219
+ {
2220
+ "d": "M2 3h20v18H2zm1.5 1.5v3h3v-3zm4.5 0v3h4v-3zm5.5 0v3h3v-3zm4.5 0v3h2.5v-3zM3.5 9v3.25h3V9zm0 4.75v5.75h3v-5.75zM8 19.5h4v-1.5H8zm5.5 0h3V18h-3zm4.5 0h2.5V18H18zm2.5-7.25V9H20v3.25z",
2221
+ "fillRule": "evenodd",
2222
+ "className": "fill"
2223
+ },
2224
+ {
2225
+ "d": "M8 8h11v9H8zm1.25 7.75h8.5L15 12l-2 2.5-1.25-1.5zM16 9.25a1 1 0 1 0 0 2 1 1 0 0 0 0-2z",
2226
+ "fillRule": "evenodd",
2227
+ "className": "fill primary"
2228
+ }
2229
+ ]
2230
+ },
2168
2231
  "InsertImage": {
2169
2232
  "svg": [
2170
2233
  {
@@ -11,6 +11,7 @@ export * from './splitPane';
11
11
  export * from './hooks';
12
12
  export * from './icons';
13
13
  export * from './persistence';
14
+ export * from './render';
14
15
  export * from './scroll';
15
16
  export * from './theme';
16
17
  export * from './utils';
@@ -10,7 +10,14 @@ export interface LazyComponentOptions<P> {
10
10
  * When omitted, the error is thrown to the nearest error boundary.
11
11
  * Call {@link useLazyRetry} from inside the rendered content to try again.
12
12
  */
13
- renderError?: (error: unknown, props: P) => React.ReactNode;
13
+ renderError?: (props: LazyErrorRenderProps<P>) => React.ReactNode;
14
+ }
15
+ /** What {@link LazyComponentOptions.renderError} is handed. */
16
+ export interface LazyErrorRenderProps<P> {
17
+ /** Why the load failed. */
18
+ error: unknown;
19
+ /** The props the lazy component was rendered with. */
20
+ props: P;
14
21
  }
15
22
  /**
16
23
  * Returns a function that retries loading the nearest {@link lazyComponent}, or `null` when there
@@ -33,7 +40,7 @@ export declare function useLazyRetry(): (() => void) | null;
33
40
  * @example
34
41
  * ```tsx
35
42
  * const CustomColorPanel = lazyComponent(() => import('./CustomColorPanel'), {
36
- * renderError: (error) => <LoadError error={error} />
43
+ * renderError: ({ error }) => <LoadError error={error} />
37
44
  * });
38
45
  * ```
39
46
  */
@@ -0,0 +1,43 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Drawing that finishes after its first paint: a picture whose bytes are still coming, a chart
4
+ * still laying out. A view holds its scope open while it draws; a capture of the scope (a
5
+ * screenshot, an export) waits on {@link whenRenderSettled} before it reads the screen.
6
+ *
7
+ * @remarks
8
+ * A scope is any object the work belongs to, usually the workbook. A view finds it from the
9
+ * nearest {@link PendingRenderScope}, so it need not know what it belongs to. Only views that have
10
+ * rendered can hold it open: render what is to be captured first.
11
+ */
12
+ export declare namespace PendingRender {
13
+ /**
14
+ * Holds `scope` open until the returned release is called. Releasing twice is harmless.
15
+ *
16
+ * @returns The release.
17
+ */
18
+ function begin(scope: object): () => void;
19
+ /** Whether anything holds `scope` open. */
20
+ function isPending(scope: object): boolean;
21
+ }
22
+ /**
23
+ * Resolves once nothing holds `scope` open, including drawing that starts while it waits. Wait for
24
+ * the next paint after it before reading the screen.
25
+ */
26
+ export declare const whenRenderSettled: (scope: object) => Promise<void>;
27
+ /** Props for {@link PendingRenderScope}. */
28
+ export interface PendingRenderScopeProps {
29
+ /** What the drawing below belongs to, usually the workbook; `null` for none. */
30
+ scope: object | null;
31
+ children?: React.ReactNode;
32
+ }
33
+ /** Names the scope the drawing below holds open with {@link usePendingRender}. */
34
+ export declare const PendingRenderScope: (props: PendingRenderScopeProps) => React.ReactElement;
35
+ /**
36
+ * Holds the scope open while `pending` is `true`, for {@link whenRenderSettled}; released when it
37
+ * turns `false` or the component unmounts.
38
+ *
39
+ * @param scope The scope; the nearest {@link PendingRenderScope}'s when omitted. With neither,
40
+ * nothing is held.
41
+ */
42
+ export declare const usePendingRender: (pending: boolean, scope?: object | null) => void;
43
+ //# sourceMappingURL=PendingRender.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './PendingRender';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { Size } from '@sheetxl/utils';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { IViewport } from './Viewport';
3
4
  import { ScrollbarProps } from './IScrollbar';
4
5
  /**
@@ -55,9 +56,12 @@ export interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivElement> {
55
56
  zoomable?: boolean;
56
57
  showHorizontalScrollbar?: boolean;
57
58
  showVerticalScrollbar?: boolean;
58
- renderScrollCorner?: (props: ScrollCornerProps) => React.ReactNode;
59
- renderScrollbarHorizontal?: (props: ScrollbarProps) => React.ReactNode;
60
- renderScrollbarVertical?: (props: ScrollbarProps) => React.ReactNode;
59
+ /** The corner where the two scrollbars meet. `null` leaves it empty. */
60
+ renderScrollCorner?: RenderSlotFn<ScrollCornerProps> | null;
61
+ /** `null` for no horizontal scrollbar, the gutter kept. */
62
+ renderScrollbarHorizontal?: RenderSlotFn<ScrollbarProps> | null;
63
+ /** `null` for no vertical scrollbar, the gutter kept. */
64
+ renderScrollbarVertical?: RenderSlotFn<ScrollbarProps> | null;
61
65
  /**
62
66
  * If touch is disabled.
63
67
  *
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { TouchThumbHandleProps } from './TouchThumbHandle';
3
4
  import { ScrollButtonProps } from './ScrollButton';
4
5
  import { TrackEdgeTick } from './TrackDrag';
@@ -60,8 +61,10 @@ export interface ScrollbarProps extends React.HTMLAttributes<HTMLElement> {
60
61
  scrollButtonIncrement?: number | ((offset: number, viewport: number, totalSize: number) => number);
61
62
  scrollButtonInitialRepeatDelay?: number;
62
63
  scrollButtonAdditionalRepeatDelay?: number;
63
- renderScrollButtonStart?: (props: ScrollButtonProps) => React.ReactElement;
64
- renderScrollButtonEnd?: (props: ScrollButtonProps) => React.ReactElement;
64
+ /** The button at the track's start. `null` for none. */
65
+ renderScrollButtonStart?: RenderSlotFn<ScrollButtonProps> | null;
66
+ /** The button at the track's end. `null` for none. */
67
+ renderScrollButtonEnd?: RenderSlotFn<ScrollButtonProps> | null;
65
68
  propsTouchThumb?: Partial<TouchThumbHandleProps>;
66
69
  /**
67
70
  * Called on a repeating tick while the thumb is dragged past a track end and held there. Advance the
@@ -14,16 +14,16 @@ export interface ScrollButtonProps extends React.HTMLAttributes<any> {
14
14
  * Relies on external styling. Follows the styling of scrollbars pattern. @see https://css-tricks.com/custom-scrollbars-in-webkit/
15
15
  * class of scrollbar-button, vertical or horizontal, end
16
16
  */
17
- export declare const defaultCreateScrollStartButton: (props: ScrollButtonProps) => React.ReactElement;
17
+ export declare const defaultRenderScrollButtonStart: (props: ScrollButtonProps) => React.ReactElement;
18
18
  /**
19
19
  * Relies on external styling. Follows the styling of scrollbars pattern.
20
20
  *
21
21
  * @see https://css-tricks.com/custom-scrollbars-in-webkit/
22
22
  * class of scrollbar-button, vertical or horizontal, end
23
23
  */
24
- export declare const defaultCreateScrollEndButton: (props: ScrollButtonProps) => React.ReactElement;
24
+ export declare const defaultRenderScrollButtonEnd: (props: ScrollButtonProps) => React.ReactElement;
25
25
  /**
26
26
  * TODO - implement styling support similar to other scroll buttons. Currently hardcoded
27
27
  */
28
- export declare const defaultCreateScrollEdgeButton: (props: ScrollButtonProps) => React.ReactElement;
28
+ export declare const defaultRenderScrollButtonEdge: (props: ScrollButtonProps) => React.ReactElement;
29
29
  //# sourceMappingURL=ScrollButton.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { IScrollbarElement, ScrollbarProps } from './IScrollbar';
3
4
  export interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onScroll"> {
4
5
  /**
@@ -32,7 +33,7 @@ export interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onScroll">
32
33
  * @defaultValue 50
33
34
  */
34
35
  precisionFactor?: number;
35
- renderScrollbar?: (props: ScrollbarProps) => React.ReactNode;
36
+ renderScrollbar?: RenderSlotFn<ScrollbarProps>;
36
37
  }
37
38
  /**
38
39
  * The virtual scrollbar is for very large scroll area.
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '../components';
2
3
  import { SplitPaneResizerProps } from './SplitPaneResizer';
3
4
  export interface SplitPaneAttributes {
4
5
  /**
@@ -73,7 +74,8 @@ export interface SplitPaneProps extends React.HTMLAttributes<HTMLDivElement> {
73
74
  onDragStart?: () => void;
74
75
  onDragResize?: (position: number) => void;
75
76
  onDragFinish?: (position: number) => void;
76
- renderResizer?: (props: SplitPaneResizerProps) => React.ReactElement;
77
+ /** The bar between the panes. `null` for none. */
78
+ renderResizer?: RenderSlotFn<SplitPaneResizerProps> | null;
77
79
  /**
78
80
  * A ref that points to the HTMLDivElement.
79
81
  */
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * | token | default | what sits there |
5
5
  * | --- | --- | --- |
6
- * | `grid` | 1250 | floats anchored to the grid — labels, chips, readouts, touch grips. Above app chrome (an app drawer is 1200), below the popup band so a menu covers them. |
6
+ * | `grid` | 1250 | floats anchored to the grid — labels, chips, hover tips, touch grips. Above app chrome (an app drawer is 1200), below the popup band so a menu covers them. |
7
7
  * | `popup` | 1300 | popups, menus and panels (the float stack), modal windows. MUI's modal band. |
8
- * | `tooltip` | 1500 | tooltips — out-stack menus, as MUI's do. |
8
+ * | `tooltip` | 1500 | tooltips of the chrome and menus, and gesture readouts — out-stack menus, as MUI's do. |
9
9
  *
10
10
  * The values are tokens so a host can move a band (`'z-popup'` in its {@link TokenTheme}) without every
11
11
  * consumer knowing; a consumer reads the band through {@link zIndexVar} and never writes a number.