react-resizable-panels 4.12.4 → 4.13.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.
@@ -23,7 +23,7 @@ declare type BaseSeparatorAttributes = Omit<HTMLAttributes<HTMLDivElement>, "rol
23
23
  *
24
24
  * ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
25
25
  */
26
- export declare function Group({ children, className, defaultLayout, disableCursor, disabled, elementRef: elementRefProp, groupRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, onLayoutChanged: onLayoutChangedUnstable, orientation, resizeTargetMinimumSize, style, ...rest }: GroupProps): JSX.Element;
26
+ export declare function Group({ children, className, defaultLayout, disableCursor, disabled, elementRef: elementRefProp, groupRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, onLayoutChanged: onLayoutChangedUnstable, orientation, resizePreviewMode, resizeTargetMinimumSize, style, ...rest }: GroupProps): JSX.Element;
27
27
 
28
28
  export declare namespace Group {
29
29
  var displayName: string;
@@ -119,6 +119,15 @@ export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
119
119
  * and false for other triggers (e.g. imperative API calls, initial mount, etc.)
120
120
  */
121
121
  onLayoutChanged?: (layout: Layout, meta: LayoutChangedMeta) => void;
122
+ /**
123
+ * Controls whether pointer dragging updates `Panel`s sizes immediately,
124
+ * or renders overlay separator previews until the pointer is released.
125
+ *
126
+ * Defaults to `"panel"` (immediate resizing); `"separator"` defers resizing until release.
127
+ *
128
+ * Customize previews using the `SeparatorOverlay` component.
129
+ */
130
+ resizePreviewMode?: ResizePreviewMode | undefined;
122
131
  /**
123
132
  * Minimum size of the resizable hit target area (either `Separator` or `Panel` edge)
124
133
  * This threshold ensures are large enough to avoid mis-clicks.
@@ -141,7 +150,7 @@ export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
141
150
  /**
142
151
  * CSS properties.
143
152
  *
144
- * ⚠️ The following styles cannot be overridden: `display`, `flex-direction`, `flex-wrap`, and `overflow`.
153
+ * ⚠️ The default inline styles cannot be overridden, except for [`overflow`](https://react-resizable-panels.vercel.app/examples/overflow).
145
154
  */
146
155
  style?: CSSProperties | undefined;
147
156
  };
@@ -211,7 +220,7 @@ export declare type Orientation = "horizontal" | "vertical";
211
220
  *
212
221
  * ⚠️ Panel elements must be direct DOM children of their parent Group elements.
213
222
  */
214
- export declare function Panel({ children, className, collapsedSize, collapsible, defaultSize, disabled, elementRef: elementRefProp, groupResizeBehavior, id: idProp, maxSize, minSize, onResize: onResizeUnstable, panelRef, style, ...rest }: PanelProps): JSX.Element;
223
+ export declare function Panel({ children, className, collapsedSize, collapsedThreshold, collapsible, defaultSize, disabled, elementRef: elementRefProp, groupResizeBehavior, id: idProp, maxSize, minSize, onResize: onResizeUnstable, panelRef, style, ...rest }: PanelProps): JSX.Element;
215
224
 
216
225
  export declare namespace Panel {
217
226
  var displayName: string;
@@ -280,6 +289,20 @@ export declare type PanelProps = BasePanelAttributes & {
280
289
  * Panel size when collapsed; defaults to 0%.
281
290
  */
282
291
  collapsedSize?: number | string | undefined;
292
+ /**
293
+ * Distance a collapsible panel must be resized past its `minSize` to collapse,
294
+ * or past its `collapsedSize` to expand.
295
+ * Defaults to half the distance between `collapsedSize` and `minSize`.
296
+ *
297
+ * For example if a panel declares `collapsedSize="5%"`, `collapsedThreshold="5%"`, and `minSize="25%"`,
298
+ * it will collapse when resized below 20% and expands when resized above 10%.
299
+ *
300
+ * ℹ️ Interpretation rules:
301
+ * - Numbers are interpreted as pixels (e.g. `minSize={200}` is 200 pixels)
302
+ * - Strings without explicit units are interpreted as percentage (e.g. `minSize="50"` is 50 percent)
303
+ * - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation
304
+ */
305
+ collapsedThreshold?: number | string | undefined;
283
306
  /**
284
307
  * This panel can be collapsed.
285
308
  *
@@ -367,7 +390,7 @@ export declare type PanelProps = BasePanelAttributes & {
367
390
  /**
368
391
  * CSS properties.
369
392
  *
370
- * ⚠️ Style is applied to nested `HTMLDivElement` to avoid styles that interfere with Flex layout.
393
+ * ⚠️ The default inline styles cannot be overridden, except for [`overflow`](https://react-resizable-panels.vercel.app/examples/overflow).
371
394
  */
372
395
  style?: CSSProperties | undefined;
373
396
  };
@@ -377,6 +400,8 @@ export declare type PanelSize = {
377
400
  inPixels: number;
378
401
  };
379
402
 
403
+ declare type ResizePreviewMode = "panel" | "separator";
404
+
380
405
  /**
381
406
  * Separators are not _required_ but they are _recommended_ as they improve keyboard accessibility.
382
407
  *
@@ -392,12 +417,29 @@ export declare type PanelSize = {
392
417
  *
393
418
  * ℹ️ In addition to the attributes shown above, separator also renders all required [WAI-ARIA properties](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/separator_role#associated_wai-aria_roles_states_and_properties).
394
419
  */
395
- export declare function Separator({ children, className, disabled, disableDoubleClick, elementRef: elementRefProp, id: idProp, style, ...rest }: SeparatorProps): JSX.Element;
420
+ export declare function Separator({ children, className, disabled, disableDoubleClick, elementRef: elementRefProp, id: idProp, preview, style, ...rest }: SeparatorProps): JSX.Element;
396
421
 
397
422
  export declare namespace Separator {
398
423
  var displayName: string;
399
424
  }
400
425
 
426
+ /**
427
+ * Customizes separator previews when resizePreviewMode is "separator".
428
+ * Render within a `Group` to style all overlay previews, or pass to an individual `Separator` to style its overlay preview.
429
+ *
430
+ * Use `data-separator-overlay="active"` to style the separator being dragged,
431
+ * or `data-separator-overlay="inactive"` for separators moved indirectly.
432
+ *
433
+ * Set `width` (horizontal groups) or `height` (vertical groups) using `style` or `className`.
434
+ */
435
+ export declare function SeparatorOverlay(props: SeparatorOverlayProps): null;
436
+
437
+ export declare namespace SeparatorOverlay {
438
+ var displayName: string;
439
+ }
440
+
441
+ export declare type SeparatorOverlayProps = HTMLAttributes<HTMLDivElement>;
442
+
401
443
  export declare type SeparatorProps = BaseSeparatorAttributes & {
402
444
  /**
403
445
  * CSS class name.
@@ -429,6 +471,10 @@ export declare type SeparatorProps = BaseSeparatorAttributes & {
429
471
  * ℹ️ This value will also be assigned to the `data-separator` attribute.
430
472
  */
431
473
  id?: string | number | undefined;
474
+ /**
475
+ * Overrides the `Group` default preview for this `Separator` when `resizePreviewMode` is "separator".
476
+ */
477
+ preview?: ReactNode;
432
478
  /**
433
479
  * CSS properties.
434
480
  *