@sheetxl/utils-react 0.8.0-beta.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -7
- package/browser/esm/{Bw28AK_GmLacWQL9.mjs → B40op1SaLNqvFHlg.mjs} +2 -2
- package/browser/esm/{i81p_jZjY1WbfES8.mjs → BIiHroifM2tesCns.mjs} +22 -21
- package/browser/esm/DKfTbMgV21FBnNOl.mjs +100 -0
- package/browser/esm/index.mjs +2668 -2134
- package/licenses/dependencies.txt +1 -39
- package/node/esm/DGnB_ajTnvY63CO9.mjs +100 -0
- package/node/esm/{DTFDut0Eizkfjl77.mjs → DmRJGz37SB1KXyjc.mjs} +2 -2
- package/node/esm/index.mjs +2352 -1826
- package/package.json +9 -12
- package/types/src/animation/useAnimatedMeasure.d.ts +2 -3
- package/types/src/command/CommandButtonRegistry.d.ts +3 -1
- package/types/src/command/CommandScope.d.ts +23 -2
- package/types/src/components/RenderSlot.d.ts +32 -0
- package/types/src/components/index.d.ts +1 -1
- package/types/src/float/FloatPanel.d.ts +7 -6
- package/types/src/float/FloatPopper.d.ts +84 -10
- package/types/src/float/FloatPopup.d.ts +1 -1
- package/types/src/float/FloatProvider.d.ts +3 -2
- package/types/src/float/FloatStackContext.d.ts +8 -0
- package/types/src/float/FloatUtils.d.ts +3 -2
- package/types/src/float/_FloatTheme.d.ts +16 -0
- package/types/src/float/_FloatUtils.d.ts +6 -0
- package/types/src/float/index.d.ts +0 -1
- package/types/src/float/useFloatStack.d.ts +6 -5
- package/types/src/hooks/index.d.ts +4 -0
- package/types/src/hooks/useCallbackRef.d.ts +19 -6
- package/types/src/hooks/useEditMode.d.ts +26 -6
- package/types/src/hooks/useInputModality.d.ts +26 -0
- package/types/src/hooks/useLocationSearch.d.ts +9 -0
- package/types/src/hooks/useMeasure.d.ts +32 -0
- package/types/src/hooks/useNotifier.d.ts +35 -34
- package/types/src/hooks/useSynchronizedPointerHandler.d.ts +3 -7
- package/types/src/hooks/useVisualViewportRect.d.ts +40 -0
- package/types/src/icons/packs/Base.json.d.ts +3624 -0
- package/types/src/index.d.ts +2 -0
- package/types/src/lazy/lazyComponent.d.ts +9 -2
- package/types/src/persistence/Types.d.ts +4 -2
- package/types/src/persistence/usePersistentState.d.ts +3 -0
- package/types/src/render/PendingRender.d.ts +43 -0
- package/types/src/render/index.d.ts +2 -0
- package/types/src/scroll/AxisViewport.d.ts +6 -2
- package/types/src/scroll/IScrollPane.d.ts +17 -4
- package/types/src/scroll/IScrollbar.d.ts +5 -2
- package/types/src/scroll/ScrollButton.d.ts +3 -3
- package/types/src/scroll/Utils.d.ts +1 -0
- package/types/src/scroll/Viewport.d.ts +50 -2
- package/types/src/scroll/VirtualScrollbar.d.ts +2 -1
- package/types/src/scroll/scrollbarTheming.d.ts +2 -23
- package/types/src/scroll/touchOwner.d.ts +19 -0
- package/types/src/scroll/useWheelScroll.d.ts +15 -2
- package/types/src/scroll/wheelOwner.d.ts +18 -0
- package/types/src/scroller/Scroller.d.ts +44 -5
- package/types/src/splitPane/SplitPane.d.ts +3 -1
- package/types/src/theme/ThemeStyle.d.ts +22 -0
- package/types/src/theme/TokenTheme.d.ts +10 -1
- package/types/src/theme/buildThemeCSS.d.ts +9 -0
- package/types/src/theme/defaultTheme.d.ts +6 -0
- package/types/src/theme/index.d.ts +3 -1
- package/types/src/theme/themeAttrs.d.ts +5 -4
- package/types/src/theme/tokenVar.d.ts +20 -0
- package/types/src/theme/useResolvedThemeMode.d.ts +27 -5
- package/types/src/theme/zIndex.d.ts +24 -0
- package/types/src/utils/index.d.ts +1 -0
- package/types/src/utils/measureUIText.d.ts +24 -0
- package/types/src/virtualKeyboard/KeyboardAccessory.d.ts +73 -0
- package/types/src/virtualKeyboard/VirtualKeyboard.d.ts +128 -0
- package/types/src/virtualKeyboard/_keyboardApi.d.ts +13 -0
- package/types/src/virtualKeyboard/index.d.ts +4 -0
- package/types/src/virtualKeyboard/useKeyboardResize.d.ts +41 -0
- package/browser/cjs/DZSvmqU8nRas1uz6.cjs +0 -1
- package/browser/cjs/YFvC9nIpxy3b5ZTk.cjs +0 -1
- package/browser/cjs/index.cjs +0 -5
- package/browser/cjs/wW5CllvkH2ZVrahP.cjs +0 -1
- package/browser/esm/B5GygXf0YyM0P3w6.mjs +0 -2231
- package/node/esm/Cwt7wlb1TEVLnVZr.mjs +0 -2231
- package/types/src/components/ITooltip.d.ts +0 -38
- package/types/src/float/FloatTooltip.d.ts +0 -22
- package/types/src/theme/TokenThemeProvider.d.ts +0 -97
- package/types/src/utils/PinchZoom.d.ts +0 -3
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export declare const ToolTipPlacement: {
|
|
3
|
-
readonly BottomEnd: "bottom-end";
|
|
4
|
-
readonly BottomStart: "bottom-start";
|
|
5
|
-
readonly Bottom: "bottom";
|
|
6
|
-
readonly LeftEnd: "left-end";
|
|
7
|
-
readonly LeftStart: "left-start";
|
|
8
|
-
readonly Left: "left";
|
|
9
|
-
readonly RightEnd: "right-end";
|
|
10
|
-
readonly RightStart: "right-start";
|
|
11
|
-
readonly Right: "right";
|
|
12
|
-
readonly TopEnd: "top-end";
|
|
13
|
-
readonly TopStart: "top-start";
|
|
14
|
-
readonly Top: "top";
|
|
15
|
-
};
|
|
16
|
-
export type ToolTipPlacement = typeof ToolTipPlacement[keyof typeof ToolTipPlacement];
|
|
17
|
-
export interface IShowToolTipProperties {
|
|
18
|
-
/**
|
|
19
|
-
* The anchor for the tooltip. x,y are required
|
|
20
|
-
* but width and height can also be provided.
|
|
21
|
-
*/
|
|
22
|
-
anchor: {
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
width?: number;
|
|
26
|
-
height?: number;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* The value to display. This is either a string or a react element
|
|
30
|
-
*/
|
|
31
|
-
display?: string | React.ReactElement;
|
|
32
|
-
/**
|
|
33
|
-
* Purely suggestion only
|
|
34
|
-
* If not specified then the consumer will determine
|
|
35
|
-
*/
|
|
36
|
-
placement?: ToolTipPlacement;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=ITooltip.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Placement } from '@floating-ui/react-dom';
|
|
3
|
-
import { FloatPopperPosition, FloatPopperAnchor } from './FloatPopper';
|
|
4
|
-
/**
|
|
5
|
-
* A lightweight, controlled tooltip built on {@link FloatPopper}.
|
|
6
|
-
*
|
|
7
|
-
* Unlike a hover tooltip, this is fully controlled (`open` + `anchor`) which suits
|
|
8
|
-
* programmatic tooltips (e.g. scroll/resize hints).
|
|
9
|
-
*/
|
|
10
|
-
export interface FloatTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
11
|
-
open: boolean;
|
|
12
|
-
title?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* @defaultValue 'top'
|
|
15
|
-
*/
|
|
16
|
-
placement?: Placement;
|
|
17
|
-
anchorEl?: FloatPopperAnchor;
|
|
18
|
-
anchorPosition?: FloatPopperPosition;
|
|
19
|
-
offsets?: number[];
|
|
20
|
-
}
|
|
21
|
-
export declare const FloatTooltip: React.NamedExoticComponent<FloatTooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
-
//# sourceMappingURL=FloatTooltip.d.ts.map
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { TokenTheme, ThemeMode } from './TokenTheme';
|
|
3
|
-
import { ThemeCSSOptions } from './buildThemeCSS';
|
|
4
|
-
/**
|
|
5
|
-
* What a {@link TokenThemeProvider} publishes to descendants — the *handle*, not resolved values (resolution
|
|
6
|
-
* stays in CSS). A portaled float is a React descendant but NOT a DOM descendant, so the cascade can't reach
|
|
7
|
-
* it; a float layer reads this to re-attach the theme (stamp `scopeClass` + `mode` on its portal root).
|
|
8
|
-
* `light`/`dark` are the already-MERGED inputs so a nested provider can merge further.
|
|
9
|
-
*/
|
|
10
|
-
export interface TokenThemeContextValue {
|
|
11
|
-
/**
|
|
12
|
-
* Per-instance scope class (no leading dot) — present ONLY when the provider is `isolate`d (i.e. it emits
|
|
13
|
-
* `@scope`d rules). A float carries it so those scoped rules apply on the portal root; `undefined` for a
|
|
14
|
-
* global provider (nothing to carry — global rules reach the float anyway).
|
|
15
|
-
*/
|
|
16
|
-
scopeClass?: string;
|
|
17
|
-
/** The mode a float should stamp, when this provider (or an ancestor provider) pins one. */
|
|
18
|
-
mode?: ThemeMode;
|
|
19
|
-
/** Merged light-mode token inputs (base/parent ⊕ own) — a child provider merges on top of these. */
|
|
20
|
-
light?: Partial<TokenTheme>;
|
|
21
|
-
/** Merged dark-mode token inputs. */
|
|
22
|
-
dark?: Partial<TokenTheme>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The raw context. Exported so a non-`TokenThemeProvider` theme root (e.g. the MUI studio, which builds its
|
|
26
|
-
* own sheet) can still PUBLISH the handle — `<TokenThemeContext.Provider value={{ scopeClass, mode }}>` — so
|
|
27
|
-
* floats and nested `TokenThemeProvider`s see it. Prefer {@link useTokenThemeContext} to read it.
|
|
28
|
-
*/
|
|
29
|
-
export declare const TokenThemeContext: React.Context<TokenThemeContextValue | null>;
|
|
30
|
-
/** Read the nearest {@link TokenThemeProvider}'s handle (scope class + mode + merged inputs), or `null`. */
|
|
31
|
-
export declare const useTokenThemeContext: () => TokenThemeContextValue | null;
|
|
32
|
-
export interface TokenThemeProviderProps {
|
|
33
|
-
/** Light-mode token overrides. Shallow-merged over the base (parent provider ?? `base` prop). Own wins. */
|
|
34
|
-
light?: Partial<TokenTheme>;
|
|
35
|
-
/** Dark-mode token overrides. Shallow-merged over the base. Own wins. */
|
|
36
|
-
dark?: Partial<TokenTheme>;
|
|
37
|
-
/**
|
|
38
|
-
* The app baseline both modes start from, for the **from-scratch** case (theming a bare `Grid`, which has
|
|
39
|
-
* no surfaces of its own). Omit it in the **common** case — wrap a component that already brings its base +
|
|
40
|
-
* surfaces (`Studio`, `WorkbookElement`) and this provider is a pure override layer. Layered low → high as
|
|
41
|
-
* `base` ⊕ parent-provider ⊕ own, so a nested provider keeps `base` as a floor under the inherited tokens.
|
|
42
|
-
*/
|
|
43
|
-
base?: Record<ThemeMode, TokenTheme>;
|
|
44
|
-
/**
|
|
45
|
-
* Named surface overrides (e.g. `{ grid: GRID_SURFACE, header: HEADER_SURFACE }`), passed straight to
|
|
46
|
-
* {@link buildThemeCSS}. Only for the from-scratch case; a wrapped `Studio`/`WorkbookElement` supplies its
|
|
47
|
-
* own. Pass a stable object (it re-emits the sheet when the reference changes).
|
|
48
|
-
*/
|
|
49
|
-
surfaces?: ThemeCSSOptions['surfaces'];
|
|
50
|
-
/**
|
|
51
|
-
* Pin the mode by stamping `data-sxl-theme-mode` on this provider's root (`'auto'` follows the OS / a
|
|
52
|
-
* `light`|`dark` class). **Omit it in the common case** — the wrapped component stamps its own mode, and
|
|
53
|
-
* the mode-keyed overrides follow it via the cascade. Pin it only when the themed content sits on this
|
|
54
|
-
* provider's own root with no inner mode (the from-scratch bare-`Grid` case).
|
|
55
|
-
*/
|
|
56
|
-
mode?: ThemeMode | 'auto';
|
|
57
|
-
/** Stamp `data-sxl-theme-surface` on the root (e.g. `'grid'`). Optional — app is the default surface. */
|
|
58
|
-
surface?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Isolate this instance in an `@scope` so its tokens don't collide with another provider on the page.
|
|
61
|
-
* Default `false` (global) — correct for the common "theme the whole app" case, and it reaches portaled
|
|
62
|
-
* popups for free. Set `true` for multiple independently-themed instances on one page (note: an isolated
|
|
63
|
-
* provider's overrides don't yet reach a WRAPPED component's own portaled floats — that needs float-layer
|
|
64
|
-
* wiring off {@link useTokenThemeContext}). @defaultValue false
|
|
65
|
-
*/
|
|
66
|
-
isolate?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* The `@layer` the tokens emit into. Default `'sxl-overrides'` — the top layer, so overrides win over the
|
|
69
|
-
* app/defaults regardless of specificity. Pass `'sxl-app'` to act as an app baseline instead.
|
|
70
|
-
* @defaultValue 'sxl-overrides'
|
|
71
|
-
*/
|
|
72
|
-
layer?: string;
|
|
73
|
-
/**
|
|
74
|
-
* The content to theme. A provider renders **no DOM box of its own** — when a `mode`/`surface` is pinned or
|
|
75
|
-
* the instance is `isolate`d, those are cloned ONTO this child, so in that case it must be a **single**
|
|
76
|
-
* element that forwards `className` / DOM attributes to its root (`Studio`, `WorkbookElement`, and intrinsic
|
|
77
|
-
* elements all do). In the common case (global, no pinned mode) nothing is injected and children render as-is.
|
|
78
|
-
*/
|
|
79
|
-
children?: React.ReactNode;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A thin React wrapper around the CSS-variable theme model — the ergonomic form of the hand-written
|
|
83
|
-
* `<style>` + `data-sxl-theme-*` ceremony (see the "CSS Variables" story). It builds the `--sxl-*` stylesheet
|
|
84
|
-
* from `light`/`dark` token sets (via {@link buildThemeCSS}) and injects it, so the common flow is: render a
|
|
85
|
-
* workbook, wrap it, pass your brand tokens. It renders **no DOM box of its own** — when a mode/surface is
|
|
86
|
-
* pinned or the instance is `isolate`d, those attributes are cloned onto its single child instead.
|
|
87
|
-
*
|
|
88
|
-
* @remarks
|
|
89
|
-
* **Resolution stays in CSS** — this only *emits* CSS and publishes a {@link TokenThemeContextValue} handle.
|
|
90
|
-
* The default is an **override layer over a wrapped component that already defines base + surfaces** (Studio /
|
|
91
|
-
* WorkbookElement); `base`/`surfaces` are the from-scratch escape hatch. Nesting is a **shallow input merge**
|
|
92
|
-
* (base/parent ⊕ own) — a `TokenTheme` is flat, so a shallow spread is the correct merge (the one array token
|
|
93
|
-
* `color-series` is replaced wholesale by design). There is intentionally **no shared-`theme` prop**: put
|
|
94
|
-
* shared tokens in both modes, or in a parent provider both modes inherit (nesting IS the shared layer).
|
|
95
|
-
*/
|
|
96
|
-
export declare const TokenThemeProvider: React.FC<TokenThemeProviderProps>;
|
|
97
|
-
//# sourceMappingURL=TokenThemeProvider.d.ts.map
|