@box/box-item-type-selector 1.14.4 → 1.17.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.
@@ -2,16 +2,16 @@ import { FileBoxNote as s, FileCanvas as p, FilePdf as l, FileDocs as d, FileSpr
2
2
  import { Folder as h, FileDefault as F } from "@box/blueprint-web-assets/icons/Fill";
3
3
  import o from "../esm/lib/messages.js";
4
4
  import { jsx as t } from "react/jsx-runtime";
5
- let r = /* @__PURE__ */ function(e) {
5
+ let r = /* @__PURE__ */ (function(e) {
6
6
  return e.Folders = "folderType", e.Files = "fileType", e;
7
- }({});
7
+ })({});
8
8
  const a = {
9
9
  Folders: o.folderType,
10
10
  Files: o.fileType
11
11
  };
12
- let i = /* @__PURE__ */ function(e) {
12
+ let i = /* @__PURE__ */ (function(e) {
13
13
  return e.Document = "documentType", e.PDF = "pdfType", e.Presentation = "presentationType", e.Spreadsheet = "spreadsheetType", e.Image = "imageType", e.Audio = "audioType", e.Video = "videoType", e.Drawing = "drawingType", e.ThreeD = "threedType", e.BoxNote = "boxnoteType", e.BoxCanvas = "boxcanvasType", e;
14
- }({});
14
+ })({});
15
15
  const n = {
16
16
  Document: o.documentType,
17
17
  PDF: o.pdfType,
@@ -1,19 +1,20 @@
1
- import { BoxItemTypeSelector as k } from "./box-item-type-selector.js";
2
- import { Popover as n, FilterChip as p, Button as y } from "@box/blueprint-web";
3
- import { FileDefault as x } from "@box/blueprint-web-assets/icons/Line";
4
- import I from "clsx";
5
- import g from "react";
6
- import { useIntl as M } from "react-intl";
7
- import { b as F } from "../../chunks/constants.js";
1
+ import { BoxItemTypeSelector as I } from "./box-item-type-selector.js";
2
+ import { useBlueprintModernization as x, Popover as i, FilterChip as p, Button as y } from "@box/blueprint-web";
3
+ import { FileDefault as _ } from "@box/blueprint-web-assets/icons/Line";
4
+ import { File as Q } from "@box/blueprint-web-assets/icons/Medium";
5
+ import L from "clsx";
6
+ import F from "react";
7
+ import { useIntl as j } from "react-intl";
8
+ import { b as g } from "../../chunks/constants.js";
8
9
  import m from "./messages.js";
9
10
  import { jsx as r, jsxs as u } from "react/jsx-runtime";
10
- import '../../styles/box-item-type-selector-quick-filter.css';const _ = "_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1", Q = "_popoverMainContent_10sjf_4", L = "_boxItemTypeSelectorQuickFilter_10sjf_8", j = "_popoverFooterInline_10sjf_11", a = {
11
- itemTypeSelectorQuickFilterPopoverContainer: _,
12
- popoverMainContent: Q,
13
- boxItemTypeSelectorQuickFilter: L,
14
- popoverFooterInline: j
15
- }, N = () => F.reduce((t, l) => t + (l.children ? l.children.length : 1), 0), P = (t) => F.map((o) => o.children ? o.children.every((e) => t.includes(e.value)) ? o.title : o.children.filter((e) => t.includes(e.value)).map((e) => e.title) : t.includes(o.value) ? o.title : []).flat(), B = (t, l) => t.length !== l.length ? !1 : t.every((o) => l.includes(o)), A = N();
16
- function J(t) {
11
+ import '../../styles/box-item-type-selector-quick-filter.css';const N = "_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1", P = "_popoverMainContent_10sjf_4", B = "_boxItemTypeSelectorQuickFilter_10sjf_8", z = "_popoverFooterInline_10sjf_11", a = {
12
+ itemTypeSelectorQuickFilterPopoverContainer: N,
13
+ popoverMainContent: P,
14
+ boxItemTypeSelectorQuickFilter: B,
15
+ popoverFooterInline: z
16
+ }, A = () => g.reduce((t, l) => t + (l.children ? l.children.length : 1), 0), D = (t) => g.map((o) => o.children ? o.children.every((e) => t.includes(e.value)) ? o.title : o.children.filter((e) => t.includes(e.value)).map((e) => e.title) : t.includes(o.value) ? o.title : []).flat(), w = (t, l) => t.length !== l.length ? !1 : t.every((o) => l.includes(o)), R = A();
17
+ function X(t) {
17
18
  const {
18
19
  allowAllOptionsSelect: l = !1,
19
20
  applyButtonType: o = "button",
@@ -22,62 +23,64 @@ function J(t) {
22
23
  onApply: C,
23
24
  onFocus: v,
24
25
  className: b
25
- } = t, i = M(), [c, s] = g.useState(e);
26
- g.useEffect(() => {
27
- s(e);
26
+ } = t, n = j(), [s, c] = F.useState(e), {
27
+ enableModernizedComponents: T
28
+ } = x();
29
+ F.useEffect(() => {
30
+ c(e);
28
31
  }, [e]);
29
- const T = () => {
30
- const d = P(e), f = d.length;
31
- return f ? f === 1 ? i.formatMessage(d[0]) : i.formatMessage(m.multipleFiles, {
32
+ const S = () => {
33
+ const d = D(e), f = d.length;
34
+ return f ? f === 1 ? n.formatMessage(d[0]) : n.formatMessage(m.multipleFiles, {
32
35
  count: f - 1,
33
- fileType: i.formatMessage(d[0])
34
- }) : i.formatMessage(m.fileTypeLabelDropdown);
35
- }, S = () => {
36
- !l && c.length === A ? (s([]), C([])) : C(c);
37
- };
36
+ fileType: n.formatMessage(d[0])
37
+ }) : n.formatMessage(m.fileTypeLabelDropdown);
38
+ }, M = () => {
39
+ !l && s.length === R ? (c([]), C([])) : C(s);
40
+ }, k = T ? Q : _;
38
41
  return /* @__PURE__ */ r("div", {
39
- className: I(b, a.boxItemTypeSelectorQuickFilterContainer),
40
- children: /* @__PURE__ */ u(n.Root, {
42
+ className: L(b, a.boxItemTypeSelectorQuickFilterContainer),
43
+ children: /* @__PURE__ */ u(i.Root, {
41
44
  modal: !1,
42
- children: [/* @__PURE__ */ r(n.Trigger, {
45
+ children: [/* @__PURE__ */ r(i.Trigger, {
43
46
  children: /* @__PURE__ */ u(p.TriggerChip, {
44
47
  autoFocus: h,
45
- onClick: () => s(e),
48
+ onClick: () => c(e),
46
49
  onFocus: v,
47
50
  selected: !!e.length,
48
51
  value: "trigger-chip",
49
52
  children: [/* @__PURE__ */ r(p.Icon, {
50
- icon: x
53
+ icon: k
51
54
  }), /* @__PURE__ */ r(p.Label, {
52
- children: T()
55
+ children: S()
53
56
  }), /* @__PURE__ */ r(p.DropdownIndicator, {})]
54
57
  })
55
- }), /* @__PURE__ */ u(n.ContentContainer, {
58
+ }), /* @__PURE__ */ u(i.ContentContainer, {
56
59
  align: "start",
57
60
  className: a.itemTypeSelectorQuickFilterPopoverContainer,
58
- children: [/* @__PURE__ */ r(n.MainContent, {
61
+ children: [/* @__PURE__ */ r(i.MainContent, {
59
62
  className: a.popoverMainContent,
60
- children: /* @__PURE__ */ r(k, {
63
+ children: /* @__PURE__ */ r(I, {
61
64
  className: a.boxItemTypeSelectorQuickFilter,
62
- onSelectionChange: s,
63
- selected: c
65
+ onSelectionChange: c,
66
+ selected: s
64
67
  })
65
- }), /* @__PURE__ */ u(n.Footer, {
68
+ }), /* @__PURE__ */ u(i.Footer, {
66
69
  className: a.popoverFooterInline,
67
70
  children: [/* @__PURE__ */ r(y, {
68
- disabled: !c.length,
69
- onClick: () => s([]),
71
+ disabled: !s.length,
72
+ onClick: () => c([]),
70
73
  size: "small",
71
74
  variant: "secondary",
72
- children: i.formatMessage(m.clear)
73
- }), /* @__PURE__ */ r(n.Close, {
75
+ children: n.formatMessage(m.clear)
76
+ }), /* @__PURE__ */ r(i.Close, {
74
77
  children: /* @__PURE__ */ r(y, {
75
- disabled: B(c, e),
76
- onClick: S,
78
+ disabled: w(s, e),
79
+ onClick: M,
77
80
  size: "small",
78
81
  type: o,
79
82
  variant: "primary",
80
- children: i.formatMessage(m.apply)
83
+ children: n.formatMessage(m.apply)
81
84
  })
82
85
  })]
83
86
  })]
@@ -86,6 +89,6 @@ function J(t) {
86
89
  });
87
90
  }
88
91
  export {
89
- J as BoxItemTypeSelectorQuickFilter,
90
- J as default
92
+ X as BoxItemTypeSelectorQuickFilter,
93
+ X as default
91
94
  };
@@ -1,19 +1,19 @@
1
1
  export default {
2
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType": "⟦萬 Äúďίõ 國⟧",
3
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType": "⟦萬萬 βòх Ćǻńνāŝ 國國⟧",
4
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType": "⟦萬萬 βо× Ňóŧë 國國⟧",
5
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType": "⟦萬萬 Ðóċûmέήŧ 國國⟧",
6
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType": "⟦萬萬 Ďгάẃїпġ 國國⟧",
7
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType": "⟦萬 Ìmǻġē 國⟧",
2
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType": "⟦萬 Āūďϊö 國⟧",
3
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType": "⟦萬萬 Бō× Ĉăлνāş 國國⟧",
4
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType": "⟦萬萬 Βо× Νõŧé 國國⟧",
5
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType": "⟦萬萬 Ďôčűmëņτ 國國⟧",
6
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType": "⟦萬萬 Ďŕâώìņĝ 國國⟧",
7
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType": "⟦萬 Îmåĝé 國⟧",
8
8
  "groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles": "⟦萬萬萬 {fileType} +{count} 國國國⟧",
9
9
  "groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType": "⟦ PĎ₣ ⟧",
10
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType": "⟦萬萬萬 Pŕèśèпţάτîöп 國國國⟧",
11
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType": "⟦萬萬萬 ŜΡгеăďŝĥĕēť 國國國⟧",
12
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType": "⟦ 3Ď ⟧",
13
- "groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType": "⟦萬 Vĭďеø 國⟧",
14
- "groupSharedFeatures.boxItemTypeSelector.itemType.fileType": "⟦萬 ₣ĭļēѕ 國⟧",
15
- "groupSharedFeatures.boxItemTypeSelector.itemType.folderType": "⟦萬萬 ₣ŏĺďęяŝ 國國⟧",
16
- "groupSharedFeatures.boxItemTypeSelector.quickFilter.apply": "⟦萬 ÄΡΡĺγ 國⟧",
17
- "groupSharedFeatures.boxItemTypeSelector.quickFilter.clear": "⟦萬 Çĺėάг 國⟧",
18
- "groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown": "⟦萬萬 ₣íĺε ŤγΡĕ 國國⟧"
10
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType": "⟦萬萬萬 Pŕĕşěŋτáŧίőл 國國國⟧",
11
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType": "⟦萬萬萬 ЅΡřεąďśĥεëτ 國國國⟧",
12
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType": "⟦ 3Ð ⟧",
13
+ "groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType": "⟦萬 Vіďěό 國⟧",
14
+ "groupSharedFeatures.boxItemTypeSelector.itemType.fileType": "⟦萬 ₣îľέś 國⟧",
15
+ "groupSharedFeatures.boxItemTypeSelector.itemType.folderType": "⟦萬萬 ₣ôĺďέгѕ 國國⟧",
16
+ "groupSharedFeatures.boxItemTypeSelector.quickFilter.apply": "⟦萬 ǺΡΡľγ 國⟧",
17
+ "groupSharedFeatures.boxItemTypeSelector.quickFilter.clear": "⟦萬 Čľєäŕ 國⟧",
18
+ "groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown": "⟦萬萬 ₣їľę ŤÿΡé 國國⟧"
19
19
  }
@@ -1,34 +1,34 @@
1
1
  # Label for the audio file type
2
- groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType = ⟦萬 Äúďίõ 國⟧
2
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType = ⟦萬 Āūďϊö 國⟧
3
3
  # Label for the Box Canvas file type
4
- groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType = ⟦萬萬 βòх Ćǻńνāŝ 國國⟧
4
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType = ⟦萬萬 Бō× Ĉăлνāş 國國⟧
5
5
  # Label for the Box Note file type
6
- groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType = ⟦萬萬 βо× Ňóŧë 國國⟧
6
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType = ⟦萬萬 Βо× Νõŧé 國國⟧
7
7
  # Label for the document file type
8
- groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType = ⟦萬萬 Ðóċûmέήŧ 國國⟧
8
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType = ⟦萬萬 Ďôčűmëņτ 國國⟧
9
9
  # Label for the drawing file type
10
- groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType = ⟦萬萬 Ďгάẃїпġ 國國⟧
10
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType = ⟦萬萬 Ďŕâώìņĝ 國國⟧
11
11
  # Label for the image file type
12
- groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType = ⟦萬 Ìmǻġē 國⟧
12
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType = ⟦萬 Îmåĝé 國⟧
13
13
  # Label for multiple file types
14
14
  groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles = ⟦萬萬萬 {fileType} +{count} 國國國⟧
15
15
  # Label for the PDF file type
16
16
  groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType = ⟦ PĎ₣ ⟧
17
17
  # Label for the presentation file type
18
- groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType = ⟦萬萬萬 Pŕèśèпţάτîöп 國國國⟧
18
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType = ⟦萬萬萬 Pŕĕşěŋτáŧίőл 國國國⟧
19
19
  # Label for the spreadsheet file type
20
- groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType = ⟦萬萬萬 ŜΡгеăďŝĥĕēť 國國國⟧
20
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType = ⟦萬萬萬 ЅΡřεąďśĥεëτ 國國國⟧
21
21
  # Label for the 3D file type
22
- groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType = ⟦ 3Ď
22
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType = ⟦ 3Ð
23
23
  # Label for the video file type
24
- groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType = ⟦萬 Vĭďеø 國⟧
24
+ groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType = ⟦萬 Vіďěό 國⟧
25
25
  # Label for the checkbox item type selector representing files
26
- groupSharedFeatures.boxItemTypeSelector.itemType.fileType = ⟦萬 ₣ĭļēѕ 國⟧
26
+ groupSharedFeatures.boxItemTypeSelector.itemType.fileType = ⟦萬 ₣îľέś 國⟧
27
27
  # Label for the checkbox item type selector representing folders
28
- groupSharedFeatures.boxItemTypeSelector.itemType.folderType = ⟦萬萬 ₣ŏĺďęяŝ 國國⟧
28
+ groupSharedFeatures.boxItemTypeSelector.itemType.folderType = ⟦萬萬 ₣ôĺďέгѕ 國國⟧
29
29
  # Label for the button in the selector to apply the selected filters
30
- groupSharedFeatures.boxItemTypeSelector.quickFilter.apply = ⟦萬 ÄΡΡĺγ 國⟧
30
+ groupSharedFeatures.boxItemTypeSelector.quickFilter.apply = ⟦萬 ǺΡΡľγ 國⟧
31
31
  # Label for the button in the selector to clear all the selected filters
32
- groupSharedFeatures.boxItemTypeSelector.quickFilter.clear = ⟦萬 Çĺėάг 國⟧
32
+ groupSharedFeatures.boxItemTypeSelector.quickFilter.clear = ⟦萬 Čľєäŕ 國⟧
33
33
  # Label for the dropdown chip when no specific selection has been made
34
- groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown = ⟦萬萬 ₣íĺε ŤγΡĕ 國國⟧
34
+ groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown = ⟦萬萬 ₣їľę ŤÿΡé 國國⟧
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@box/box-item-type-selector",
3
- "version": "1.14.4",
3
+ "version": "1.17.0",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^7.8.0",
6
- "@box/blueprint-web-assets": "^4.16.0",
5
+ "@box/blueprint-web": "^12.104.1",
6
+ "@box/blueprint-web-assets": "^4.87.0",
7
7
  "react": "^17.0.0 || ^18.0.0",
8
8
  "react-dom": "^17.0.0 || ^18.0.0",
9
9
  "react-intl": "6.4.2"
10
10
  },
11
11
  "devDependencies": {
12
- "@box/blueprint-web": "^12.103.2",
13
- "@box/blueprint-web-assets": "^4.86.0",
14
- "@box/storybook-utils": "^0.14.23",
12
+ "@box/blueprint-web": "^12.104.1",
13
+ "@box/blueprint-web-assets": "^4.87.0",
14
+ "@box/storybook-utils": "^0.14.27",
15
15
  "react": "^18.3.0",
16
16
  "react-dom": "^18.3.0",
17
17
  "react-intl": "6.4.2"