strata-react 1.0.44 → 1.0.46
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.
- package/README.md +2 -2
- package/UPGRADING.md +4 -0
- package/dist/components/conversation.d.ts +14 -0
- package/dist/components/selectable-grid.d.ts +18 -6
- package/dist/components/tile-grid.d.ts +9 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +537 -127
- package/dist/index.js.map +1 -1
- package/dist/lib/grouped-grid-layout.d.ts +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { GridLayout } from 'react-aria-components';
|
|
2
|
+
import { LayoutInfo, Rect } from 'react-stately';
|
|
3
|
+
/** Keys of group headings start with this, so a tile key that is a plain id can never be mistaken for one. */
|
|
4
|
+
export declare const GROUP_PREFIX = "\u2063group\u2063";
|
|
5
|
+
export declare const groupKey: (group: string) => string;
|
|
6
|
+
export declare const isGroupKey: (key: unknown) => key is string;
|
|
7
|
+
/** The height of a group's heading row, in px. */
|
|
8
|
+
export declare const HEADER_HEIGHT = 40;
|
|
9
|
+
/** One picture to place in a justified row: its width over height, known before it loads. */
|
|
10
|
+
export type JustifyItem = {
|
|
11
|
+
key: string;
|
|
12
|
+
aspect: number;
|
|
13
|
+
};
|
|
14
|
+
/** Where `justifyRows` put a picture, relative to the row's left edge, and the height of the picture's row. */
|
|
15
|
+
export type Justified = {
|
|
16
|
+
key: string;
|
|
17
|
+
x: number;
|
|
18
|
+
width: number;
|
|
19
|
+
row: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Rows of equal height, each picture at its own shape (Google Photos, Lightroom): fill a row with
|
|
23
|
+
* pictures at the target height `rowHeight` until it is full, then scale the row's height so it spans
|
|
24
|
+
* `width` exactly. The last row of a run keeps the target height rather than stretching, so a short
|
|
25
|
+
* run does not become giant pictures. `padding` is each tile's own padding and border, added to
|
|
26
|
+
* every tile's width on top of the picture (the picture is `aspect` times the row's height). Returns
|
|
27
|
+
* the placements and each row's picture height.
|
|
28
|
+
*/
|
|
29
|
+
export declare function justifyRows(items: readonly JustifyItem[], width: number, rowHeight: number, gap: number, padding: number): {
|
|
30
|
+
placed: Justified[];
|
|
31
|
+
heights: number[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The copy of the heading to draw at the top of the visible area, or null when the real one is already
|
|
35
|
+
* there. It is the last heading at or above `top`, moved to `top`, but never lower than the next
|
|
36
|
+
* heading's top less its own height, so the next heading pushes it up as it arrives.
|
|
37
|
+
*/
|
|
38
|
+
export declare function stuckHeader<H extends LayoutInfo>(headers: readonly H[], top: number): LayoutInfo | null;
|
|
39
|
+
/** `GridLayout` with full-width group headings (items keyed by `groupKey`) that stay at the top of the scroll box while their group is in view. */
|
|
40
|
+
export declare class GroupedGridLayout<T = unknown> extends GridLayout<T> {
|
|
41
|
+
private headers;
|
|
42
|
+
update(context: Parameters<GridLayout<T>["update"]>[0]): void;
|
|
43
|
+
getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.46",
|
|
4
4
|
"description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|