@box/metadata-view 0.25.5 → 0.26.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.
@@ -1,31 +1,33 @@
1
1
  import { GridList as t } from "@box/blueprint-web";
2
- import { ItemTypeIcon as a } from "@box/item-icon";
3
- import { useIntl as l } from "react-intl";
4
- import { V as d } from "../../../../chunks/types.js";
5
- import { THUMBNAIL_GRID_VIEW_SIZES as c } from "../constants.js";
6
- import _ from "./messages.js";
7
- import { jsx as e, jsxs as I } from "react/jsx-runtime";
8
- import { ItemActionMenu as T } from "../item-action-menu/item-action-menu.js";
9
- import '../../../../styles/metadata-grid.css';const p = "_itemThumbnail_1j3e6_1", u = {
10
- itemThumbnail: p
11
- }, E = 188, f = 250, M = 8, h = 5, A = (m) => E + f * (M - m) / h, C = ({
2
+ import { ItemTypeIcon as l } from "@box/item-icon";
3
+ import { useIntl as d } from "react-intl";
4
+ import { V as c } from "../../../../chunks/types.js";
5
+ import { THUMBNAIL_GRID_VIEW_SIZES as _ } from "../constants.js";
6
+ import I from "./messages.js";
7
+ import { jsx as e, jsxs as T } from "react/jsx-runtime";
8
+ import { ItemActionMenu as p } from "../item-action-menu/item-action-menu.js";
9
+ import '../../../../styles/metadata-grid.css';const u = "_itemThumbnail_1j3e6_1", E = {
10
+ itemThumbnail: u
11
+ }, f = 188, M = 250, h = 8, A = 5, G = (m) => f + M * (h - m) / A, H = ({
12
12
  items: m,
13
13
  itemActionMenuProps: o,
14
- zoomLevel: r
14
+ zoomLevel: r,
15
+ ...n
15
16
  }) => {
16
17
  const {
17
- formatMessage: n
18
- } = l();
18
+ formatMessage: s
19
+ } = d();
19
20
  return /* @__PURE__ */ e(t, {
20
- "aria-label": n(_.gridView),
21
+ "aria-label": s(I.gridView),
21
22
  selectionMode: "multiple",
22
23
  style: {
23
- gridTemplateColumns: `repeat(auto-fit, minmax(${A(c[r])}px, 1fr))`
24
+ gridTemplateColumns: `repeat(auto-fit, minmax(${G(_[r])}px, 1fr))`
24
25
  },
25
- children: m.map((i, G) => /* @__PURE__ */ I(t.Item, {
26
+ ...n,
27
+ children: m.map((i, R) => /* @__PURE__ */ T(t.Item, {
26
28
  children: [/* @__PURE__ */ e(t.Thumbnail, {
27
- className: u.itemThumbnail,
28
- children: /* @__PURE__ */ e(a, {
29
+ className: E.itemThumbnail,
30
+ children: /* @__PURE__ */ e(l, {
29
31
  dimension: 128,
30
32
  item: i
31
33
  })
@@ -34,17 +36,17 @@ import '../../../../styles/metadata-grid.css';const p = "_itemThumbnail_1j3e6_1"
34
36
  }), /* @__PURE__ */ e(t.Subtitle, {
35
37
  children: i.createdAt
36
38
  }), o ? /* @__PURE__ */ e(t.Actions, {
37
- children: (s) => /* @__PURE__ */ e(T, {
39
+ children: (a) => /* @__PURE__ */ e(p, {
38
40
  ...o,
39
41
  item: i,
40
- onOpenChange: s,
41
- viewMode: d.GRID
42
+ onOpenChange: a,
43
+ viewMode: c.GRID
42
44
  })
43
45
  }) : null]
44
46
  }, i.id))
45
47
  });
46
48
  };
47
49
  export {
48
- C as MetadataGrid,
49
- C as default
50
+ H as MetadataGrid,
51
+ H as default
50
52
  };
@@ -1,6 +1,7 @@
1
+ import { GridListProps } from '@box/blueprint-web';
1
2
  import { MetadataProps } from '../../types';
2
- export interface MetadataGridProps extends MetadataProps {
3
+ export interface MetadataGridProps extends MetadataProps, Omit<GridListProps, 'items'> {
3
4
  zoomLevel?: number;
4
5
  }
5
- export declare const MetadataGrid: ({ items, itemActionMenuProps, zoomLevel }: MetadataGridProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const MetadataGrid: ({ items, itemActionMenuProps, zoomLevel, ...rest }: MetadataGridProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export default MetadataGrid;
@@ -4,6 +4,7 @@ import { ActionBarProps } from '../components/action-bar/action-bar';
4
4
  import { SortDropdownProps } from '../components/action-bar/sort-dropdown';
5
5
  import { FilterRowProps } from '../components/filter-row/filter-row';
6
6
  import { FilterGroup, FilterOption } from '../components/filter-row/types';
7
+ import { ItemActionMenuProps } from '../components/item-action-menu/item-action-menu';
7
8
  import { MetadataTableProps } from '../components/metadata-table';
8
9
  import { PaginationProps } from '../components/pagination/pagination';
9
10
  import { MetadataViewProps } from '../metadata-view';
@@ -87,6 +88,7 @@ export declare const mockPaginationPropsMarkerWithNextAndPrevMarkers: {
87
88
  export declare const mockFilterRowArgs: FilterRowProps;
88
89
  export declare const mockActionBarProps: ActionBarProps;
89
90
  export declare const mockTableProps: MetadataTableProps;
91
+ export declare const mockItemActionMenuProps: ItemActionMenuProps;
90
92
  export declare const mockMetadataViewProps: MetadataViewProps;
91
93
  export type SortArgs = {
92
94
  column: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.25.5",
3
+ "version": "0.26.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^11.12.0",