@sheetxl/utils-mui 0.7.19 → 0.7.21

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.19
2
+ * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.21
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -12,7 +12,7 @@ import { Box as p, FormControl as l, TextField as s } from "@mui/material";
12
12
  import { useCallbackRef as c, KeyCodes as u } from "@sheetxl/utils-react";
13
13
  import { OptionsDialog as m } from "./index.mjs";
14
14
  const d = ["Input"], g = o(n((o2, n2) => {
15
- const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInput: x, onValidateInput: y, onDone: O, inputProps: w, inputLabel: T, inputType: F, inputPlaceHolder: v, options: C = d, autoFocusSel: I = ".autoFocus", cancelOption: b, defaultOption: k = C?.[0], ...P } = o2, [V, D] = a(false), [j, B] = a(g2), [H, L] = a(""), [M, N] = a(true), S = c(async (t2, o3) => {
15
+ const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInput: x, onValidateInput: y, onDone: O, propsInput: w, inputLabel: T, inputType: F, inputPlaceHolder: I, options: v = d, autoFocusSel: C = ".autoFocus", cancelOption: b, defaultOption: k = v?.[0], ...V } = o2, [D, P] = a(false), [j, B] = a(g2), [H, L] = a(""), [M, N] = a(true), S = c(async (t2, o3) => {
16
16
  if (!y) return true;
17
17
  const n3 = await y?.(t2, o3);
18
18
  L(n3?.message ?? "");
@@ -32,11 +32,11 @@ const d = ["Input"], g = o(n((o2, n2) => {
32
32
  }
33
33
  return o3 ?? true;
34
34
  }, [j, h]);
35
- return t(m, { options: C, onDone: O, onOption: (t2, o3) => {
35
+ return t(m, { options: v, onDone: O, onOption: (t2, o3) => {
36
36
  o3 || $(t2);
37
- }, onValidateOption: K, cancelOption: b, defaultOption: k, autoFocusSel: I, ref: n2, ...P, children: t(p, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0) }, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(s, { onFocus: (t2) => {
38
- V || t2.target?.select(), D(true);
39
- }, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { placeholder: v, spellCheck: false, autoComplete: "off", ...w, className: e("autoFocus", w?.className), sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: j, onChange: E, onKeyDown: z, onContextMenu: (t2) => {
37
+ }, onValidateOption: K, cancelOption: b, defaultOption: k, autoFocusSel: C, ref: n2, ...V, children: t(p, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0) }, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(s, { onFocus: (t2) => {
38
+ D || t2.target?.select(), P(true);
39
+ }, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { placeholder: I, spellCheck: false, autoComplete: "off", ...w, className: e("autoFocus", w?.className), sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: j, onChange: E, onKeyDown: z, onContextMenu: (t2) => {
40
40
  t2.stopPropagation();
41
41
  } }) }) }) });
42
42
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/utils-mui",
3
3
  "description": "Utilities MUI - Utilities for MUI Components needed for all SheetXL components.",
4
- "version": "0.7.19",
4
+ "version": "0.7.21",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -45,8 +45,8 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@popperjs/core": "^2.11.8",
48
- "@sheetxl/utils": "^0.7.19",
49
- "@sheetxl/utils-react": "^0.7.19",
48
+ "@sheetxl/utils": "^0.7.21",
49
+ "@sheetxl/utils-react": "^0.7.21",
50
50
  "clsx": "^2.1.1",
51
51
  "detect-it": "^4.0.1",
52
52
  "focus-trap-react": "^10.1.4",
package/types/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import { DialogSlots } from '@mui/material';
15
15
  import { DividerProps } from '@mui/material';
16
16
  import { DraggableEventHandler } from 'react-draggable';
17
17
  import { DynamicIconProps } from '@sheetxl/utils-react';
18
+ import { ErrorPanelProps } from '@sheetxl/utils-react';
18
19
  import { ICommand } from '@sheetxl/utils-react';
19
20
  import { ICommandHook } from '@sheetxl/utils-react';
20
21
  import { ICommands } from '@sheetxl/utils-react';
@@ -23,6 +24,7 @@ import { IKeyStroke } from '@sheetxl/utils-react';
23
24
  import { Instance } from '@popperjs/core';
24
25
  import { Interpolation } from '@mui/material/styles';
25
26
  import { JSX } from 'react/jsx-runtime';
27
+ import { LoadingPanelProps } from '@sheetxl/utils-react';
26
28
  import { MenuItemProps } from '@mui/material';
27
29
  import { ModalProps } from '@mui/material';
28
30
  import { default as ModalProvider } from 'mui-modal-provider';
@@ -62,6 +64,17 @@ export declare interface AnimatedIconProps extends BoxProps {
62
64
  size?: number;
63
65
  }
64
66
 
67
+ export declare const AnimatedLoadingPanel: default_2.NamedExoticComponent<Omit<AnimatedLoadingPanelProps, "ref"> & default_2.RefAttributes<HTMLDivElement>>;
68
+
69
+ export declare interface AnimatedLoadingPanelProps extends LoadingPanelProps, Omit<BoxProps, 'label' | 'color' | 'ref'> {
70
+ icon?: default_2.ReactNode;
71
+ label?: string | default_2.ReactNode;
72
+ /**
73
+ * Wrap the icon and label in a paper panel.
74
+ */
75
+ panel?: boolean;
76
+ }
77
+
65
78
  export declare const AnimatedOrbitIcon: default_2.FC<AnimatedIconProps>;
66
79
 
67
80
  /**
@@ -145,8 +158,8 @@ export declare interface CommandToolbarAttributes {
145
158
 
146
159
  export declare interface CommandToolbarButtonProps {
147
160
  commands: ICommands.IGroup;
148
- commandButtonProps: CommandButtonOptions;
149
- commandPopupProps: CommandToolbarPopupButtonProps;
161
+ propsCommandButton: CommandButtonOptions;
162
+ propsCommandPopup: CommandToolbarPopupButtonProps;
150
163
  }
151
164
 
152
165
  export declare interface CommandToolbarPopupButtonProps extends CommandButtonOptions {
@@ -156,12 +169,9 @@ export declare interface CommandToolbarPopupButtonProps extends CommandButtonOpt
156
169
 
157
170
  export declare interface CommandToolbarProps extends ToolbarProps {
158
171
  commands: ICommands.IGroup;
159
- commandButtonProps?: CommandButtonOptions;
172
+ propsCommandButton?: CommandButtonOptions;
160
173
  parentFloat?: FloatReference;
161
- createToolbarPalette?: (props: CommandToolbarButtonProps) => default_2.ReactNode;
162
- }
163
-
164
- export declare interface CommandToolbarRefAttribute {
174
+ renderToolbarPalette?: (props: CommandToolbarButtonProps) => default_2.ReactNode;
165
175
  ref?: default_2.Ref<HTMLDivElement>;
166
176
  }
167
177
 
@@ -187,7 +197,7 @@ export declare interface CommandTooltipProps extends Omit<TooltipProps, "title">
187
197
  /**
188
198
  * Wraps a component to give it a context menu.
189
199
  */
190
- export declare const ContextMenu: default_2.FC<ScrollbarRefProps>;
200
+ export declare const ContextMenu: default_2.NamedExoticComponent<Omit<ContextMenuProps, "ref"> & default_2.RefAttributes<ContextMenuElement>>;
191
201
 
192
202
  export declare interface ContextMenuAttributes {
193
203
  isContextMenu: () => true;
@@ -207,11 +217,12 @@ export declare interface ContextMenuProps extends default_2.HTMLAttributes<HTMLE
207
217
  /**
208
218
  * Passed to the underlying popup panel
209
219
  */
210
- popperProps?: Partial<ExhibitPopperProps>;
220
+ propsPopper?: Partial<ExhibitPopperProps>;
211
221
  /**
212
222
  * Use for float reference
213
223
  */
214
224
  label?: string;
225
+ ref?: default_2.Ref<HTMLDivElement>;
215
226
  }
216
227
 
217
228
  export declare const createDownArrow: (isSplit: boolean, dense: boolean, rotate: boolean) => JSX.Element;
@@ -228,12 +239,6 @@ export declare const createExhibitTheme: (isDark: boolean, customizations?: Exhi
228
239
 
229
240
  export declare const createScrollButton: (props: ScrollButtonProps, icon: default_2.ReactElement, title: string, description: string) => JSX.Element;
230
241
 
231
- export declare const createScrollEdgeButton: (props: ScrollButtonProps) => default_2.ReactElement<unknown, string | default_2.JSXElementConstructor<any>>;
232
-
233
- export declare const createScrollEndButton: (props: ScrollButtonProps) => JSX.Element;
234
-
235
- export declare const createScrollStartButton: (props: ScrollButtonProps) => JSX.Element;
236
-
237
242
  export declare const createStrokeShadowFilter: (shadowRadius?: number) => (theme: Theme) => string;
238
243
 
239
244
  export declare const defaultCreatePopupPanel: (props: ExhibitPopupPanelProps) => default_2.ReactElement<any>;
@@ -250,29 +255,6 @@ export declare interface DraggablePaperProps extends PaperProps {
250
255
 
251
256
  export declare const elevateColor: (color: string, coefficient?: number, mode?: "light" | "dark") => string;
252
257
 
253
- /**
254
- * Simple panel to show error.
255
- * Todo - allow for action flag
256
- */
257
- export declare const ErrorPanel: default_2.NamedExoticComponent<Omit<ErrorPanelProps, "ref"> & default_2.RefAttributes<any>>;
258
-
259
- export declare interface ErrorPanelProps extends BoxProps {
260
- icon?: default_2.ReactNode;
261
- error?: any;
262
- /**
263
- * Whether to hide the stack trace.
264
- *
265
- * @defaultValue false
266
- */
267
- hideStackTrace?: boolean;
268
- /**
269
- * Whether the stack trace should be expanded by default
270
- *
271
- * @defaultValue false
272
- */
273
- stackTraceExpanded?: boolean;
274
- }
275
-
276
258
  export declare interface ExhibitComponentProps extends ComponentsProps {
277
259
  SmartInputField: SmartInputFieldProps;
278
260
  }
@@ -307,9 +289,7 @@ export declare const ExhibitDivider: default_2.NamedExoticComponent<Omit<Exhibit
307
289
  export declare interface ExhibitDividerProps extends DividerProps {
308
290
  }
309
291
 
310
- export declare const ExhibitFloatPanel: default_2.FC<ExhibitFloatPanelProps & {
311
- ref?: any;
312
- }>;
292
+ export declare const ExhibitFloatPanel: default_2.NamedExoticComponent<Omit<ExhibitFloatPanelProps, "ref"> & default_2.RefAttributes<any>>;
313
293
 
314
294
  /**
315
295
  * TODO - review the usefulness of this class
@@ -326,12 +306,16 @@ export declare interface ExhibitFloatPanelProps extends BoxProps {
326
306
  anchorPosition?: ExhibitPopperPosition;
327
307
  label: string;
328
308
  createPopupPanel?: (props: ExhibitPopupPanelProps) => default_2.ReactElement<any>;
329
- popperProps?: Partial<ExhibitPopperProps>;
309
+ propsPopper?: Partial<ExhibitPopperProps>;
330
310
  onClosing?: () => void;
331
311
  onClose?: () => void;
332
312
  onMount?: (element: HTMLDivElement, instance: any) => void;
333
313
  onOpening?: () => void;
334
314
  onOpen?: () => void;
315
+ /**
316
+ * Reference to the underlying element
317
+ */
318
+ ref?: default_2.Ref<any>;
335
319
  }
336
320
 
337
321
  /**
@@ -360,7 +344,7 @@ export declare interface ExhibitIconButtonProps extends IconButtonProps {
360
344
  * Tooltip properties. If this is specified then the tooltips are used.
361
345
  * Do not provide a child as this component will be the child.
362
346
  */
363
- tooltipProps?: Omit<ExhibitTooltipProps, 'children'>;
347
+ propsTooltip?: Omit<ExhibitTooltipProps, 'children'>;
364
348
  parentFloat?: FloatReference;
365
349
  }
366
350
 
@@ -395,7 +379,7 @@ export declare interface ExhibitMenuItemProps extends MenuItemProps {
395
379
  * Tooltip properties. If this is specified then the tooltips are used.
396
380
  * Do not provide a child as this component will be the child.
397
381
  */
398
- tooltipProps?: Omit<ExhibitTooltipProps, 'children'>;
382
+ propsTooltip?: Omit<ExhibitTooltipProps, 'children'>;
399
383
  parentFloat?: FloatReference;
400
384
  chips?: string | string[] | default_2.ReactNode | default_2.ReactNode[];
401
385
  }
@@ -472,7 +456,7 @@ export declare interface ExhibitPopupButtonProps extends BoxProps {
472
456
  createPopupPanel?: (props: ExhibitPopupPanelProps) => default_2.ReactElement<any>;
473
457
  onPopupOpen?: () => void;
474
458
  onPopupClose?: () => void;
475
- popupProps?: Partial<ExhibitFloatPanelProps>;
459
+ propsPopup?: Partial<ExhibitFloatPanelProps>;
476
460
  /**
477
461
  * Tooltip title. Zero-length titles string are never displayed.
478
462
  */
@@ -485,8 +469,8 @@ export declare interface ExhibitPopupButtonProps extends BoxProps {
485
469
  * If this set then the popup becomes a split button.
486
470
  */
487
471
  onQuickClick?: (e: default_2.MouseEvent<Element>) => void;
488
- quickButtonProps?: ExhibitQuickButtonProps;
489
- createQuickButton?: (props: ExhibitQuickButtonProps) => default_2.ReactNode;
472
+ propsQuickButton?: ExhibitQuickButtonProps;
473
+ renderQuickButton?: (props: ExhibitQuickButtonProps) => default_2.ReactNode;
490
474
  disabled?: boolean;
491
475
  /**
492
476
  * If the icon button is a primary icon button.
@@ -497,7 +481,7 @@ export declare interface ExhibitPopupButtonProps extends BoxProps {
497
481
  /**
498
482
  * Props applied to the `TouchRipple` element.
499
483
  */
500
- TouchRippleProps?: Partial<any>;
484
+ propsTouchRipple?: Partial<any>;
501
485
  /**
502
486
  * A ref that points to the `TouchRipple` element.
503
487
  */
@@ -512,7 +496,7 @@ export declare interface ExhibitPopupIconButtonProps extends ExhibitPopupButtonP
512
496
  dense?: boolean;
513
497
  outlined?: boolean | OutlineBorder;
514
498
  disableHover?: boolean;
515
- buttonProps?: BoxProps;
499
+ propsButton?: BoxProps;
516
500
  }
517
501
 
518
502
  export declare const ExhibitPopupMenuItem: default_2.FC<ExhibitPopupMenuItemProps & {
@@ -613,7 +597,7 @@ export declare interface FloatStackOptions {
613
597
  /**
614
598
  * Passed to the underlying popup panel
615
599
  */
616
- popperProps?: Partial<ExhibitPopperProps>;
600
+ propsPopper?: Partial<ExhibitPopperProps>;
617
601
  }
618
602
 
619
603
  export declare function getScrollbarCssVariables(theme: Theme, options?: ScrollbarThemingOptions): {
@@ -721,23 +705,6 @@ export declare interface LabelIconProps extends BoxProps {
721
705
  icon?: default_2.ReactElement<any>;
722
706
  }
723
707
 
724
- export declare const LoadingPanel: default_2.FC<LoadingPanelProps & {
725
- ref?: any;
726
- }>;
727
-
728
- export declare interface LoadingPanelProps extends BoxProps {
729
- icon?: default_2.ReactNode;
730
- label?: string | default_2.ReactNode;
731
- /**
732
- * Wrap the icon and label in a paper panel.
733
- */
734
- panel?: boolean;
735
- transitionDelay?: string;
736
- transparentBackground?: boolean;
737
- onMount?: () => void;
738
- onUnmount?: () => void;
739
- }
740
-
741
708
  export { ModalProvider }
742
709
 
743
710
  export declare const NestingPopupButton: default_2.NamedExoticComponent<Omit<NestingPopupButtonProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
@@ -792,9 +759,11 @@ export declare interface RelativePoint {
792
759
  y?: number | string;
793
760
  }
794
761
 
795
- export declare interface ScrollbarRefProps extends ContextMenuProps {
796
- ref?: default_2.Ref<HTMLDivElement>;
797
- }
762
+ export declare const renderScrollButtonEdge: (props: ScrollButtonProps) => default_2.ReactElement<unknown, string | default_2.JSXElementConstructor<any>>;
763
+
764
+ export declare const renderScrollButtonEnd: (props: ScrollButtonProps) => JSX.Element;
765
+
766
+ export declare const renderScrollButtonStart: (props: ScrollButtonProps) => JSX.Element;
798
767
 
799
768
  export declare function scrollbarTheming(theme: Theme, options?: ScrollbarThemingOptions): {
800
769
  "& .scrollbar, & .vsb-track, & .vsb-thumb": {
@@ -925,8 +894,35 @@ export declare interface SmartInputFieldProps {
925
894
 
926
895
  declare type Source = 'prop' | 'class' | 'media';
927
896
 
897
+ /** Basic StackTrace component */
928
898
  export declare const StackTrace: default_2.FC<StackTraceProps>;
929
899
 
900
+ /**
901
+ * Error Panel with a StackTrace.
902
+ * Todo - allow for action flag
903
+ */
904
+ export declare const StackTraceErrorPanel: default_2.NamedExoticComponent<Omit<StackTraceErrorPanelProps, "ref"> & default_2.RefAttributes<HTMLDivElement>>;
905
+
906
+ export declare interface StackTraceErrorPanelProps extends ErrorPanelProps, Omit<BoxProps, 'color' | 'ref'> {
907
+ /**
908
+ * Whether to hide the stack trace.
909
+ *
910
+ * @defaultValue false
911
+ */
912
+ hideStackTrace?: boolean;
913
+ /**
914
+ * Whether the stack trace should be expanded by default
915
+ *
916
+ * @defaultValue false
917
+ */
918
+ stackTraceExpanded?: boolean;
919
+ fullscreen?: boolean;
920
+ /**
921
+ * Optional icon to show
922
+ */
923
+ icon?: default_2.ReactNode;
924
+ }
925
+
930
926
  export declare interface StackTraceProps {
931
927
  /**
932
928
  * The error object containing the stack trace.
@@ -1067,8 +1063,6 @@ declare interface UseThemeOptions {
1067
1063
  mode?: ThemeMode;
1068
1064
  }
1069
1065
 
1070
- export declare const wrapErrorAsComponent: (error: any, hideStackTrace?: boolean, stackTraceExpanded?: boolean) => default_2.ReactNode;
1071
-
1072
1066
 
1073
1067
  export * from "mui-modal-provider";
1074
1068