@box/metadata-view 0.32.4 → 0.33.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,52 +1,61 @@
1
- import { GridList as t } from "@box/blueprint-web";
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 = ({
1
+ import { GridList as i } from "@box/blueprint-web";
2
+ import { ItemTypeIcon as h } from "@box/item-icon";
3
+ import { useIntl as T } from "react-intl";
4
+ import { V as p } from "../../../../chunks/types.js";
5
+ import { THUMBNAIL_GRID_VIEW_SIZES as E } from "../constants.js";
6
+ import b from "./messages.js";
7
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
8
+ import { ItemActionMenu as M } from "../item-action-menu/item-action-menu.js";
9
+ import '../../../../styles/metadata-grid.css';const R = "_itemThumbnail_93ess_1", L = {
10
+ itemThumbnail: R
11
+ }, A = 188, G = 250, g = 8, x = 5, U = (m) => A + G * (g - m) / x, N = ({
12
12
  items: m,
13
- itemActionMenuProps: o,
14
- zoomLevel: r,
15
- ...n
13
+ itemActionMenuProps: n,
14
+ zoomLevel: c,
15
+ ...d
16
16
  }) => {
17
17
  const {
18
- formatMessage: s
19
- } = d();
20
- return /* @__PURE__ */ e(t, {
21
- "aria-label": s(I.gridView),
18
+ formatMessage: u
19
+ } = T();
20
+ return /* @__PURE__ */ e(i, {
21
+ "aria-label": u(b.gridView),
22
22
  selectionMode: "multiple",
23
23
  style: {
24
- gridTemplateColumns: `repeat(auto-fit, minmax(${G(_[r])}px, 1fr))`
24
+ gridTemplateColumns: `repeat(auto-fit, minmax(${U(E[c])}px, 1fr))`
25
25
  },
26
- ...n,
27
- children: m.map((i, R) => /* @__PURE__ */ T(t.Item, {
28
- children: [/* @__PURE__ */ e(t.Thumbnail, {
29
- className: E.itemThumbnail,
30
- children: /* @__PURE__ */ e(l, {
31
- dimension: 128,
32
- item: i
33
- })
34
- }), /* @__PURE__ */ e(t.Header, {
35
- children: i.name
36
- }), /* @__PURE__ */ e(t.Subtitle, {
37
- children: i.createdAt
38
- }), o ? /* @__PURE__ */ e(t.Actions, {
39
- children: (a) => /* @__PURE__ */ e(p, {
40
- ...o,
41
- item: i,
42
- onOpenChange: a,
43
- viewMode: c.GRID
44
- })
45
- }) : null]
46
- }, i.id))
26
+ ...d,
27
+ children: m.map((t, D) => {
28
+ var o, l, a;
29
+ const {
30
+ name: r,
31
+ createdAt: _
32
+ } = t, s = "thumbnailURLs" in t ? ((o = t.thumbnailURLs) == null ? void 0 : o.large) || ((l = t.thumbnailURLs) == null ? void 0 : l.medium) || ((a = t.thumbnailURLs) == null ? void 0 : a.small) : void 0;
33
+ return /* @__PURE__ */ f(i.Item, {
34
+ children: [/* @__PURE__ */ e(i.Thumbnail, {
35
+ className: L.itemThumbnail,
36
+ children: s ? /* @__PURE__ */ e("img", {
37
+ alt: r,
38
+ src: s
39
+ }) : /* @__PURE__ */ e(h, {
40
+ item: t
41
+ })
42
+ }), /* @__PURE__ */ e(i.Header, {
43
+ children: r
44
+ }), /* @__PURE__ */ e(i.Subtitle, {
45
+ children: _
46
+ }), n ? /* @__PURE__ */ e(i.Actions, {
47
+ children: (I) => /* @__PURE__ */ e(M, {
48
+ ...n,
49
+ item: t,
50
+ onOpenChange: I,
51
+ viewMode: p.GRID
52
+ })
53
+ }) : null]
54
+ }, t.id);
55
+ })
47
56
  });
48
57
  };
49
58
  export {
50
- H as MetadataGrid,
51
- H as default
59
+ N as MetadataGrid,
60
+ N as default
52
61
  };
@@ -1 +1 @@
1
- ._itemThumbnail_1j3e6_1{display:flex;align-items:center;justify-content:center}
1
+ ._itemThumbnail_93ess_1{display:flex;align-items:center;justify-content:center}._itemThumbnail_93ess_1 svg{width:65%;height:65%}
@@ -21,6 +21,7 @@ export declare const mockFilterGroupsWithoutAlias: FilterGroup[];
21
21
  export declare const mockFilterOptionsWithInvalidType: FilterOption[];
22
22
  export declare const mockFilterOptionsWithSomeChipsHidden: FilterOption[];
23
23
  export declare const mockMetadata: Item[];
24
+ export declare const mockMetadataWithThumbnail: Item[];
24
25
  export declare const mockSortableColumnNames: string[];
25
26
  export declare const mockSortDropdownProps: SortDropdownProps;
26
27
  export declare const mockFilterGroups: FilterGroup[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.32.4",
3
+ "version": "0.33.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^11.12.0",