react-resizable-panels 4.13.3 → 4.14.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,10 +7,465 @@ import { Ref } from 'react';
7
7
  import { RefObject } from 'react';
8
8
  import { SetStateAction } from 'react';
9
9
 
10
+ declare type BaseGridlineProps = {
11
+ /**
12
+ * Gridline contents (e.g. a drag handle icon).
13
+ */
14
+ children?: ReactNode | undefined;
15
+ /**
16
+ * CSS class name.
17
+ *
18
+ * ℹ️ Use the `data-separator` attribute for custom _hover_ and _active_ styles
19
+ */
20
+ className?: string | undefined;
21
+ /**
22
+ * When disabled, the gridline cannot be used to resize its neighboring tracks.
23
+ *
24
+ * ℹ️ The tracks may still be resized indirectly (e.g. by an intersecting gridline or another boundary).
25
+ * To prevent a track from being resized at all, it needs to also be disabled.
26
+ */
27
+ disabled?: boolean | undefined;
28
+ /**
29
+ * Ref attached to the root `HTMLDivElement`.
30
+ */
31
+ elementRef?: Ref<HTMLDivElement> | undefined;
32
+ /**
33
+ * CSS properties.
34
+ *
35
+ * ⚠️ Grid placement properties are managed by the gridline and cannot be overridden.
36
+ */
37
+ style?: CSSProperties | undefined;
38
+ };
39
+
10
40
  declare type BasePanelAttributes = Omit<HTMLAttributes<HTMLDivElement>, "onResize">;
11
41
 
12
42
  declare type BaseSeparatorAttributes = Omit<HTMLAttributes<HTMLDivElement>, "role" | "tabIndex">;
13
43
 
44
+ /**
45
+ * A Cell occupies one or more tracks (columns and rows) within a Grid.
46
+ * Cells are resized along with the tracks they occupy.
47
+ *
48
+ * Cell elements always include the following attributes:
49
+ *
50
+ * ```html
51
+ * <div data-cell data-testid="cell-id-prop" id="cell-id-prop">
52
+ * ```
53
+ *
54
+ * ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
55
+ *
56
+ * ⚠️ Cell elements must be direct DOM children of their parent Grid elements.
57
+ */
58
+ export declare function Cell({ children, className, column, columnSpan, elementRef: elementRefProp, id: idProp, row, rowSpan, style, ...rest }: CellProps): JSX.Element;
59
+
60
+ export declare namespace Cell {
61
+ var displayName: string;
62
+ }
63
+
64
+ export declare type CellProps = HTMLAttributes<HTMLDivElement> & {
65
+ /**
66
+ * Cell contents.
67
+ */
68
+ children?: ReactNode | undefined;
69
+ /**
70
+ * CSS class name.
71
+ */
72
+ className?: string | undefined;
73
+ /**
74
+ * Index of the (first) column this cell occupies.
75
+ */
76
+ column: number;
77
+ /**
78
+ * Number of columns this cell spans; defaults to 1.
79
+ */
80
+ columnSpan?: number | undefined;
81
+ /**
82
+ * Ref attached to the root `HTMLDivElement`.
83
+ */
84
+ elementRef?: Ref<HTMLDivElement | null> | undefined;
85
+ /**
86
+ * Uniquely identifies this cell within the parent grid.
87
+ * Falls back to `useId` when not provided.
88
+ *
89
+ * ℹ️ This value will also be assigned to the `id` and `data-testid` attributes.
90
+ */
91
+ id?: string | number | undefined;
92
+ /**
93
+ * Index of the (first) row this cell occupies.
94
+ */
95
+ row: number;
96
+ /**
97
+ * Number of rows this cell spans; defaults to 1.
98
+ */
99
+ rowSpan?: number | undefined;
100
+ /**
101
+ * CSS properties.
102
+ *
103
+ * ⚠️ Grid placement properties are managed by the Cell and cannot be overridden.
104
+ */
105
+ style?: CSSProperties | undefined;
106
+ };
107
+
108
+ /**
109
+ * A Grid arranges resizable Cells in two dimensions.
110
+ * Columns can be resized horizontally and rows can be resized vertically;
111
+ * dragging the point where a column boundary and a row boundary intersect resizes both.
112
+ *
113
+ * Size constraints (e.g. min/max size, collapsible) are specified per track (column or row),
114
+ * using the same format as Panel props.
115
+ *
116
+ * Cells can span multiple columns and/or rows.
117
+ * Track boundaries cannot be resized alongside of a cell that spans across them.
118
+ *
119
+ * Grid elements always include the following attributes:
120
+ *
121
+ * ```html
122
+ * <div data-grid data-testid="grid-id-prop" id="grid-id-prop">
123
+ * ```
124
+ *
125
+ * ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
126
+ */
127
+ export declare function Grid({ children, className, columns, defaultLayout, disableCursor, disabled, elementRef: elementRefProp, gridRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, onLayoutChanged: onLayoutChangedUnstable, resizeTargetMinimumSize, rows, style, ...rest }: GridProps): JSX.Element;
128
+
129
+ export declare namespace Grid {
130
+ var displayName: string;
131
+ }
132
+
133
+ /**
134
+ * A Grid has two independently resizable axes:
135
+ * - "column" tracks are resized horizontally
136
+ * - "row" tracks are resized vertically
137
+ */
138
+ export declare type GridAxis = "column" | "row";
139
+
140
+ /**
141
+ * Imperative Grid API.
142
+ *
143
+ * ℹ️ The `useGridRef` and `useGridCallbackRef` hooks are exported for convenience use in TypeScript projects.
144
+ */
145
+ export declare interface GridImperativeHandle {
146
+ /**
147
+ * Get the Grid's current layout: maps of column and row ids to percentages (0..100)
148
+ *
149
+ * @return Map of column ids to percentages and map of row ids to percentages (specified as numbers ranging between 0..100)
150
+ */
151
+ getLayout: () => {
152
+ columns: {
153
+ [columnId: string]: number;
154
+ };
155
+ rows: {
156
+ [rowId: string]: number;
157
+ };
158
+ };
159
+ /**
160
+ * Imperative API for the column or row with the specified id (see `GridTrackImperativeHandle`).
161
+ *
162
+ * ℹ️ Tracks without an explicit `id` use their index (e.g. `"0"`) as their id.
163
+ *
164
+ * ⚠️ An error will be thrown if the Grid does not contain a matching track.
165
+ *
166
+ * @param axis "column" or "row"
167
+ * @param id Track id
168
+ */
169
+ getTrackById: (axis: "column" | "row", id: string | number) => GridTrackImperativeHandle;
170
+ /**
171
+ * Imperative API for the column or row at the specified index (see `GridTrackImperativeHandle`).
172
+ *
173
+ * ℹ️ The index is resolved to a track id when this method is called; the returned API continues to refer to that id.
174
+ * Tracks without an explicit `id` use their index as their id,
175
+ * so specify ids if the API needs to refer to the same track after tracks are added or removed before it.
176
+ *
177
+ * ⚠️ An error will be thrown if the index is out of range.
178
+ *
179
+ * @param axis "column" or "row"
180
+ * @param index Track index (starting at 0)
181
+ */
182
+ getTrackByIndex: (axis: "column" | "row", index: number) => GridTrackImperativeHandle;
183
+ /**
184
+ * Set a new layout for one or both of the Grid's axes.
185
+ *
186
+ * @param layout Map of column and/or row ids to percentages (numbers between 0..100)
187
+ * @return Applied layout (after validation)
188
+ */
189
+ setLayout: (layout: {
190
+ columns?: {
191
+ [columnId: string]: number;
192
+ } | undefined;
193
+ rows?: {
194
+ [rowId: string]: number;
195
+ } | undefined;
196
+ }) => {
197
+ columns: {
198
+ [columnId: string]: number;
199
+ };
200
+ rows: {
201
+ [rowId: string]: number;
202
+ };
203
+ };
204
+ }
205
+
206
+ /**
207
+ * Grid layouts are a pair of (1-dimensional) layouts, one per axis.
208
+ * Each is a map of track id to percentage (0..100) of the space available to that axis.
209
+ */
210
+ export declare type GridLayout = {
211
+ columns: Layout;
212
+ rows: Layout;
213
+ };
214
+
215
+ /**
216
+ * Resizes the columns (or rows) of a Grid.
217
+ *
218
+ * For example:
219
+ *
220
+ * ```tsx
221
+ * // Rendered between columns 0 and 1 and spans all rows
222
+ * <Gridline type="column" column={1} />
223
+ * ```
224
+ *
225
+ * ```tsx
226
+ * // Rendered between rows 0 and 1 and spans all columns
227
+ * <Gridline type="row" row={1} />
228
+ * ```
229
+ *
230
+ * ```tsx
231
+ * // Rendered between columns 0 and 1 alongside of row 2 only
232
+ * <Gridline type="column" column={1} row={2} rowSpan={1} />
233
+ * ```
234
+ *
235
+ * A gridline should not be rendered alongside of a Cell that spans across its boundary
236
+ * (this includes disabled gridlines; an error will be logged to the console);
237
+ * render multiple gridlines along the same boundary instead (e.g. before and after the spanning Cell).
238
+ *
239
+ * ℹ️ Once a boundary contains a gridline, it can only be resized using gridlines;
240
+ * the parts of the boundary that aren't alongside of a gridline can't be dragged.
241
+ *
242
+ * Where column and row gridlines intersect, dragging resizes both axes.
243
+ *
244
+ * Gridlines are not _required_ but they are _recommended_ as they improve keyboard accessibility.
245
+ *
246
+ * Gridline elements always include the following attributes:
247
+ *
248
+ * ```html
249
+ * <div aria-orientation="vertical" data-separator role="separator">
250
+ * ```
251
+ *
252
+ * ℹ️ Column gridlines are vertical (`aria-orientation="vertical"`) and row gridlines are horizontal (`aria-orientation="horizontal"`).
253
+ *
254
+ * ℹ️ In addition to the attributes shown above, gridlines also render 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).
255
+ *
256
+ * ⚠️ Gridline elements must be direct DOM children of their parent Grid elements.
257
+ *
258
+ * ℹ️ Gridlines rendered by another component (rather than directly within the Grid) aren't detected until they mount, so server-rendered layouts may shift slightly during hydration.
259
+ */
260
+ export declare function Gridline(props: GridlineProps): JSX.Element;
261
+
262
+ export declare namespace Gridline {
263
+ var displayName: string;
264
+ }
265
+
266
+ export declare type GridlineProps = BaseGridlineProps & ({
267
+ /**
268
+ * Column gridlines are vertical; they resize the columns on either side of them.
269
+ * Row gridlines are horizontal; they resize the rows on either side of them.
270
+ */
271
+ type: "column";
272
+ /**
273
+ * When `type` is "column", the gridline is rendered along the leading (left) edge of this column
274
+ * (between it and the previous column); must be greater than 0 and less than the number of columns.
275
+ */
276
+ column: number;
277
+ /**
278
+ * When `type` is "column", index of the first row the gridline is rendered alongside of; defaults to 0.
279
+ */
280
+ row?: number | undefined;
281
+ /**
282
+ * Number of rows a column gridline spans; defaults to all rows (starting from `row`).
283
+ *
284
+ * ℹ️ Gridlines can span a subset of rows in order to avoid cells that span across the boundary they sit on;
285
+ * multiple gridlines can be rendered along the same boundary (e.g. above and below a spanning cell).
286
+ */
287
+ rowSpan?: number | undefined;
288
+ } | {
289
+ /**
290
+ * Column gridlines are vertical; they resize the columns on either side of them.
291
+ * Row gridlines are horizontal; they resize the rows on either side of them.
292
+ */
293
+ type: "row";
294
+ /**
295
+ * When `type` is "row", index of the first column the gridline is rendered alongside of; defaults to 0.
296
+ */
297
+ column?: number | undefined;
298
+ /**
299
+ * Number of columns a row gridline spans; defaults to all columns (starting from `column`).
300
+ *
301
+ * ℹ️ Gridlines can span a subset of columns in order to avoid cells that span across the boundary they sit on;
302
+ * multiple gridlines can be rendered along the same boundary (e.g. before and after a spanning cell).
303
+ */
304
+ columnSpan?: number | undefined;
305
+ /**
306
+ * When `type` is "row", the gridline is rendered along the leading (top) edge of this row
307
+ * (between it and the previous row); must be greater than 0 and less than the number of rows.
308
+ */
309
+ row: number;
310
+ });
311
+
312
+ export declare type GridProps = HTMLAttributes<HTMLDivElement> & {
313
+ /**
314
+ * Cell and Gridline components that comprise this grid.
315
+ *
316
+ * ⚠️ Cell and Gridline elements must be direct DOM children of their parent Grid element.
317
+ */
318
+ children?: ReactNode | undefined;
319
+ /**
320
+ * CSS class name.
321
+ */
322
+ className?: string | undefined;
323
+ /**
324
+ * Grid columns; either the number of columns or an array of size constraints (one per column).
325
+ */
326
+ columns: number | GridTrackProps[];
327
+ /**
328
+ * Default layout for either or both of the Grid's axes.
329
+ *
330
+ * ℹ️ This value allows layouts to be remembered between page reloads.
331
+ */
332
+ defaultLayout?: Partial<GridLayout> | undefined;
333
+ /**
334
+ * This library sets custom mouse cursor styles to indicate drag state.
335
+ * Use this prop to disable that behavior for this grid.
336
+ */
337
+ disableCursor?: boolean | undefined;
338
+ /**
339
+ * Disable resize functionality.
340
+ */
341
+ disabled?: boolean | undefined;
342
+ /**
343
+ * Ref attached to the root `HTMLDivElement`.
344
+ */
345
+ elementRef?: Ref<HTMLDivElement | null> | undefined;
346
+ /**
347
+ * Exposes the following imperative API:
348
+ * - `getLayout(): GridLayout`
349
+ * - `getTrackById(axis: "column" | "row", id: string | number): GridTrackImperativeHandle`
350
+ * - `getTrackByIndex(axis: "column" | "row", index: number): GridTrackImperativeHandle`
351
+ * - `setLayout(layout: Partial<GridLayout>): GridLayout`
352
+ *
353
+ * ℹ️ The `useGridRef` and `useGridCallbackRef` hooks are exported for convenience use in TypeScript projects.
354
+ */
355
+ gridRef?: Ref<GridImperativeHandle | null> | undefined;
356
+ /**
357
+ * Uniquely identifies this grid within an application.
358
+ * Falls back to `useId` when not provided.
359
+ *
360
+ * ℹ️ This value will also be assigned to the `id` and `data-testid` attributes.
361
+ */
362
+ id?: string | number | undefined;
363
+ /**
364
+ * Called when the Grid's layout is changing.
365
+ *
366
+ * ⚠️ For layout changes caused by pointer events, this method is called each time the pointer is moved.
367
+ * For most cases, it is recommended to use the `onLayoutChanged` callback instead.
368
+ */
369
+ onLayoutChange?: ((layout: GridLayout) => void) | undefined;
370
+ /**
371
+ * Called after the Grid's layout has been changed.
372
+ *
373
+ * ℹ️ For layout changes caused by pointer events, this method is not called until the pointer has been released.
374
+ * This method is recommended when saving layouts to some storage api.
375
+ */
376
+ onLayoutChanged?: ((layout: GridLayout, meta: LayoutChangedMeta<GridLayout>) => void) | undefined;
377
+ /**
378
+ * Minimum size of the resizable hit target area (either a `Gridline` or a `Cell` edge)
379
+ * This threshold ensures targets are large enough to avoid mis-clicks.
380
+ *
381
+ * ℹ️ Refer to the `Group` prop of the same name for more information.
382
+ */
383
+ resizeTargetMinimumSize?: {
384
+ coarse: number;
385
+ fine: number;
386
+ };
387
+ /**
388
+ * Grid rows; either the number of rows or an array of size constraints (one per row).
389
+ */
390
+ rows: number | GridTrackProps[];
391
+ /**
392
+ * CSS properties.
393
+ *
394
+ * ⚠️ Grid template and display properties are managed by the Grid and cannot be overridden.
395
+ */
396
+ style?: CSSProperties | undefined;
397
+ };
398
+
399
+ /**
400
+ * Imperative API for an individual Grid track (column or row); returned by `GridImperativeHandle.getTrackById` and `GridImperativeHandle.getTrackByIndex`.
401
+ *
402
+ * ℹ️ Sizes are relative to the space available to the track's axis
403
+ * (e.g. the width of the Grid, minus gaps and gridlines, for a column).
404
+ */
405
+ export declare interface GridTrackImperativeHandle {
406
+ /**
407
+ * Collapse the track to its `collapsedSize`.
408
+ *
409
+ * ⚠️ This method will do nothing if the track is not `collapsible` or if it is already collapsed.
410
+ */
411
+ collapse: () => void;
412
+ /**
413
+ * Expand a collapsed track to its most recent size.
414
+ *
415
+ * ⚠️ This method will do nothing if the track is not currently collapsed.
416
+ */
417
+ expand: () => void;
418
+ /**
419
+ * Get the current size of the track in pixels as well as a percentage of its axis (0..100).
420
+ *
421
+ * @return Track size (in pixels and as a percentage of its axis)
422
+ */
423
+ getSize: () => {
424
+ asPercentage: number;
425
+ inPixels: number;
426
+ };
427
+ /**
428
+ * The track is currently collapsed.
429
+ */
430
+ isCollapsed: () => boolean;
431
+ /**
432
+ * Update the track's size.
433
+ *
434
+ * Size can be in the following formats:
435
+ * - Percentage of the axis (0..100)
436
+ * - Pixels
437
+ * - Relative font units (em, rem)
438
+ * - Viewport relative units (vh, vw)
439
+ *
440
+ * ℹ️ Numeric values are assumed to be pixels.
441
+ * Strings without explicit units are assumed to be percentages (0%..100%).
442
+ * Percentages may also be specified as strings ending with "%" (e.g. "33%")
443
+ * Pixels may also be specified as strings ending with the unit "px".
444
+ * Other units should be specified as strings ending with their CSS property units (e.g. 1rem, 50vh)
445
+ *
446
+ * @param size New track size
447
+ */
448
+ resize: (size: number | string) => void;
449
+ }
450
+
451
+ /**
452
+ * Size constraints for a Grid track (a column or a row).
453
+ *
454
+ * Tracks support the same constraints as Panels,
455
+ * using the same [interpretation rules](https://react-resizable-panels.vercel.app/examples/size-constraints):
456
+ * - Numbers are interpreted as pixels (e.g. `minSize={200}` is 200 pixels)
457
+ * - Strings without explicit units are interpreted as percentage (e.g. `minSize="50"` is 50 percent)
458
+ * - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation
459
+ */
460
+ export declare type GridTrackProps = PanelConstraintProps & {
461
+ /**
462
+ * Uniquely identifies this track within its axis; defaults to the track's index.
463
+ *
464
+ * ℹ️ This value is used as the key for this track in the Grid's layout.
465
+ */
466
+ id?: string | number | undefined;
467
+ };
468
+
14
469
  /**
15
470
  * A Group wraps a set of resizable Panel components.
16
471
  * Group content can be resized _horizontally_ or _vertically_.
@@ -97,7 +552,7 @@ export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
97
552
  * Uniquely identifies this group within an application.
98
553
  * Falls back to `useId` when not provided.
99
554
  *
100
- * ℹ️ This value will also be assigned to the `data-group` attribute.
555
+ * ℹ️ This value will also be assigned to the `id` and `data-testid` attributes.
101
556
  */
102
557
  id?: string | number | undefined;
103
558
  /**
@@ -117,6 +572,8 @@ export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
117
572
  * The `isUserInteraction` attribute signals whether the resize was caused by direct user input.
118
573
  * It is true for resizes caused by pointer or keyboard input
119
574
  * and false for other triggers (e.g. imperative API calls, initial mount, etc.)
575
+ * The `requestedLayout` attribute is the layout before constraints were applied for the current Group size;
576
+ * prefer it when persisting layouts.
120
577
  */
121
578
  onLayoutChanged?: (layout: Layout, meta: LayoutChangedMeta) => void;
122
579
  /**
@@ -161,26 +618,34 @@ export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
161
618
  export declare function isCoarsePointer(): boolean;
162
619
 
163
620
  /**
164
- * Map of Panel id to flexGrow value;
621
+ * Map of item (e.g. Panel) id to size (a percentage between 0..100)
165
622
  */
166
623
  export declare type Layout = {
167
624
  [id: string]: number;
168
625
  };
169
626
 
170
627
  /**
171
- * Metadata describing a completed layout change, passed as the second argument
172
- * to the `onLayoutChanged` callback. See #716.
628
+ * Metadata describing a completed layout change, passed as the second argument to the `onLayoutChanged` callback.
629
+ * See #716.
173
630
  */
174
- export declare type LayoutChangedMeta = {
631
+ export declare type LayoutChangedMeta<RequestedLayout = Layout> = {
175
632
  /**
176
- * `true` when the change was caused by the user directly manipulating a
177
- * separator — releasing a pointer drag or pressing a resize key (arrow keys,
178
- * Home/End, Enter). `false` for every other source (programmatic `setLayout`
179
- * and other imperative API calls, constraint recompute, default-size change,
180
- * initial mount), because the library cannot attribute the caller's intent
181
- * there.
633
+ * `true` when the change was caused by the user directly manipulating a separator (keyboard or pointer)
634
+ * `false` for every other source (imperative API calls, constraint recompute, default-size change, initial mount),
635
+ * because the library cannot attribute the caller's intent there.
182
636
  */
183
637
  isUserInteraction: boolean;
638
+ /**
639
+ * Layout most recently requested by the user or application (e.g. pointer or keyboard input, imperative API, default layout)
640
+ * before constraints were applied for the current size.
641
+ *
642
+ * This will differ from the validated layout when constraints temporarily override the requested layout,
643
+ * e.g. a panel with a pixel-based `minSize` taking up a larger percentage of a small Group.
644
+ * The requested layout is restored if the Group grows back to a size where it satisfies all constraints.
645
+ *
646
+ * ℹ️ When saving layouts to storage, prefer this value to the validated layout.
647
+ */
648
+ requestedLayout?: RequestedLayout | undefined;
184
649
  };
185
650
 
186
651
  export declare type LayoutStorage = Pick<Storage, "getItem" | "setItem">;
@@ -190,8 +655,17 @@ export declare type OnGroupLayoutChange = GroupProps["onLayoutChange"];
190
655
  export declare type OnPanelResize = PanelProps["onResize"];
191
656
 
192
657
  /**
193
- * Panel group orientation loosely relates to the `aria-orientation` attribute.
194
- * It determines how panels are are laid out within the group group and the direction they can be resized in.
658
+ * Types shared by the resize machinery (layout math, pointer and keyboard interactions, cursors, etc.)
659
+ * which is used by both the Group and Grid components.
660
+ *
661
+ * - A "resize axis" is a set of items that can be resized along one orientation;
662
+ * e.g. a Group (whose items are Panels) or one axis of a Grid (whose items are columns or rows).
663
+ * - A "resize item" is one of those items (e.g. a Panel or a Grid track).
664
+ * - A separator (e.g. a Separator or a Gridline) resizes the items on either side of it.
665
+ */
666
+ /**
667
+ * Orientation loosely relates to the `aria-orientation` attribute.
668
+ * It determines how items are laid out and the direction they can be resized in.
195
669
  */
196
670
  export declare type Orientation = "horizontal" | "vertical";
197
671
 
@@ -226,6 +700,23 @@ export declare namespace Panel {
226
700
  var displayName: string;
227
701
  }
228
702
 
703
+ /**
704
+ * Size constraints may be specified in a variety of ways:
705
+ * - Percentage of the parent Group (0..100)
706
+ * - Pixels
707
+ * - Relative font units (em, rem)
708
+ * - Viewport relative units (vh, vw)
709
+ *
710
+ * Numeric values are assumed to be pixels.
711
+ * Strings without explicit units are assumed to be percentages (0%..100%).
712
+ *
713
+ * Percentages may also be specified as strings ending with "%" (e.g. "33%")
714
+ * Pixels may also be specified as strings ending with the unit "px".
715
+ *
716
+ * Other units should be specified as strings ending with their CSS property units (e.g. 1rem, 50vh)
717
+ */
718
+ declare type PanelConstraintProps = Pick<PanelProps, "collapsedSize" | "collapsedThreshold" | "collapsible" | "defaultSize" | "disabled" | "groupResizeBehavior" | "maxSize" | "minSize">;
719
+
229
720
  /**
230
721
  * Imperative Panel API
231
722
  *
@@ -347,7 +838,7 @@ export declare type PanelProps = BasePanelAttributes & {
347
838
  *
348
839
  * ℹ️ This prop is used to associate persisted group layouts with the original panel.
349
840
  *
350
- * ℹ️ This value will also be assigned to the `data-panel` attribute.
841
+ * ℹ️ This value will also be assigned to the `id` and `data-testid` attributes.
351
842
  */
352
843
  id?: string | number | undefined;
353
844
  /**
@@ -417,7 +908,7 @@ declare type ResizePreviewMode = "panel" | "separator";
417
908
  *
418
909
  * ℹ️ 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).
419
910
  */
420
- export declare function Separator({ children, className, disabled, disableDoubleClick, elementRef: elementRefProp, id: idProp, preview, style, ...rest }: SeparatorProps): JSX.Element;
911
+ export declare function Separator({ children, className, disabled, disableDoubleClick, elementRef, id: idProp, preview, style, ...rest }: SeparatorProps): JSX.Element;
421
912
 
422
913
  export declare namespace Separator {
423
914
  var displayName: string;
@@ -468,7 +959,7 @@ export declare type SeparatorProps = BaseSeparatorAttributes & {
468
959
  * Uniquely identifies the separator within the parent group.
469
960
  * Falls back to `useId` when not provided.
470
961
  *
471
- * ℹ️ This value will also be assigned to the `data-separator` attribute.
962
+ * ℹ️ This value will also be assigned to the `id` and `data-testid` attributes.
472
963
  */
473
964
  id?: string | number | undefined;
474
965
  /**
@@ -487,6 +978,36 @@ export declare type SeparatorProps = BaseSeparatorAttributes & {
487
978
 
488
979
  export declare type SizeUnit = "px" | "%" | "em" | "rem" | "vh" | "vw";
489
980
 
981
+ /**
982
+ * Saves and restores Grid layouts between page loads.
983
+ * It can be configured to store values using `localStorage`, `sessionStorage`, cookies, or any other persistence layer that makes sense for your application.
984
+ */
985
+ export declare function useDefaultGridLayout({ id, onlySaveAfterUserInteractions, storage }: {
986
+ /**
987
+ * Uniquely identifies a specific grid/layout.
988
+ */
989
+ id: string;
990
+ /**
991
+ * Only auto-save layouts that were directly caused by user input (e.g. keyboard or mouse events).
992
+ * Ignore layout changes resulting from imperative API calls or window resize events.
993
+ */
994
+ onlySaveAfterUserInteractions?: boolean;
995
+ /**
996
+ * Storage implementation; supports localStorage, sessionStorage, and custom implementations
997
+ * Refer to documentation site for example integrations.
998
+ */
999
+ storage?: LayoutStorage;
1000
+ }): {
1001
+ /**
1002
+ * Pass this value to `Grid` as the `defaultLayout` prop.
1003
+ */
1004
+ defaultLayout: Partial<GridLayout> | undefined;
1005
+ /**
1006
+ * Attach this callback on the `Grid` as the `onLayoutChanged` prop.
1007
+ */
1008
+ onLayoutChanged: (layout: GridLayout, meta: LayoutChangedMeta<GridLayout>) => void;
1009
+ };
1010
+
490
1011
  /**
491
1012
  * Saves and restores group layouts between page loads.
492
1013
  * It can be configured to store values using `localStorage`, `sessionStorage`, cookies, or any other persistence layer that makes sense for your application.
@@ -545,6 +1066,18 @@ export declare function useDefaultLayout({ debounceSaveMs, onlySaveAfterUserInte
545
1066
  onLayoutChanged: (layout: Layout, meta: LayoutChangedMeta) => void;
546
1067
  };
547
1068
 
1069
+ /**
1070
+ * Convenience hook to return a properly typed ref callback for the Grid component.
1071
+ *
1072
+ * Use this hook when you need to share the ref with another component or hook.
1073
+ */
1074
+ export declare function useGridCallbackRef(): [GridImperativeHandle | null, Dispatch<SetStateAction<GridImperativeHandle | null>>];
1075
+
1076
+ /**
1077
+ * Convenience hook to return a properly typed ref for the Grid component.
1078
+ */
1079
+ export declare function useGridRef(): RefObject<GridImperativeHandle | null>;
1080
+
548
1081
  /**
549
1082
  * Convenience hook to return a properly typed ref callback for the Group component.
550
1083
  *