@wordpress/grid 0.2.1-next.v.202607070741.0 → 0.4.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/dashboard-grid/index.cjs +1 -1
  3. package/build/dashboard-grid/index.cjs.map +2 -2
  4. package/build/dashboard-lanes/index.cjs +1 -1
  5. package/build/dashboard-lanes/index.cjs.map +2 -2
  6. package/build-module/dashboard-grid/index.mjs +1 -1
  7. package/build-module/dashboard-grid/index.mjs.map +2 -2
  8. package/build-module/dashboard-lanes/index.mjs +1 -1
  9. package/build-module/dashboard-lanes/index.mjs.map +2 -2
  10. package/build-types/dashboard-grid/grid-item.d.ts +1 -1
  11. package/build-types/dashboard-grid/grid-item.d.ts.map +1 -1
  12. package/build-types/dashboard-lanes/lanes-item.d.ts +1 -1
  13. package/build-types/dashboard-lanes/lanes-item.d.ts.map +1 -1
  14. package/build-types/grid-item.d.ts +3 -0
  15. package/build-types/grid-item.d.ts.map +1 -0
  16. package/build-types/grid.d.ts +34 -0
  17. package/build-types/grid.d.ts.map +1 -0
  18. package/build-types/resize-handle.d.ts +23 -0
  19. package/build-types/resize-handle.d.ts.map +1 -0
  20. package/build-types/resolve-fill-widths.d.ts +26 -0
  21. package/build-types/resolve-fill-widths.d.ts.map +1 -0
  22. package/build-types/shared/grid-overlay.d.ts +1 -1
  23. package/build-types/shared/grid-overlay.d.ts.map +1 -1
  24. package/build-types/shared/item-exit-overlay.d.ts +1 -1
  25. package/build-types/shared/item-exit-overlay.d.ts.map +1 -1
  26. package/build-types/shared/use-item-exit-animation.d.ts +1 -1
  27. package/build-types/shared/use-item-exit-animation.d.ts.map +1 -1
  28. package/build-types/shared/use-layout-shift-animation.d.ts +1 -1
  29. package/build-types/shared/use-layout-shift-animation.d.ts.map +1 -1
  30. package/build-types/stories/index.story.d.ts +50 -0
  31. package/build-types/stories/index.story.d.ts.map +1 -0
  32. package/build-types/types.d.ts +266 -0
  33. package/build-types/types.d.ts.map +1 -0
  34. package/package.json +11 -11
  35. package/src/dashboard-grid/grid.module.css +20 -9
  36. package/src/dashboard-lanes/lanes.module.css +20 -9
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { DashboardGridLayoutItem } from './types';
5
+ /**
6
+ * Resolves items with `width: 'fill'` by computing how many columns they
7
+ * should span. Simulates CSS Grid's row-sparse auto-flow placement so the
8
+ * resolved span matches the free run that CSS Grid will actually use.
9
+ *
10
+ * Two paths:
11
+ * - Fast path (no `height > 1` items): single-row column tracker, O(n).
12
+ * Each fixed item between two fills is visited at most once by a fill's
13
+ * look-ahead.
14
+ * - Multi-row path (any item with `height > 1`): per-column skyline that
15
+ * tracks shadow occupation of tall tiles. Placement scans rows in
16
+ * row-major order, so worst-case cost depends on both columns and rows
17
+ * scanned (rows bounded by the sum of item heights), not only on
18
+ * `maxColumns`.
19
+ *
20
+ * @param sortedKeys - Item keys in display order.
21
+ * @param layoutMap - Map of key to DashboardGridLayoutItem.
22
+ * @param maxColumns - Total columns in the grid.
23
+ * @return Map of fill item keys to their resolved column spans.
24
+ */
25
+ export declare function resolveFillWidths(sortedKeys: string[], layoutMap: Map<string, DashboardGridLayoutItem>, maxColumns: number): Map<string, number>;
26
+ //# sourceMappingURL=resolve-fill-widths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-fill-widths.d.ts","sourceRoot":"","sources":["../src/resolve-fill-widths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,GAAG,CAAE,MAAM,EAAE,uBAAuB,CAAE,EACjD,UAAU,EAAE,MAAM,GAChB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE,CAkMvB"}
@@ -15,5 +15,5 @@ import type { GridOverlayRenderProps } from './types';
15
15
  * @param props.rows Row tracks per column; omitted when unknown.
16
16
  * @param props.isActive When `false`, the overlay fades out.
17
17
  */
18
- export declare function GridOverlay({ columns, rowHeight, rows, isActive }: GridOverlayRenderProps): import("react").JSX.Element;
18
+ export declare function GridOverlay({ columns, rowHeight, rows, isActive, }: GridOverlayRenderProps): import("react").JSX.Element;
19
19
  //# sourceMappingURL=grid-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../src/shared/grid-overlay.tsx"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,EAC5B,OAAO,EACP,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,EAAE,sBAAsB,+BA0DxB"}
1
+ {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../src/shared/grid-overlay.tsx"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,EAC5B,OAAO,EACP,SAAS,EACT,IAAI,EACJ,QAAQ,GACR,EAAE,sBAAsB,+BA0DxB"}
@@ -16,5 +16,5 @@ export type ItemExitOverlayProps = {
16
16
  * @param root0.children Cached tile content to render in the ghost.
17
17
  * @param root0.onAnimationEnd Called when the exit animation finishes.
18
18
  */
19
- export declare function ItemExitOverlay({ itemKey, rect, children, onAnimationEnd }: ItemExitOverlayProps): import("react").JSX.Element;
19
+ export declare function ItemExitOverlay({ itemKey, rect, children, onAnimationEnd, }: ItemExitOverlayProps): import("react").JSX.Element;
20
20
  //# sourceMappingURL=item-exit-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-exit-overlay.d.ts","sourceRoot":"","sources":["../../src/shared/item-exit-overlay.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,YAAY,EACZ,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAE,EAChC,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,EAAE,oBAAoB,+BAsBtB"}
1
+ {"version":3,"file":"item-exit-overlay.d.ts","sourceRoot":"","sources":["../../src/shared/item-exit-overlay.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,YAAY,EACZ,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAE,EAChC,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,cAAc,GACd,EAAE,oBAAoB,+BAsBtB"}
@@ -32,6 +32,6 @@ type UseItemExitAnimationResult = {
32
32
  * @param root0.childrenCacheRef Last rendered children keyed by tile id.
33
33
  * @return Exiting overlays and a callback to dismiss one by key.
34
34
  */
35
- export declare function useItemExitAnimation({ container, enabled, layoutKeys, getPositionsBeforeLastChange, childrenCacheRef }: UseItemExitAnimationOptions): UseItemExitAnimationResult;
35
+ export declare function useItemExitAnimation({ container, enabled, layoutKeys, getPositionsBeforeLastChange, childrenCacheRef, }: UseItemExitAnimationOptions): UseItemExitAnimationResult;
36
36
  export {};
37
37
  //# sourceMappingURL=use-item-exit-animation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-item-exit-animation.d.ts","sourceRoot":"","sources":["../../src/shared/use-item-exit-animation.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AASjE,MAAM,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;CAC1B,CAAC;AAEF,KAAK,2BAA2B,GAAG;IAClC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,WAAW,CAAE,MAAM,CAAE,CAAC;IAClC,4BAA4B,EAAE,MAAM,WAAW,CAC9C,MAAM,EACN,YAAY,CACZ,GAAG,IAAI,CAAC;IACT,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CACvC,GAAG,CAAE,MAAM,EAAE,KAAK,CAAC,YAAY,CAAE,CACjC,CAAC;CACF,CAAC;AAEF,KAAK,0BAA0B,GAAG;IACjC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,CAAE,GAAG,EAAE,MAAM,KAAM,IAAI,CAAC;CAC1C,CAAC;AASF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAE,EACrC,SAAS,EACT,OAAO,EACP,UAAU,EACV,4BAA4B,EAC5B,gBAAgB,EAChB,EAAE,2BAA2B,GAAI,0BAA0B,CA6H3D"}
1
+ {"version":3,"file":"use-item-exit-animation.d.ts","sourceRoot":"","sources":["../../src/shared/use-item-exit-animation.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AASjE,MAAM,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;CAC1B,CAAC;AAEF,KAAK,2BAA2B,GAAG;IAClC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,WAAW,CAAE,MAAM,CAAE,CAAC;IAClC,4BAA4B,EAAE,MAAM,WAAW,CAC9C,MAAM,EACN,YAAY,CACZ,GAAG,IAAI,CAAC;IACT,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CACvC,GAAG,CAAE,MAAM,EAAE,KAAK,CAAC,YAAY,CAAE,CACjC,CAAC;CACF,CAAC;AAEF,KAAK,0BAA0B,GAAG;IACjC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,CAAE,GAAG,EAAE,MAAM,KAAM,IAAI,CAAC;CAC1C,CAAC;AASF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAE,EACrC,SAAS,EACT,OAAO,EACP,UAAU,EACV,4BAA4B,EAC5B,gBAAgB,GAChB,EAAE,2BAA2B,GAAI,0BAA0B,CA6H3D"}
@@ -51,7 +51,7 @@ type UseLayoutShiftAnimationResult = {
51
51
  * @param root0.excludeItemKey Item key to skip (the tile being dragged or resized).
52
52
  * @return Snapshot capture callback for use before layout updates.
53
53
  */
54
- export declare function useLayoutShiftAnimation({ container, enabled, layoutFingerprint, excludeItemKey }: UseLayoutShiftAnimationOptions): UseLayoutShiftAnimationResult;
54
+ export declare function useLayoutShiftAnimation({ container, enabled, layoutFingerprint, excludeItemKey, }: UseLayoutShiftAnimationOptions): UseLayoutShiftAnimationResult;
55
55
  /**
56
56
  * Stable fingerprint for {@link useLayoutShiftAnimation}. Width/height
57
57
  * values may be numbers or layout keywords (`'fill'`, `'full'`).
@@ -1 +1 @@
1
- {"version":3,"file":"use-layout-shift-animation.d.ts","sourceRoot":"","sources":["../../src/shared/use-layout-shift-animation.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACpC;;;OAGG;IACH,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,WAAW,CAAE,MAAM,EAAE,YAAY,CAAE,GAAG,IAAI,CAAC;IAEnE;;;OAGG;IACH,4BAA4B,EAAE,MAAM,WAAW,CAC9C,MAAM,EACN,YAAY,CACZ,GAAG,IAAI,CAAC;CACT,CAAC;AA0EF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAE,EACxC,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,cAAqB,EACrB,EAAE,8BAA8B,GAAI,6BAA6B,CAkFjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,aAAa,CAAE;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAE,GACD,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,EAAE,GAAG,CAAE,MAAM,EAAE,KAAK,CAAC,aAAa,CAAE,GAC5C,MAAM,CAaR"}
1
+ {"version":3,"file":"use-layout-shift-animation.d.ts","sourceRoot":"","sources":["../../src/shared/use-layout-shift-animation.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACpC;;;OAGG;IACH,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,WAAW,CAAE,MAAM,EAAE,YAAY,CAAE,GAAG,IAAI,CAAC;IAEnE;;;OAGG;IACH,4BAA4B,EAAE,MAAM,WAAW,CAC9C,MAAM,EACN,YAAY,CACZ,GAAG,IAAI,CAAC;CACT,CAAC;AA0EF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAE,EACxC,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,cAAqB,GACrB,EAAE,8BAA8B,GAAI,6BAA6B,CAkFjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,aAAa,CAAE;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAE,GACD,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,EAAE,GAAG,CAAE,MAAM,EAAE,KAAK,CAAC,aAAa,CAAE,GAC5C,MAAM,CAaR"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { Meta, StoryObj } from '@storybook/react-vite';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import { DashboardGrid } from '../grid';
9
+ declare const meta: Meta<typeof DashboardGrid>;
10
+ export default meta;
11
+ type Story = StoryObj<typeof DashboardGrid>;
12
+ /**
13
+ * Static grid with a fixed number of columns. Each item declares its
14
+ * column span via `width`. Items flow left-to-right and wrap to new
15
+ * rows as the total exceeds `columns`.
16
+ */
17
+ export declare const Default: Story;
18
+ /**
19
+ * Responsive grid: the column count is derived from the container
20
+ * width using `minColumnWidth` as the lower bound per column. A
21
+ * `ResizeObserver` recomputes the count on container resize.
22
+ */
23
+ export declare const Responsive: Story;
24
+ /**
25
+ * A `width: 'fill'` item expands to cover the remaining columns in
26
+ * its row. Mix it with fixed-width items on either side to build
27
+ * sidebar-like layouts that adapt to the column count.
28
+ */
29
+ export declare const FillWidth: Story;
30
+ /**
31
+ * A `width: 'full'` item spans every column (`grid-column: 1 / -1`),
32
+ * forcing a row break around it. Useful for dividers, hero banners,
33
+ * or embedded content that should always take the full width.
34
+ */
35
+ export declare const FullWidth: Story;
36
+ /**
37
+ * Numeric `rowHeight` lets items span multiple rows via `height`.
38
+ * Combined with `width`, this produces tile-based dashboards where
39
+ * each cell can be tuned independently.
40
+ */
41
+ export declare const RowHeight: Story;
42
+ /**
43
+ * Edit mode with drag, resize, and all width modes. A state panel
44
+ * shows the raw layout JSON. Drag items to reorder; resize from the
45
+ * bottom-right handle. Keyboard sensor is enabled: use Tab to focus
46
+ * an item, Space to grab, arrow keys to move, Space to drop.
47
+ */
48
+ export declare const EditMode: Story;
49
+ export declare const CustomResizeHandleStory: Story;
50
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAU5D;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CA4CrC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,aAAa,CAAE,CAAC;AA8L9C;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KA4BrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAiCxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KA4BvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KA6BvB,CAAC;AAgEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,KAyKtB,CAAC;AAyDF,eAAO,MAAM,uBAAuB,EAAE,KAoDrC,CAAC"}
@@ -0,0 +1,266 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { useDraggable } from '@dnd-kit/core';
5
+ type DraggableBindings = ReturnType<typeof useDraggable>;
6
+ /**
7
+ * Cursor offset reported by the resize handle, in pixels relative to
8
+ * the gesture start. Width and height are independent so the grid can
9
+ * step columns and rows separately.
10
+ */
11
+ export type ResizeDelta = {
12
+ width: number;
13
+ height: number;
14
+ };
15
+ /**
16
+ * Dashboard grid layout item definition.
17
+ *
18
+ * `width` accepts either a numeric column span or a discriminated string:
19
+ * - `number` spans that many columns (clamped to the grid's column count).
20
+ * - `'fill'` spans the remaining columns in the current row.
21
+ * - `'full'` spans all columns (`grid-column: 1 / -1`).
22
+ */
23
+ export type DashboardGridLayoutItem = {
24
+ /**
25
+ * Unique key that matches a child component key.
26
+ */
27
+ key: string;
28
+ /**
29
+ * Number of columns this item spans, or a string discriminator
30
+ * (`'fill'` or `'full'`).
31
+ */
32
+ width?: number | 'fill' | 'full';
33
+ /**
34
+ * Number of rows this item spans.
35
+ *
36
+ * @default 1
37
+ */
38
+ height?: number;
39
+ /**
40
+ * Display order for the item. Lower values render first. When
41
+ * omitted, the item falls back to its index in the `layout` array.
42
+ */
43
+ order?: number;
44
+ };
45
+ /**
46
+ * Props received by a custom resize handle component. Spread `listeners`
47
+ * and `attributes` onto the element that should respond to the gesture,
48
+ * and assign `ref` to the same element so dnd-kit can track it.
49
+ */
50
+ export interface ResizeHandleRenderProps {
51
+ /**
52
+ * Ref callback to attach to the gesture-bearing element.
53
+ */
54
+ ref: DraggableBindings['setNodeRef'];
55
+ /**
56
+ * Pointer/keyboard event listeners that initiate the drag.
57
+ */
58
+ listeners: DraggableBindings['listeners'];
59
+ /**
60
+ * Accessibility and dnd-kit attributes (role, aria-*, tabIndex…).
61
+ */
62
+ attributes: DraggableBindings['attributes'];
63
+ /**
64
+ * Whether vertical resizing is allowed for this tile. Useful for
65
+ * adapting the cursor or visual cue.
66
+ */
67
+ verticalResizable: boolean;
68
+ /**
69
+ * True while the user is actively dragging this handle. Use it to
70
+ * swap colors, icons, or transforms during the gesture.
71
+ */
72
+ isResizing: boolean;
73
+ /**
74
+ * Owning grid item's `key`. Available so consumers can render
75
+ * per-tile content if needed.
76
+ */
77
+ itemId?: string;
78
+ }
79
+ /**
80
+ * Props for the internal `<ResizeHandle />` wrapper.
81
+ */
82
+ export interface ResizeHandleProps {
83
+ /**
84
+ * Owning grid item's `key`. Forwarded as `data.itemId` on the
85
+ * draggable so the parent can correlate the gesture with a tile
86
+ * if needed.
87
+ */
88
+ itemId?: string;
89
+ /**
90
+ * Whether the handle should track vertical movement. When false,
91
+ * the handle still appears but only emits horizontal deltas, and
92
+ * the cursor is constrained to the column resize axis.
93
+ *
94
+ * @default true
95
+ */
96
+ verticalResizable?: boolean;
97
+ /**
98
+ * Callback fired while the handle is being dragged. Receives the
99
+ * cursor offset from the gesture start in pixels.
100
+ */
101
+ onResize?: (delta: ResizeDelta) => void;
102
+ /**
103
+ * Callback fired when the gesture ends.
104
+ */
105
+ onResizeEnd?: () => void;
106
+ /**
107
+ * Component that overrides the default corner triangle with a
108
+ * custom element. Receives gesture wiring (`ref`, `listeners`,
109
+ * `attributes`) plus context. The grid keeps ownership of the
110
+ * `<DndContext>` and the throttled delta loop; consumers are only
111
+ * responsible for the visual.
112
+ */
113
+ renderResizeHandle?: React.ComponentType<ResizeHandleRenderProps>;
114
+ }
115
+ /**
116
+ * Props for the internal `<GridItem />` wrapper.
117
+ */
118
+ export type GridItemProps = {
119
+ /**
120
+ * The layout item containing grid positioning information.
121
+ */
122
+ item: DashboardGridLayoutItem;
123
+ /**
124
+ * The maximum number of columns in the grid.
125
+ */
126
+ maxColumns: number;
127
+ /**
128
+ * Whether drag and resize interactions are disabled.
129
+ *
130
+ * @default false
131
+ */
132
+ disabled?: boolean;
133
+ /**
134
+ * Whether the item can be resized vertically. Disabled when the
135
+ * grid uses `rowHeight: 'auto'`, where row height is driven by
136
+ * content rather than by the user.
137
+ *
138
+ * @default true
139
+ */
140
+ verticalResizable?: boolean;
141
+ /**
142
+ * Whether any tile in the grid is currently being dragged or
143
+ * resized. When true, the item mutes its `actionableArea` with
144
+ * `inert` so pointer hovers over buttons in other tiles do not
145
+ * steal the in-progress gesture.
146
+ *
147
+ * @default false
148
+ */
149
+ interacting?: boolean;
150
+ /**
151
+ * The content to be displayed within the grid item.
152
+ */
153
+ children: React.ReactNode;
154
+ /**
155
+ * Content rendered above the draggable area that stays interactive
156
+ * in edit mode — typically action buttons, menus, or links. While
157
+ * any tile in the grid is being dragged or resized, this content
158
+ * is set `inert` so hovers on other tiles can't steal the gesture.
159
+ */
160
+ actionableArea?: React.ReactNode;
161
+ /**
162
+ * Callback fired while the item is being resized. Receives the
163
+ * item's `key` plus the cursor offset from the gesture start in
164
+ * pixels; the grid converts the offset to column/row spans.
165
+ */
166
+ onResize: (id: string, delta: ResizeDelta) => void;
167
+ /**
168
+ * Callback fired when the resize gesture ends.
169
+ */
170
+ onResizeEnd: () => void;
171
+ /**
172
+ * Component forwarded to `<ResizeHandle />` to override the default
173
+ * corner triangle. See `DashboardGridProps.renderResizeHandle`.
174
+ */
175
+ renderResizeHandle?: React.ComponentType<ResizeHandleRenderProps>;
176
+ };
177
+ /**
178
+ * Props shared by fixed and responsive DashboardGrid variants. Extends
179
+ * the standard div props so consumers can pass `id`, `aria-*`, `data-*`,
180
+ * event handlers, etc., directly on the grid root.
181
+ */
182
+ interface BaseDashboardGridProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'className' | 'style'> {
183
+ /**
184
+ * Array of layout items.
185
+ */
186
+ layout: DashboardGridLayoutItem[];
187
+ /**
188
+ * Grid children. Each child must carry a `key` that matches an
189
+ * entry in `layout`; children without a match are rendered outside
190
+ * the grid.
191
+ */
192
+ children: React.ReactNode;
193
+ /**
194
+ * Additional CSS class on the grid root.
195
+ */
196
+ className?: string;
197
+ /**
198
+ * Inline styles applied to the grid root. Merged underneath the
199
+ * grid's own layout styles, so the layout (`gridTemplateColumns`,
200
+ * `gridAutoRows`, `gap`) always wins.
201
+ */
202
+ style?: React.CSSProperties;
203
+ /**
204
+ * Grid gap multiplier size (e.g., a spacing of 2 results in a gap
205
+ * of 8px, it's multiplied by 4).
206
+ *
207
+ * @default 2
208
+ */
209
+ spacing?: number;
210
+ /**
211
+ * Height of each row in pixels, or `'auto'` to let the tallest
212
+ * tile in the row size it.
213
+ *
214
+ * @default 'auto'
215
+ */
216
+ rowHeight?: number | 'auto';
217
+ /**
218
+ * Whether the grid is in edit mode (allows dragging and
219
+ * repositioning items).
220
+ *
221
+ * @default false
222
+ */
223
+ editMode?: boolean;
224
+ /**
225
+ * Callback fired when the user commits a drag or resize. Receives
226
+ * the resulting layout.
227
+ */
228
+ onChangeLayout?: (newLayout: DashboardGridLayoutItem[]) => void;
229
+ /**
230
+ * Callback fired continuously during a drag or resize interaction
231
+ * with the in-progress layout. Useful for live feedback in the
232
+ * surface (e.g., displaying the current width/position). The final
233
+ * committed layout is still emitted via `onChangeLayout`.
234
+ */
235
+ onPreviewLayout?: (previewLayout: DashboardGridLayoutItem[]) => void;
236
+ /**
237
+ * Override the default corner-triangle resize handle with a custom
238
+ * component. The grid still owns the gesture (dnd-kit `<DndContext>`,
239
+ * throttled delta loop) and passes the wiring to the consumer:
240
+ * spread `listeners` and `attributes` and assign `ref` on the
241
+ * element that should receive the gesture. Use `disabled` and
242
+ * `verticalResizable` to adapt the visual to context.
243
+ */
244
+ renderResizeHandle?: React.ComponentType<ResizeHandleRenderProps>;
245
+ }
246
+ interface FixedDashboardGridProps extends BaseDashboardGridProps {
247
+ /**
248
+ * Total number of columns in the grid.
249
+ *
250
+ * @default 6
251
+ */
252
+ columns: number;
253
+ minColumnWidth?: never;
254
+ }
255
+ interface ResponsiveDashboardGridProps extends BaseDashboardGridProps {
256
+ /**
257
+ * Minimum width in pixels per column. Enables responsive mode:
258
+ * the column count is derived from container width, down to a
259
+ * minimum of 1 column. Mutually exclusive with `columns`.
260
+ */
261
+ minColumnWidth?: number;
262
+ columns?: never;
263
+ }
264
+ export type DashboardGridProps = FixedDashboardGridProps | ResponsiveDashboardGridProps;
265
+ export {};
266
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/grid",
3
- "version": "0.2.1-next.v.202607070741.0+a51d59513",
3
+ "version": "0.4.0",
4
4
  "description": "Grid layout components for arranging tiles in dashboard-style surfaces, with drag-to-reorder and tile resizing.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -49,24 +49,24 @@
49
49
  "@dnd-kit/core": "^6.3.1",
50
50
  "@dnd-kit/sortable": "^10.0.0",
51
51
  "@dnd-kit/utilities": "^3.2.2",
52
- "@wordpress/compose": "^8.3.1-next.v.202607070741.0+a51d59513",
53
- "@wordpress/element": "^8.2.1-next.v.202607070741.0+a51d59513",
54
- "@wordpress/style-runtime": "^0.6.1-next.v.202607070741.0+a51d59513",
52
+ "@wordpress/compose": "^8.5.0",
53
+ "@wordpress/element": "^8.4.0",
54
+ "@wordpress/style-runtime": "^0.8.0",
55
55
  "clsx": "^2.1.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@storybook/react-vite": "^10.4.3",
59
59
  "@testing-library/dom": "^10.4.1",
60
60
  "@testing-library/react": "^16.3.2",
61
- "@types/jest": "^29.5.14",
62
- "@wordpress/icons": "^15.1.1-next.v.202607070741.0+a51d59513",
63
- "@wordpress/ui": "^0.18.1-next.v.202607070741.0+a51d59513",
61
+ "@types/jest": "^30.0.0",
62
+ "@wordpress/icons": "^15.3.0",
63
+ "@wordpress/ui": "^0.19.0",
64
64
  "storybook": "^10.4.3"
65
65
  },
66
66
  "peerDependencies": {
67
- "@types/react": "^18.3.27",
68
- "react": "^18.0.0",
69
- "react-dom": "^18.0.0"
67
+ "@types/react": "^18 || ^19",
68
+ "react": "^18 || ^19",
69
+ "react-dom": "^18 || ^19"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@types/react": {
@@ -76,5 +76,5 @@
76
76
  "publishConfig": {
77
77
  "access": "public"
78
78
  },
79
- "gitHead": "f637726e370c8b23695ed9af82adbe171ad235d8"
79
+ "gitHead": "7e8b17a983f9391d3ebc7717af2a1c9ed7efc7ab"
80
80
  }
@@ -11,14 +11,25 @@
11
11
  * @dnd-kit’s drop translation matches the placeholder; scale lives on
12
12
  * `__lift` (see dnd-kit #398). Owns elevation, radius, cursor, and
13
13
  * pointer pass-through. Further chrome belongs to the consumer. Drag
14
- * elevation animates `xs` → `md` so it reads above edit tiles at `xs`.
14
+ * the shadow strengthens while dragging so it reads above edit tiles.
15
15
  */
16
16
  .drag-preview-frame {
17
+ --_wp-grid-elevation-xs:
18
+ 0 1px 1px rgba(0, 0, 0, 0.03),
19
+ 0 1px 2px rgba(0, 0, 0, 0.02),
20
+ 0 3px 3px rgba(0, 0, 0, 0.02),
21
+ 0 4px 4px rgba(0, 0, 0, 0.01);
22
+ --_wp-grid-elevation-md:
23
+ 0 2px 3px rgba(0, 0, 0, 0.05),
24
+ 0 4px 5px rgba(0, 0, 0, 0.04),
25
+ 0 12px 12px rgba(0, 0, 0, 0.03),
26
+ 0 16px 16px rgba(0, 0, 0, 0.02);
27
+
17
28
  height: 100%;
18
29
  border-radius: var(--wp-grid-drag-preview-radius, 0);
19
30
  cursor: grabbing;
20
31
  pointer-events: none;
21
- box-shadow: var(--wpds-elevation-md);
32
+ box-shadow: var(--_wp-grid-elevation-md);
22
33
  }
23
34
 
24
35
  .drag-preview-frame__lift {
@@ -44,11 +55,11 @@
44
55
  @media not (prefers-reduced-motion: reduce) {
45
56
  @keyframes wp-grid-drag-preview-shadow-enter {
46
57
  from {
47
- box-shadow: var(--wpds-elevation-xs);
58
+ box-shadow: var(--_wp-grid-elevation-xs);
48
59
  }
49
60
 
50
61
  to {
51
- box-shadow: var(--wpds-elevation-md);
62
+ box-shadow: var(--_wp-grid-elevation-md);
52
63
  }
53
64
  }
54
65
 
@@ -87,11 +98,11 @@
87
98
 
88
99
  @keyframes wp-grid-drag-preview-shadow-exit {
89
100
  from {
90
- box-shadow: var(--wpds-elevation-md);
101
+ box-shadow: var(--_wp-grid-elevation-md);
91
102
  }
92
103
 
93
104
  to {
94
- box-shadow: var(--wpds-elevation-xs);
105
+ box-shadow: var(--_wp-grid-elevation-xs);
95
106
  }
96
107
  }
97
108
 
@@ -107,7 +118,7 @@
107
118
  }
108
119
 
109
120
  .drag-preview-frame.dragPreviewFrameExiting {
110
- box-shadow: var(--wpds-elevation-xs);
121
+ box-shadow: var(--_wp-grid-elevation-xs);
111
122
  }
112
123
 
113
124
  .drag-preview-frame.dragPreviewFrameExiting .drag-preview-frame__lift {
@@ -116,7 +127,7 @@
116
127
 
117
128
  @media (prefers-reduced-motion: reduce) {
118
129
  .drag-preview-frame {
119
- box-shadow: var(--wpds-elevation-md);
130
+ box-shadow: var(--_wp-grid-elevation-md);
120
131
  }
121
132
 
122
133
  .drag-preview-frame__lift {
@@ -124,7 +135,7 @@
124
135
  }
125
136
 
126
137
  .drag-preview-frame.dragPreviewFrameExiting {
127
- box-shadow: var(--wpds-elevation-xs);
138
+ box-shadow: var(--_wp-grid-elevation-xs);
128
139
  transition: none;
129
140
  }
130
141
 
@@ -29,14 +29,25 @@
29
29
  * @dnd-kit’s drop translation matches the placeholder; scale lives on
30
30
  * `__lift` (see dnd-kit #398). Owns elevation, radius, cursor, and
31
31
  * pointer pass-through. Further chrome belongs to the consumer. Drag
32
- * elevation animates `xs` → `md` so it reads above edit tiles at `xs`.
32
+ * the shadow strengthens while dragging so it reads above edit tiles.
33
33
  */
34
34
  .drag-preview-frame {
35
+ --_wp-grid-elevation-xs:
36
+ 0 1px 1px rgba(0, 0, 0, 0.03),
37
+ 0 1px 2px rgba(0, 0, 0, 0.02),
38
+ 0 3px 3px rgba(0, 0, 0, 0.02),
39
+ 0 4px 4px rgba(0, 0, 0, 0.01);
40
+ --_wp-grid-elevation-md:
41
+ 0 2px 3px rgba(0, 0, 0, 0.05),
42
+ 0 4px 5px rgba(0, 0, 0, 0.04),
43
+ 0 12px 12px rgba(0, 0, 0, 0.03),
44
+ 0 16px 16px rgba(0, 0, 0, 0.02);
45
+
35
46
  height: 100%;
36
47
  border-radius: var(--wp-grid-drag-preview-radius, 0);
37
48
  cursor: grabbing;
38
49
  pointer-events: none;
39
- box-shadow: var(--wpds-elevation-md);
50
+ box-shadow: var(--_wp-grid-elevation-md);
40
51
  }
41
52
 
42
53
  .drag-preview-frame__lift {
@@ -62,11 +73,11 @@
62
73
  @media not (prefers-reduced-motion: reduce) {
63
74
  @keyframes wp-grid-drag-preview-shadow-enter {
64
75
  from {
65
- box-shadow: var(--wpds-elevation-xs);
76
+ box-shadow: var(--_wp-grid-elevation-xs);
66
77
  }
67
78
 
68
79
  to {
69
- box-shadow: var(--wpds-elevation-md);
80
+ box-shadow: var(--_wp-grid-elevation-md);
70
81
  }
71
82
  }
72
83
 
@@ -105,11 +116,11 @@
105
116
 
106
117
  @keyframes wp-grid-drag-preview-shadow-exit {
107
118
  from {
108
- box-shadow: var(--wpds-elevation-md);
119
+ box-shadow: var(--_wp-grid-elevation-md);
109
120
  }
110
121
 
111
122
  to {
112
- box-shadow: var(--wpds-elevation-xs);
123
+ box-shadow: var(--_wp-grid-elevation-xs);
113
124
  }
114
125
  }
115
126
 
@@ -125,7 +136,7 @@
125
136
  }
126
137
 
127
138
  .drag-preview-frame.dragPreviewFrameExiting {
128
- box-shadow: var(--wpds-elevation-xs);
139
+ box-shadow: var(--_wp-grid-elevation-xs);
129
140
  }
130
141
 
131
142
  .drag-preview-frame.dragPreviewFrameExiting .drag-preview-frame__lift {
@@ -134,7 +145,7 @@
134
145
 
135
146
  @media (prefers-reduced-motion: reduce) {
136
147
  .drag-preview-frame {
137
- box-shadow: var(--wpds-elevation-md);
148
+ box-shadow: var(--_wp-grid-elevation-md);
138
149
  }
139
150
 
140
151
  .drag-preview-frame__lift {
@@ -142,7 +153,7 @@
142
153
  }
143
154
 
144
155
  .drag-preview-frame.dragPreviewFrameExiting {
145
- box-shadow: var(--wpds-elevation-xs);
156
+ box-shadow: var(--_wp-grid-elevation-xs);
146
157
  transition: none;
147
158
  }
148
159