@dxos/react-ui-masonry 0.8.4-main.406dc2a

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/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ MIT License
2
+ Copyright (c) 2022 DXOS
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @dxos/react-ui-masonry
2
+
3
+ A masonry component.
@@ -0,0 +1,80 @@
1
+ // src/Masonry.tsx
2
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
3
+ import { useMasonry, usePositioner, useResizeObserver } from "masonic";
4
+ import React, { forwardRef, useMemo, useRef } from "react";
5
+ import { useScroller, useSize } from "@dxos/react-hooks";
6
+ import { usePx } from "@dxos/react-ui";
7
+ import { mx } from "@dxos/react-ui-theme";
8
+ var usePxProps = (remProps) => {
9
+ const remInPx = usePx(1);
10
+ return useMemo(() => {
11
+ return Object.fromEntries(Object.entries(remProps).filter(([_, value]) => Number.isFinite(value)).map(([key, value]) => {
12
+ return [
13
+ key,
14
+ value * remInPx
15
+ ];
16
+ }));
17
+ }, [
18
+ remProps,
19
+ remInPx
20
+ ]);
21
+ };
22
+ var MasonryRootImpl = ({ columnCount, maxColumnCount, columnWidth = 18, maxColumnWidth, columnGutter = 1, rowGutter, items, itemHeightEstimate = 256, itemKey, overscanBy = 6, render, onRender, classNames, intrinsicHeight, ...props }, forwardedRef) => {
23
+ const rootRef = useRef(null);
24
+ const ref = useComposedRefs(rootRef, forwardedRef);
25
+ const { width, height } = useSize(rootRef);
26
+ const { scrollTop, isScrolling } = useScroller(rootRef);
27
+ const remProps = useMemo(() => ({
28
+ columnWidth,
29
+ maxColumnWidth,
30
+ columnGutter,
31
+ rowGutter
32
+ }), [
33
+ columnWidth,
34
+ maxColumnWidth,
35
+ columnGutter,
36
+ rowGutter
37
+ ]);
38
+ const pxProps = usePxProps(remProps);
39
+ const positionerProps = useMemo(() => ({
40
+ width,
41
+ columnCount,
42
+ maxColumnCount,
43
+ ...pxProps
44
+ }), [
45
+ width,
46
+ pxProps,
47
+ columnCount,
48
+ maxColumnCount
49
+ ]);
50
+ const positioner = usePositioner(positionerProps, [
51
+ positionerProps
52
+ ]);
53
+ const resizeObserver = useResizeObserver(positioner);
54
+ const children = useMasonry({
55
+ height: intrinsicHeight ? Infinity : height,
56
+ scrollTop,
57
+ isScrolling,
58
+ resizeObserver,
59
+ positioner,
60
+ items,
61
+ itemHeightEstimate,
62
+ itemKey,
63
+ overscanBy,
64
+ render,
65
+ onRender
66
+ });
67
+ return /* @__PURE__ */ React.createElement("div", {
68
+ className: mx(classNames),
69
+ ...props,
70
+ ref
71
+ }, children);
72
+ };
73
+ var MasonryRoot = /* @__PURE__ */ forwardRef(MasonryRootImpl);
74
+ var Masonry = {
75
+ Root: MasonryRoot
76
+ };
77
+ export {
78
+ Masonry
79
+ };
80
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/Masonry.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport {\n type UseMasonryOptions,\n type UsePositionerOptions,\n useMasonry,\n usePositioner,\n useResizeObserver,\n} from 'masonic';\nimport React, {\n type ComponentPropsWithRef,\n type ForwardedRef,\n type JSX,\n type Ref,\n forwardRef,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useScroller, useSize } from '@dxos/react-hooks';\nimport { type ThemedClassName, usePx } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\ntype MasonryRootProps<Item> = ThemedClassName<ComponentPropsWithRef<'div'>> &\n Omit<UsePositionerOptions, 'width'> &\n Omit<\n UseMasonryOptions<Item>,\n | 'height'\n | 'scrollTop'\n | 'isScrolling'\n | 'resizeObserver'\n | 'positioner'\n | 'as'\n | 'id'\n | 'itemAs'\n | 'itemStyle'\n | 'className'\n | 'style'\n | 'role'\n | 'tabIndex'\n | 'containerRef'\n > & { intrinsicHeight?: boolean };\n\nconst usePxProps = (remProps: Omit<UsePositionerOptions, 'width' | 'columnCount' | 'maxColumnCount'>) => {\n const remInPx = usePx(1);\n return useMemo(() => {\n return Object.fromEntries(\n Object.entries(remProps)\n .filter(([_, value]) => Number.isFinite(value))\n .map(([key, value]) => {\n return [key, value * remInPx];\n }),\n );\n }, [remProps, remInPx]);\n};\n\nconst MasonryRootImpl = <Item,>(\n {\n columnCount,\n maxColumnCount,\n columnWidth = 18,\n maxColumnWidth,\n columnGutter = 1,\n rowGutter,\n items,\n itemHeightEstimate = 256,\n itemKey,\n overscanBy = 6,\n render,\n onRender,\n classNames,\n intrinsicHeight,\n ...props\n }: MasonryRootProps<Item>,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const ref = useComposedRefs(rootRef, forwardedRef);\n const { width, height } = useSize(rootRef);\n const { scrollTop, isScrolling } = useScroller(rootRef);\n const remProps = useMemo(\n () => ({ columnWidth, maxColumnWidth, columnGutter, rowGutter }),\n [columnWidth, maxColumnWidth, columnGutter, rowGutter],\n );\n const pxProps = usePxProps(remProps);\n const positionerProps = useMemo(\n () => ({\n width,\n columnCount,\n maxColumnCount,\n ...pxProps,\n }),\n [width, pxProps, columnCount, maxColumnCount],\n );\n const positioner = usePositioner(positionerProps, [positionerProps]);\n const resizeObserver = useResizeObserver(positioner);\n const children = useMasonry({\n height: intrinsicHeight ? Infinity : height,\n scrollTop,\n isScrolling,\n resizeObserver,\n positioner,\n items,\n itemHeightEstimate,\n itemKey,\n overscanBy,\n render,\n onRender,\n });\n return (\n <div className={mx(classNames)} {...props} ref={ref}>\n {children}\n </div>\n );\n};\n\nconst MasonryRoot = forwardRef(MasonryRootImpl) as <Item>(\n props: MasonryRootProps<Item> & {\n ref?: Ref<HTMLDivElement | null>;\n },\n) => JSX.Element;\n\nexport const Masonry = {\n Root: MasonryRoot,\n};\n\nexport type { MasonryRootProps };\n"],
5
+ "mappings": ";AAIA,SAASA,uBAAuB;AAChC,SAGEC,YACAC,eACAC,yBACK;AACP,OAAOC,SAKLC,YACAC,SACAC,cACK;AAEP,SAASC,aAAaC,eAAe;AACrC,SAA+BC,aAAa;AAC5C,SAASC,UAAU;AAsBnB,IAAMC,aAAa,CAACC,aAAAA;AAClB,QAAMC,UAAUC,MAAM,CAAA;AACtB,SAAOC,QAAQ,MAAA;AACb,WAAOC,OAAOC,YACZD,OAAOE,QAAQN,QAAAA,EACZO,OAAO,CAAC,CAACC,GAAGC,KAAAA,MAAWC,OAAOC,SAASF,KAAAA,CAAAA,EACvCG,IAAI,CAAC,CAACC,KAAKJ,KAAAA,MAAM;AAChB,aAAO;QAACI;QAAKJ,QAAQR;;IACvB,CAAA,CAAA;EAEN,GAAG;IAACD;IAAUC;GAAQ;AACxB;AAEA,IAAMa,kBAAkB,CACtB,EACEC,aACAC,gBACAC,cAAc,IACdC,gBACAC,eAAe,GACfC,WACAC,OACAC,qBAAqB,KACrBC,SACAC,aAAa,GACbC,QACAC,UACAC,YACAC,iBACA,GAAGC,MAAAA,GAELC,iBAAAA;AAEA,QAAMC,UAAUC,OAA8B,IAAA;AAC9C,QAAMC,MAAMC,gBAAgBH,SAASD,YAAAA;AACrC,QAAM,EAAEK,OAAOC,OAAM,IAAKC,QAAQN,OAAAA;AAClC,QAAM,EAAEO,WAAWC,YAAW,IAAKC,YAAYT,OAAAA;AAC/C,QAAM/B,WAAWG,QACf,OAAO;IAAEc;IAAaC;IAAgBC;IAAcC;EAAU,IAC9D;IAACH;IAAaC;IAAgBC;IAAcC;GAAU;AAExD,QAAMqB,UAAU1C,WAAWC,QAAAA;AAC3B,QAAM0C,kBAAkBvC,QACtB,OAAO;IACLgC;IACApB;IACAC;IACA,GAAGyB;EACL,IACA;IAACN;IAAOM;IAAS1B;IAAaC;GAAe;AAE/C,QAAM2B,aAAaC,cAAcF,iBAAiB;IAACA;GAAgB;AACnE,QAAMG,iBAAiBC,kBAAkBH,UAAAA;AACzC,QAAMI,WAAWC,WAAW;IAC1BZ,QAAQR,kBAAkBqB,WAAWb;IACrCE;IACAC;IACAM;IACAF;IACAtB;IACAC;IACAC;IACAC;IACAC;IACAC;EACF,CAAA;AACA,SACE,sBAAA,cAACwB,OAAAA;IAAIC,WAAWC,GAAGzB,UAAAA;IAAc,GAAGE;IAAOI;KACxCc,QAAAA;AAGP;AAEA,IAAMM,cAAcC,2BAAWxC,eAAAA;AAMxB,IAAMyC,UAAU;EACrBC,MAAMH;AACR;",
6
+ "names": ["useComposedRefs", "useMasonry", "usePositioner", "useResizeObserver", "React", "forwardRef", "useMemo", "useRef", "useScroller", "useSize", "usePx", "mx", "usePxProps", "remProps", "remInPx", "usePx", "useMemo", "Object", "fromEntries", "entries", "filter", "_", "value", "Number", "isFinite", "map", "key", "MasonryRootImpl", "columnCount", "maxColumnCount", "columnWidth", "maxColumnWidth", "columnGutter", "rowGutter", "items", "itemHeightEstimate", "itemKey", "overscanBy", "render", "onRender", "classNames", "intrinsicHeight", "props", "forwardedRef", "rootRef", "useRef", "ref", "useComposedRefs", "width", "height", "useSize", "scrollTop", "isScrolling", "useScroller", "pxProps", "positionerProps", "positioner", "usePositioner", "resizeObserver", "useResizeObserver", "children", "useMasonry", "Infinity", "div", "className", "mx", "MasonryRoot", "forwardRef", "Masonry", "Root"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/Masonry.tsx":{"bytes":9891,"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"masonic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":454,"imports":[{"path":"src/Masonry.tsx","kind":"import-statement","original":"./Masonry"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5568},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"masonic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["Masonry"],"entryPoint":"src/index.ts","inputs":{"src/Masonry.tsx":{"bytesInOutput":2121},"src/index.ts":{"bytesInOutput":0}},"bytes":2197}}}
@@ -0,0 +1,82 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/Masonry.tsx
4
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
5
+ import { useMasonry, usePositioner, useResizeObserver } from "masonic";
6
+ import React, { forwardRef, useMemo, useRef } from "react";
7
+ import { useScroller, useSize } from "@dxos/react-hooks";
8
+ import { usePx } from "@dxos/react-ui";
9
+ import { mx } from "@dxos/react-ui-theme";
10
+ var usePxProps = (remProps) => {
11
+ const remInPx = usePx(1);
12
+ return useMemo(() => {
13
+ return Object.fromEntries(Object.entries(remProps).filter(([_, value]) => Number.isFinite(value)).map(([key, value]) => {
14
+ return [
15
+ key,
16
+ value * remInPx
17
+ ];
18
+ }));
19
+ }, [
20
+ remProps,
21
+ remInPx
22
+ ]);
23
+ };
24
+ var MasonryRootImpl = ({ columnCount, maxColumnCount, columnWidth = 18, maxColumnWidth, columnGutter = 1, rowGutter, items, itemHeightEstimate = 256, itemKey, overscanBy = 6, render, onRender, classNames, intrinsicHeight, ...props }, forwardedRef) => {
25
+ const rootRef = useRef(null);
26
+ const ref = useComposedRefs(rootRef, forwardedRef);
27
+ const { width, height } = useSize(rootRef);
28
+ const { scrollTop, isScrolling } = useScroller(rootRef);
29
+ const remProps = useMemo(() => ({
30
+ columnWidth,
31
+ maxColumnWidth,
32
+ columnGutter,
33
+ rowGutter
34
+ }), [
35
+ columnWidth,
36
+ maxColumnWidth,
37
+ columnGutter,
38
+ rowGutter
39
+ ]);
40
+ const pxProps = usePxProps(remProps);
41
+ const positionerProps = useMemo(() => ({
42
+ width,
43
+ columnCount,
44
+ maxColumnCount,
45
+ ...pxProps
46
+ }), [
47
+ width,
48
+ pxProps,
49
+ columnCount,
50
+ maxColumnCount
51
+ ]);
52
+ const positioner = usePositioner(positionerProps, [
53
+ positionerProps
54
+ ]);
55
+ const resizeObserver = useResizeObserver(positioner);
56
+ const children = useMasonry({
57
+ height: intrinsicHeight ? Infinity : height,
58
+ scrollTop,
59
+ isScrolling,
60
+ resizeObserver,
61
+ positioner,
62
+ items,
63
+ itemHeightEstimate,
64
+ itemKey,
65
+ overscanBy,
66
+ render,
67
+ onRender
68
+ });
69
+ return /* @__PURE__ */ React.createElement("div", {
70
+ className: mx(classNames),
71
+ ...props,
72
+ ref
73
+ }, children);
74
+ };
75
+ var MasonryRoot = /* @__PURE__ */ forwardRef(MasonryRootImpl);
76
+ var Masonry = {
77
+ Root: MasonryRoot
78
+ };
79
+ export {
80
+ Masonry
81
+ };
82
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/Masonry.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport {\n type UseMasonryOptions,\n type UsePositionerOptions,\n useMasonry,\n usePositioner,\n useResizeObserver,\n} from 'masonic';\nimport React, {\n type ComponentPropsWithRef,\n type ForwardedRef,\n type JSX,\n type Ref,\n forwardRef,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useScroller, useSize } from '@dxos/react-hooks';\nimport { type ThemedClassName, usePx } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\ntype MasonryRootProps<Item> = ThemedClassName<ComponentPropsWithRef<'div'>> &\n Omit<UsePositionerOptions, 'width'> &\n Omit<\n UseMasonryOptions<Item>,\n | 'height'\n | 'scrollTop'\n | 'isScrolling'\n | 'resizeObserver'\n | 'positioner'\n | 'as'\n | 'id'\n | 'itemAs'\n | 'itemStyle'\n | 'className'\n | 'style'\n | 'role'\n | 'tabIndex'\n | 'containerRef'\n > & { intrinsicHeight?: boolean };\n\nconst usePxProps = (remProps: Omit<UsePositionerOptions, 'width' | 'columnCount' | 'maxColumnCount'>) => {\n const remInPx = usePx(1);\n return useMemo(() => {\n return Object.fromEntries(\n Object.entries(remProps)\n .filter(([_, value]) => Number.isFinite(value))\n .map(([key, value]) => {\n return [key, value * remInPx];\n }),\n );\n }, [remProps, remInPx]);\n};\n\nconst MasonryRootImpl = <Item,>(\n {\n columnCount,\n maxColumnCount,\n columnWidth = 18,\n maxColumnWidth,\n columnGutter = 1,\n rowGutter,\n items,\n itemHeightEstimate = 256,\n itemKey,\n overscanBy = 6,\n render,\n onRender,\n classNames,\n intrinsicHeight,\n ...props\n }: MasonryRootProps<Item>,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const ref = useComposedRefs(rootRef, forwardedRef);\n const { width, height } = useSize(rootRef);\n const { scrollTop, isScrolling } = useScroller(rootRef);\n const remProps = useMemo(\n () => ({ columnWidth, maxColumnWidth, columnGutter, rowGutter }),\n [columnWidth, maxColumnWidth, columnGutter, rowGutter],\n );\n const pxProps = usePxProps(remProps);\n const positionerProps = useMemo(\n () => ({\n width,\n columnCount,\n maxColumnCount,\n ...pxProps,\n }),\n [width, pxProps, columnCount, maxColumnCount],\n );\n const positioner = usePositioner(positionerProps, [positionerProps]);\n const resizeObserver = useResizeObserver(positioner);\n const children = useMasonry({\n height: intrinsicHeight ? Infinity : height,\n scrollTop,\n isScrolling,\n resizeObserver,\n positioner,\n items,\n itemHeightEstimate,\n itemKey,\n overscanBy,\n render,\n onRender,\n });\n return (\n <div className={mx(classNames)} {...props} ref={ref}>\n {children}\n </div>\n );\n};\n\nconst MasonryRoot = forwardRef(MasonryRootImpl) as <Item>(\n props: MasonryRootProps<Item> & {\n ref?: Ref<HTMLDivElement | null>;\n },\n) => JSX.Element;\n\nexport const Masonry = {\n Root: MasonryRoot,\n};\n\nexport type { MasonryRootProps };\n"],
5
+ "mappings": ";;;AAIA,SAASA,uBAAuB;AAChC,SAGEC,YACAC,eACAC,yBACK;AACP,OAAOC,SAKLC,YACAC,SACAC,cACK;AAEP,SAASC,aAAaC,eAAe;AACrC,SAA+BC,aAAa;AAC5C,SAASC,UAAU;AAsBnB,IAAMC,aAAa,CAACC,aAAAA;AAClB,QAAMC,UAAUC,MAAM,CAAA;AACtB,SAAOC,QAAQ,MAAA;AACb,WAAOC,OAAOC,YACZD,OAAOE,QAAQN,QAAAA,EACZO,OAAO,CAAC,CAACC,GAAGC,KAAAA,MAAWC,OAAOC,SAASF,KAAAA,CAAAA,EACvCG,IAAI,CAAC,CAACC,KAAKJ,KAAAA,MAAM;AAChB,aAAO;QAACI;QAAKJ,QAAQR;;IACvB,CAAA,CAAA;EAEN,GAAG;IAACD;IAAUC;GAAQ;AACxB;AAEA,IAAMa,kBAAkB,CACtB,EACEC,aACAC,gBACAC,cAAc,IACdC,gBACAC,eAAe,GACfC,WACAC,OACAC,qBAAqB,KACrBC,SACAC,aAAa,GACbC,QACAC,UACAC,YACAC,iBACA,GAAGC,MAAAA,GAELC,iBAAAA;AAEA,QAAMC,UAAUC,OAA8B,IAAA;AAC9C,QAAMC,MAAMC,gBAAgBH,SAASD,YAAAA;AACrC,QAAM,EAAEK,OAAOC,OAAM,IAAKC,QAAQN,OAAAA;AAClC,QAAM,EAAEO,WAAWC,YAAW,IAAKC,YAAYT,OAAAA;AAC/C,QAAM/B,WAAWG,QACf,OAAO;IAAEc;IAAaC;IAAgBC;IAAcC;EAAU,IAC9D;IAACH;IAAaC;IAAgBC;IAAcC;GAAU;AAExD,QAAMqB,UAAU1C,WAAWC,QAAAA;AAC3B,QAAM0C,kBAAkBvC,QACtB,OAAO;IACLgC;IACApB;IACAC;IACA,GAAGyB;EACL,IACA;IAACN;IAAOM;IAAS1B;IAAaC;GAAe;AAE/C,QAAM2B,aAAaC,cAAcF,iBAAiB;IAACA;GAAgB;AACnE,QAAMG,iBAAiBC,kBAAkBH,UAAAA;AACzC,QAAMI,WAAWC,WAAW;IAC1BZ,QAAQR,kBAAkBqB,WAAWb;IACrCE;IACAC;IACAM;IACAF;IACAtB;IACAC;IACAC;IACAC;IACAC;IACAC;EACF,CAAA;AACA,SACE,sBAAA,cAACwB,OAAAA;IAAIC,WAAWC,GAAGzB,UAAAA;IAAc,GAAGE;IAAOI;KACxCc,QAAAA;AAGP;AAEA,IAAMM,cAAcC,2BAAWxC,eAAAA;AAMxB,IAAMyC,UAAU;EACrBC,MAAMH;AACR;",
6
+ "names": ["useComposedRefs", "useMasonry", "usePositioner", "useResizeObserver", "React", "forwardRef", "useMemo", "useRef", "useScroller", "useSize", "usePx", "mx", "usePxProps", "remProps", "remInPx", "usePx", "useMemo", "Object", "fromEntries", "entries", "filter", "_", "value", "Number", "isFinite", "map", "key", "MasonryRootImpl", "columnCount", "maxColumnCount", "columnWidth", "maxColumnWidth", "columnGutter", "rowGutter", "items", "itemHeightEstimate", "itemKey", "overscanBy", "render", "onRender", "classNames", "intrinsicHeight", "props", "forwardedRef", "rootRef", "useRef", "ref", "useComposedRefs", "width", "height", "useSize", "scrollTop", "isScrolling", "useScroller", "pxProps", "positionerProps", "positioner", "usePositioner", "resizeObserver", "useResizeObserver", "children", "useMasonry", "Infinity", "div", "className", "mx", "MasonryRoot", "forwardRef", "Masonry", "Root"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/Masonry.tsx":{"bytes":9891,"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"masonic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":454,"imports":[{"path":"src/Masonry.tsx","kind":"import-statement","original":"./Masonry"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5570},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"masonic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["Masonry"],"entryPoint":"src/index.ts","inputs":{"src/Masonry.tsx":{"bytesInOutput":2121},"src/index.ts":{"bytesInOutput":0}},"bytes":2290}}}
@@ -0,0 +1,13 @@
1
+ import { type UseMasonryOptions, type UsePositionerOptions } from 'masonic';
2
+ import { type ComponentPropsWithRef, type JSX, type Ref } from 'react';
3
+ import { type ThemedClassName } from '@dxos/react-ui';
4
+ type MasonryRootProps<Item> = ThemedClassName<ComponentPropsWithRef<'div'>> & Omit<UsePositionerOptions, 'width'> & Omit<UseMasonryOptions<Item>, 'height' | 'scrollTop' | 'isScrolling' | 'resizeObserver' | 'positioner' | 'as' | 'id' | 'itemAs' | 'itemStyle' | 'className' | 'style' | 'role' | 'tabIndex' | 'containerRef'> & {
5
+ intrinsicHeight?: boolean;
6
+ };
7
+ export declare const Masonry: {
8
+ Root: <Item>(props: MasonryRootProps<Item> & {
9
+ ref?: Ref<HTMLDivElement | null>;
10
+ }) => JSX.Element;
11
+ };
12
+ export type { MasonryRootProps };
13
+ //# sourceMappingURL=Masonry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Masonry.d.ts","sourceRoot":"","sources":["../../../src/Masonry.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAI1B,MAAM,SAAS,CAAC;AACjB,OAAc,EACZ,KAAK,qBAAqB,EAE1B,KAAK,GAAG,EACR,KAAK,GAAG,EAIT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,gBAAgB,CAAC;AAG7D,KAAK,gBAAgB,CAAC,IAAI,IAAI,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GACzE,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,GACnC,IAAI,CACF,iBAAiB,CAAC,IAAI,CAAC,EACrB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,WAAW,GACX,OAAO,GACP,MAAM,GACN,UAAU,GACV,cAAc,CACjB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAiFpC,eAAO,MAAM,OAAO;WANgC,IAAI,SAC/C,gBAAgB,CAAC,IAAI,CAAC,GAAG;QAC9B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;KAClC,KACE,GAAG,CAAC,OAAO;CAIf,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ decorators: import("@storybook/react").Decorator[];
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
12
+ //# sourceMappingURL=Masonry.stories.d.ts.map
@@ -0,0 +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;AAwCjE,QAAA,MAAM,IAAI;;;;;;CAiBsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Masonry';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}