react-resizable-panels 4.0.16 → 4.1.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.
@@ -7,6 +7,8 @@ import { Ref } from 'react';
7
7
  import { RefObject } from 'react';
8
8
  import { SetStateAction } from 'react';
9
9
 
10
+ declare type BaseAttributes = Omit<HTMLAttributes<HTMLDivElement>, "role" | "tabIndex">;
11
+
10
12
  /**
11
13
  * A Group wraps a set of resizable Panel components.
12
14
  * Group content can be resized _horizontally_ or _vertically_.
@@ -19,7 +21,7 @@ import { SetStateAction } from 'react';
19
21
  *
20
22
  * ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
21
23
  */
22
- export declare function Group({ children, className, defaultLayout, disableCursor, disabled, elementRef, groupRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, orientation, style, ...rest }: GroupProps): JSX.Element;
24
+ export declare function Group({ children, className, defaultLayout, disableCursor, disabled, elementRef: elementRefProp, groupRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, orientation, style, ...rest }: GroupProps): JSX.Element;
23
25
 
24
26
  /**
25
27
  * Imperative Group API.
@@ -149,7 +151,7 @@ export declare type Orientation = "horizontal" | "vertical";
149
151
  *
150
152
  * ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
151
153
  */
152
- export declare function Panel({ children, className, collapsedSize, collapsible, defaultSize, elementRef, id: idProp, maxSize, minSize, onResize: onResizeUnstable, panelRef, style, ...rest }: PanelProps): JSX.Element;
154
+ export declare function Panel({ children, className, collapsedSize, collapsible, defaultSize, elementRef: elementRefProp, id: idProp, maxSize, minSize, onResize: onResizeUnstable, panelRef, style, ...rest }: PanelProps): JSX.Element;
153
155
 
154
156
  /**
155
157
  * Imperative Panel API
@@ -290,7 +292,7 @@ export declare type PanelSize = {
290
292
  */
291
293
  export declare function Separator({ children, className, elementRef, id: idProp, style, ...rest }: SeparatorProps): JSX.Element;
292
294
 
293
- export declare type SeparatorProps = HTMLAttributes<HTMLDivElement> & {
295
+ export declare type SeparatorProps = BaseAttributes & {
294
296
  /**
295
297
  * CSS class name.
296
298
  *
@@ -322,11 +324,17 @@ export declare type SeparatorProps = HTMLAttributes<HTMLDivElement> & {
322
324
 
323
325
  export declare type SizeUnit = "px" | "%" | "em" | "rem" | "vh" | "vw";
324
326
 
325
- export declare function useDefaultLayout({ debounceSaveMs, storage, ...rest }: {
327
+ export declare function useDefaultLayout({ debounceSaveMs, panelIds, storage, ...rest }: {
326
328
  /**
327
329
  * Debounce save operation by the specified number of milliseconds; defaults to 100ms
328
330
  */
329
331
  debounceSaveMs?: number;
332
+ /**
333
+ * For Groups that contain conditionally-rendered Panels, this prop can be used to save and restore multiple layouts.
334
+ *
335
+ * ⚠️ Panel ids must match the Panels rendered within the Group during mount or the initial layout will be incorrect.
336
+ */
337
+ panelIds?: string[] | undefined;
330
338
  /**
331
339
  * Storage implementation; supports localStorage, sessionStorage, and custom implementations
332
340
  * Refer to documentation site for example integrations.