@dxos/react-ui-masonry 0.8.4-main.c85a9c8dae → 0.8.4-main.cb12b3f963
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/dist/lib/browser/index.mjs +112 -69
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +112 -69
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Masonry.d.ts +39 -7
- package/dist/types/src/Masonry.d.ts.map +1 -1
- package/dist/types/src/Masonry.stories.d.ts +3 -0
- package/dist/types/src/Masonry.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -22
- package/src/Masonry.stories.tsx +21 -15
- package/src/Masonry.tsx +228 -115
|
@@ -1,13 +1,45 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type ComponentType, type JSX, type PropsWithChildren, type Ref } from 'react';
|
|
2
|
+
import { ScrollAreaRootProps, ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type MasonryContextValue = {
|
|
4
|
+
/** Render component for each masonry item. */
|
|
5
|
+
Tile: ComponentType<{
|
|
6
|
+
data: any;
|
|
7
|
+
index: number;
|
|
8
|
+
}>;
|
|
9
|
+
/** Override auto-calculated column count. */
|
|
10
|
+
columns: number | undefined;
|
|
11
|
+
/** Upper bound on number of columns. */
|
|
12
|
+
maxColumns: number | undefined;
|
|
13
|
+
/** Minimum column width in rem. */
|
|
14
|
+
minColumnWidth: number;
|
|
15
|
+
/** Maximum column width in rem. */
|
|
16
|
+
maxColumnWidth: number;
|
|
17
|
+
/** Space between columns and rows in rem. */
|
|
18
|
+
gutter: number;
|
|
6
19
|
};
|
|
20
|
+
type MasonryRootProps = PropsWithChildren<Partial<MasonryContextValue>>;
|
|
21
|
+
declare function MasonryRoot({ children, Tile, columns, maxColumns, minColumnWidth, maxColumnWidth, gutter }: MasonryRootProps): JSX.Element;
|
|
22
|
+
declare namespace MasonryRoot {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
type MasonryContentProps = ThemedClassName<PropsWithChildren<Pick<ScrollAreaRootProps, 'centered' | 'thin' | 'padding'>>>;
|
|
26
|
+
type MasonryViewportProps<Item> = ThemedClassName<{
|
|
27
|
+
/** Items to render in the masonry grid. */
|
|
28
|
+
items: Item[];
|
|
29
|
+
/** Extract a stable key from an item, aligned with react-ui-mosaic's getId. */
|
|
30
|
+
getId?: (data: Item) => string;
|
|
31
|
+
}>;
|
|
7
32
|
export declare const Masonry: {
|
|
8
|
-
Root:
|
|
33
|
+
Root: {
|
|
34
|
+
({ children, Tile, columns, maxColumns, minColumnWidth, maxColumnWidth, gutter, }: MasonryRootProps): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
Content: (props: MasonryContentProps & {
|
|
38
|
+
ref?: Ref<HTMLDivElement | null>;
|
|
39
|
+
}) => JSX.Element;
|
|
40
|
+
Viewport: <Item>(props: MasonryViewportProps<Item> & {
|
|
9
41
|
ref?: Ref<HTMLDivElement | null>;
|
|
10
42
|
}) => JSX.Element;
|
|
11
43
|
};
|
|
12
|
-
export type { MasonryRootProps };
|
|
44
|
+
export type { MasonryRootProps, MasonryContentProps, MasonryViewportProps };
|
|
13
45
|
//# sourceMappingURL=Masonry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Masonry.d.ts","sourceRoot":"","sources":["../../../src/Masonry.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Masonry.d.ts","sourceRoot":"","sources":["../../../src/Masonry.tsx"],"names":[],"mappings":"AAQA,OAAc,EAAE,KAAK,aAAa,EAAE,KAAK,GAAG,EAAE,KAAK,iBAAiB,EAAE,KAAK,GAAG,EAAmB,MAAM,OAA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GAtDuC,IAAI,SAC5C,oBAAoB,CAAC,IAAI,CAAC,GAAG;QAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;KAClC,KACE,GAAG,CAAC,OAAO;CAmDf,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MasonryRootProps } from './Masonry';
|
|
2
4
|
declare const meta: {
|
|
3
5
|
title: string;
|
|
6
|
+
render: (props: MasonryRootProps) => React.JSX.Element;
|
|
4
7
|
decorators: import("@storybook/react").Decorator[];
|
|
5
8
|
parameters: {
|
|
6
9
|
layout: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Masonry.stories.d.ts","sourceRoot":"","sources":["../../../src/Masonry.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Masonry.stories.d.ts","sourceRoot":"","sources":["../../../src/Masonry.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAW,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAgCtD,QAAA,MAAM,IAAI;;oBAbmB,gBAAgB;;;QA8BzC,MAAM;;CAEM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|