@box/box-item-type-selector 1.39.32 → 1.39.34

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.
@@ -0,0 +1,77 @@
1
+ import { t as e } from "./box-item-type-selector.js";
2
+ import t from "../esm/lib/messages.js";
3
+ import { n } from "./constants.js";
4
+ import { Button as r, FilterChip as i, Popover as a, useBlueprintModernization as o } from "@box/blueprint-web";
5
+ import s from "clsx";
6
+ import c from "react";
7
+ import { useIntl as l } from "react-intl";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { FileDefault as f } from "@box/blueprint-web-assets/icons/Line";
10
+ import { File as p } from "@box/blueprint-web-assets/icons/Medium";
11
+ import '../styles/box-item-type-selector-quick-filter.css';var m = {
12
+ itemTypeSelectorQuickFilterPopoverContainer: "_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1",
13
+ popoverMainContent: "_popoverMainContent_10sjf_4",
14
+ boxItemTypeSelectorQuickFilter: "_boxItemTypeSelectorQuickFilter_10sjf_8",
15
+ popoverFooterInline: "_popoverFooterInline_10sjf_11"
16
+ }, h = () => n.reduce((e, t) => e + (t.children ? t.children.length : 1), 0), g = (e) => n.map((t) => t.children ? t.children.every((t) => e.includes(t.value)) ? t.title : t.children.filter((t) => e.includes(t.value)).map((e) => e.title) : e.includes(t.value) ? t.title : []).flat(), _ = (e, t) => e.length === t.length ? e.every((e) => t.includes(e)) : !1, v = h();
17
+ function y(n) {
18
+ let { allowAllOptionsSelect: h = !1, applyButtonType: y = "button", autoFocus: b, selected: x, onApply: S, onFocus: C, className: w } = n, T = l(), [E, D] = c.useState(x), { enableModernizedComponents: O } = o();
19
+ c.useEffect(() => {
20
+ D(x);
21
+ }, [x]);
22
+ let k = () => {
23
+ let e = g(x), n = e.length;
24
+ return n ? n === 1 ? T.formatMessage(e[0]) : T.formatMessage(t.multipleFiles, {
25
+ count: n - 1,
26
+ fileType: T.formatMessage(e[0])
27
+ }) : T.formatMessage(t.fileTypeLabelDropdown);
28
+ }, A = () => {
29
+ !h && E.length === v ? (D([]), S([])) : S(E);
30
+ }, j = O ? p : f;
31
+ return /* @__PURE__ */ u("div", {
32
+ className: s(w, m.boxItemTypeSelectorQuickFilterContainer),
33
+ children: /* @__PURE__ */ d(a.Root, {
34
+ modal: !1,
35
+ children: [/* @__PURE__ */ u(a.Trigger, { children: /* @__PURE__ */ d(i.TriggerChip, {
36
+ autoFocus: b,
37
+ onClick: () => D(x),
38
+ onFocus: C,
39
+ selected: !!x.length,
40
+ value: "trigger-chip",
41
+ children: [
42
+ /* @__PURE__ */ u(i.Icon, { icon: j }),
43
+ /* @__PURE__ */ u(i.Label, { children: k() }),
44
+ /* @__PURE__ */ u(i.DropdownIndicator, {})
45
+ ]
46
+ }) }), /* @__PURE__ */ d(a.ContentContainer, {
47
+ align: "start",
48
+ className: m.itemTypeSelectorQuickFilterPopoverContainer,
49
+ children: [/* @__PURE__ */ u(a.MainContent, {
50
+ className: m.popoverMainContent,
51
+ children: /* @__PURE__ */ u(e, {
52
+ className: m.boxItemTypeSelectorQuickFilter,
53
+ onSelectionChange: D,
54
+ selected: E
55
+ })
56
+ }), /* @__PURE__ */ d(a.Footer, {
57
+ className: m.popoverFooterInline,
58
+ children: [/* @__PURE__ */ u(r, {
59
+ disabled: !E.length,
60
+ onClick: () => D([]),
61
+ size: "small",
62
+ variant: "secondary",
63
+ children: T.formatMessage(t.clear)
64
+ }), /* @__PURE__ */ u(a.Close, { children: /* @__PURE__ */ u(r, {
65
+ disabled: _(E, x),
66
+ onClick: A,
67
+ size: "small",
68
+ type: y,
69
+ variant: "primary",
70
+ children: T.formatMessage(t.apply)
71
+ }) })]
72
+ })]
73
+ })]
74
+ })
75
+ });
76
+ }
77
+ export { y as t };
@@ -0,0 +1,66 @@
1
+ import { n as e, t } from "./constants.js";
2
+ import { Checkbox as n, Text as r } from "@box/blueprint-web";
3
+ import i from "clsx";
4
+ import { forwardRef as a, useCallback as o } from "react";
5
+ import { useIntl as s } from "react-intl";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import '../styles/box-item-type-selector.css';var u = {
8
+ boxItemTypeSelectorContainer: "_boxItemTypeSelectorContainer_9ahmf_2",
9
+ parentItemTypeSelectorContainer: "_parentItemTypeSelectorContainer_9ahmf_6",
10
+ itemTypeSelector: "_itemTypeSelector_9ahmf_16",
11
+ selectorLabel: "_selectorLabel_9ahmf_22",
12
+ disabled: "_disabled_9ahmf_36",
13
+ childItemTypeSelectorContainer: "_childItemTypeSelectorContainer_9ahmf_39"
14
+ }, d = (e, t) => {
15
+ let n = [...t];
16
+ return e.forEach((e) => {
17
+ n.includes(e.value) || n.push(e.value);
18
+ }), n;
19
+ }, f = (e, t) => {
20
+ let n = [...t];
21
+ return e.forEach((e) => {
22
+ let t = n.indexOf(e.value);
23
+ t >= 0 && n.splice(t, 1);
24
+ }), n;
25
+ }, p = (e, t, n) => {
26
+ let r = [...n];
27
+ return e ? r.push(t) : r = r.filter((e) => e !== t), r;
28
+ }, m = /* @__PURE__ */ a((a, m) => {
29
+ let { className: h, onSelectionChange: g, selected: _, disabled: v = !1, ...y } = a, b = s(), x = (e) => e.children ? e.children.every((e) => _.includes(e.value)) ? !0 : e.children.every((e) => !_.includes(e.value)) ? !1 : t : _.includes(e.value), S = o((e, t) => {
30
+ let n = [..._];
31
+ n = t.children ? e ? d(t.children, n) : f(t.children, n) : p(e, t.value, n), g(n);
32
+ }, [g, _]), C = (e) => /* @__PURE__ */ l("span", {
33
+ className: i(u.selectorLabel, { [u.disabled]: v }),
34
+ children: [e.icon, /* @__PURE__ */ c(r, {
35
+ as: "span",
36
+ children: b.formatMessage(e.title)
37
+ })]
38
+ });
39
+ return /* @__PURE__ */ c("div", {
40
+ ref: m,
41
+ className: i(h, u.boxItemTypeSelectorContainer),
42
+ ...y,
43
+ children: /* @__PURE__ */ c("ul", { children: e.map((e) => /* @__PURE__ */ l("li", {
44
+ className: i(u.parentItemTypeSelectorContainer),
45
+ children: [/* @__PURE__ */ c(n.Item, {
46
+ checked: x(e),
47
+ className: i(u.itemTypeSelector),
48
+ disabled: v,
49
+ label: C(e),
50
+ onCheckedChange: (t) => S(t, e),
51
+ value: e.value
52
+ }, `box-item-type-selector-${e.value}`), e.children && /* @__PURE__ */ c("ul", {
53
+ className: i(u.childItemTypeSelectorContainer),
54
+ children: e.children.map((e) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(n.Item, {
55
+ checked: x(e),
56
+ className: i(u.itemTypeSelector),
57
+ disabled: v,
58
+ label: C(e),
59
+ onCheckedChange: (t) => S(t, e),
60
+ value: e.value
61
+ }) }, `box-item-type-selector-${e.value}`))
62
+ })]
63
+ }, `parent-item-type-selector-container-${e.value}`)) })
64
+ });
65
+ });
66
+ export { m as t };
@@ -1,115 +1,91 @@
1
- import { FileBoxNote as s, FileCanvas as p, FilePdf as l, FileDocs as d, FileSpreadsheet as T, FilePresentation as c, FileImage as y, FileAudio as m, FileVideo as v, FileVector as u, FileThreeD as D } from "@box/blueprint-web-assets/icons/Content";
2
- import { Folder as h, FileDefault as F } from "@box/blueprint-web-assets/icons/Fill";
3
- import o from "../esm/lib/messages.js";
4
- import { jsx as t } from "react/jsx-runtime";
5
- let r = /* @__PURE__ */ (function(e) {
6
- return e.Folders = "folderType", e.Files = "fileType", e;
7
- })({});
8
- const a = {
9
- Folders: o.folderType,
10
- Files: o.fileType
11
- };
12
- let i = /* @__PURE__ */ (function(e) {
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
- })({});
15
- const n = {
16
- Document: o.documentType,
17
- PDF: o.pdfType,
18
- Presentation: o.presentationType,
19
- Spreadsheet: o.spreadsheetType,
20
- Image: o.imageType,
21
- Audio: o.audioType,
22
- Video: o.videoType,
23
- Drawing: o.drawingType,
24
- ThreeD: o.threedType,
25
- BoxNote: o.boxnoteType,
26
- BoxCanvas: o.boxcanvasType
27
- }, x = "indeterminate", N = [{
28
- children: null,
29
- icon: /* @__PURE__ */ t(h, {
30
- role: "presentation"
31
- }),
32
- value: r.Folders,
33
- title: a.Folders
1
+ import e from "../esm/lib/messages.js";
2
+ import { FileAudio as t, FileBoxNote as n, FileCanvas as r, FileDocs as i, FileImage as a, FilePdf as o, FilePresentation as s, FileSpreadsheet as c, FileThreeD as l, FileVector as u, FileVideo as d } from "@box/blueprint-web-assets/icons/Content";
3
+ import { FileDefault as f, Folder as p } from "@box/blueprint-web-assets/icons/Fill";
4
+ import { jsx as m } from "react/jsx-runtime";
5
+ var h = /* @__PURE__ */ function(e) {
6
+ return e.Folders = "folderType", e.Files = "fileType", e;
7
+ }({}), g = {
8
+ Folders: e.folderType,
9
+ Files: e.fileType
10
+ }, _ = /* @__PURE__ */ function(e) {
11
+ 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;
12
+ }({}), v = {
13
+ Document: e.documentType,
14
+ PDF: e.pdfType,
15
+ Presentation: e.presentationType,
16
+ Spreadsheet: e.spreadsheetType,
17
+ Image: e.imageType,
18
+ Audio: e.audioType,
19
+ Video: e.videoType,
20
+ Drawing: e.drawingType,
21
+ ThreeD: e.threedType,
22
+ BoxNote: e.boxnoteType,
23
+ BoxCanvas: e.boxcanvasType
24
+ }, y = "indeterminate", b = [{
25
+ children: null,
26
+ icon: /* @__PURE__ */ m(p, { role: "presentation" }),
27
+ value: h.Folders,
28
+ title: g.Folders
34
29
  }, {
35
- children: [{
36
- icon: /* @__PURE__ */ t(s, {
37
- role: "presentation"
38
- }),
39
- value: i.BoxNote,
40
- title: n.BoxNote
41
- }, {
42
- icon: /* @__PURE__ */ t(p, {
43
- role: "presentation"
44
- }),
45
- value: i.BoxCanvas,
46
- title: n.BoxCanvas
47
- }, {
48
- icon: /* @__PURE__ */ t(l, {
49
- role: "presentation"
50
- }),
51
- value: i.PDF,
52
- title: n.PDF
53
- }, {
54
- icon: /* @__PURE__ */ t(d, {
55
- role: "presentation"
56
- }),
57
- value: i.Document,
58
- title: n.Document
59
- }, {
60
- icon: /* @__PURE__ */ t(T, {
61
- role: "presentation"
62
- }),
63
- value: i.Spreadsheet,
64
- title: n.Spreadsheet
65
- }, {
66
- icon: /* @__PURE__ */ t(c, {
67
- role: "presentation"
68
- }),
69
- value: i.Presentation,
70
- title: n.Presentation
71
- }, {
72
- icon: /* @__PURE__ */ t(y, {
73
- role: "presentation"
74
- }),
75
- value: i.Image,
76
- title: n.Image
77
- }, {
78
- icon: /* @__PURE__ */ t(m, {
79
- role: "presentation"
80
- }),
81
- value: i.Audio,
82
- title: n.Audio
83
- }, {
84
- icon: /* @__PURE__ */ t(v, {
85
- role: "presentation"
86
- }),
87
- value: i.Video,
88
- title: n.Video
89
- }, {
90
- icon: /* @__PURE__ */ t(u, {
91
- role: "presentation"
92
- }),
93
- value: i.Drawing,
94
- title: n.Drawing
95
- }, {
96
- icon: /* @__PURE__ */ t(D, {
97
- role: "presentation"
98
- }),
99
- value: i.ThreeD,
100
- title: n.ThreeD
101
- }],
102
- icon: /* @__PURE__ */ t(F, {
103
- role: "presentation"
104
- }),
105
- value: r.Files,
106
- title: a.Files
30
+ children: [
31
+ {
32
+ icon: /* @__PURE__ */ m(n, { role: "presentation" }),
33
+ value: _.BoxNote,
34
+ title: v.BoxNote
35
+ },
36
+ {
37
+ icon: /* @__PURE__ */ m(r, { role: "presentation" }),
38
+ value: _.BoxCanvas,
39
+ title: v.BoxCanvas
40
+ },
41
+ {
42
+ icon: /* @__PURE__ */ m(o, { role: "presentation" }),
43
+ value: _.PDF,
44
+ title: v.PDF
45
+ },
46
+ {
47
+ icon: /* @__PURE__ */ m(i, { role: "presentation" }),
48
+ value: _.Document,
49
+ title: v.Document
50
+ },
51
+ {
52
+ icon: /* @__PURE__ */ m(c, { role: "presentation" }),
53
+ value: _.Spreadsheet,
54
+ title: v.Spreadsheet
55
+ },
56
+ {
57
+ icon: /* @__PURE__ */ m(s, { role: "presentation" }),
58
+ value: _.Presentation,
59
+ title: v.Presentation
60
+ },
61
+ {
62
+ icon: /* @__PURE__ */ m(a, { role: "presentation" }),
63
+ value: _.Image,
64
+ title: v.Image
65
+ },
66
+ {
67
+ icon: /* @__PURE__ */ m(t, { role: "presentation" }),
68
+ value: _.Audio,
69
+ title: v.Audio
70
+ },
71
+ {
72
+ icon: /* @__PURE__ */ m(d, { role: "presentation" }),
73
+ value: _.Video,
74
+ title: v.Video
75
+ },
76
+ {
77
+ icon: /* @__PURE__ */ m(u, { role: "presentation" }),
78
+ value: _.Drawing,
79
+ title: v.Drawing
80
+ },
81
+ {
82
+ icon: /* @__PURE__ */ m(l, { role: "presentation" }),
83
+ value: _.ThreeD,
84
+ title: v.ThreeD
85
+ }
86
+ ],
87
+ icon: /* @__PURE__ */ m(f, { role: "presentation" }),
88
+ value: h.Files,
89
+ title: g.Files
107
90
  }];
108
- export {
109
- n as B,
110
- x as I,
111
- i as a,
112
- N as b,
113
- a as c,
114
- r as d
115
- };
91
+ export { g as a, _ as i, b as n, h as o, v as r, y as t };
package/dist/esm/index.js CHANGED
@@ -1,11 +1,4 @@
1
- import { BoxItemTypeSelector as t } from "./lib/box-item-type-selector.js";
2
- import { BoxItemTypeSelectorQuickFilter as a } from "./lib/box-item-type-selector-quick-filter.js";
3
- import { B as x, a as m, c as B, d as i } from "../chunks/constants.js";
4
- export {
5
- x as BoxFileTitle,
6
- m as BoxFileValue,
7
- t as BoxItemTypeSelector,
8
- a as BoxItemTypeSelectorQuickFilter,
9
- B as BoxParentItemTitle,
10
- i as BoxParentItemValue
11
- };
1
+ import { t as e } from "../chunks/box-item-type-selector.js";
2
+ import { a as t, i as n, o as r, r as i } from "../chunks/constants.js";
3
+ import { t as a } from "../chunks/box-item-type-selector-quick-filter.js";
4
+ export { i as BoxFileTitle, n as BoxFileValue, e as BoxItemTypeSelector, a as BoxItemTypeSelectorQuickFilter, t as BoxParentItemTitle, r as BoxParentItemValue };
@@ -1,94 +1,2 @@
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";
9
- import m from "./messages.js";
10
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
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) {
18
- const {
19
- allowAllOptionsSelect: l = !1,
20
- applyButtonType: o = "button",
21
- autoFocus: h,
22
- selected: e,
23
- onApply: C,
24
- onFocus: v,
25
- className: b
26
- } = t, n = j(), [s, c] = F.useState(e), {
27
- enableModernizedComponents: T
28
- } = x();
29
- F.useEffect(() => {
30
- c(e);
31
- }, [e]);
32
- const S = () => {
33
- const d = D(e), f = d.length;
34
- return f ? f === 1 ? n.formatMessage(d[0]) : n.formatMessage(m.multipleFiles, {
35
- count: f - 1,
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 : _;
41
- return /* @__PURE__ */ r("div", {
42
- className: L(b, a.boxItemTypeSelectorQuickFilterContainer),
43
- children: /* @__PURE__ */ u(i.Root, {
44
- modal: !1,
45
- children: [/* @__PURE__ */ r(i.Trigger, {
46
- children: /* @__PURE__ */ u(p.TriggerChip, {
47
- autoFocus: h,
48
- onClick: () => c(e),
49
- onFocus: v,
50
- selected: !!e.length,
51
- value: "trigger-chip",
52
- children: [/* @__PURE__ */ r(p.Icon, {
53
- icon: k
54
- }), /* @__PURE__ */ r(p.Label, {
55
- children: S()
56
- }), /* @__PURE__ */ r(p.DropdownIndicator, {})]
57
- })
58
- }), /* @__PURE__ */ u(i.ContentContainer, {
59
- align: "start",
60
- className: a.itemTypeSelectorQuickFilterPopoverContainer,
61
- children: [/* @__PURE__ */ r(i.MainContent, {
62
- className: a.popoverMainContent,
63
- children: /* @__PURE__ */ r(I, {
64
- className: a.boxItemTypeSelectorQuickFilter,
65
- onSelectionChange: c,
66
- selected: s
67
- })
68
- }), /* @__PURE__ */ u(i.Footer, {
69
- className: a.popoverFooterInline,
70
- children: [/* @__PURE__ */ r(y, {
71
- disabled: !s.length,
72
- onClick: () => c([]),
73
- size: "small",
74
- variant: "secondary",
75
- children: n.formatMessage(m.clear)
76
- }), /* @__PURE__ */ r(i.Close, {
77
- children: /* @__PURE__ */ r(y, {
78
- disabled: w(s, e),
79
- onClick: M,
80
- size: "small",
81
- type: o,
82
- variant: "primary",
83
- children: n.formatMessage(m.apply)
84
- })
85
- })]
86
- })]
87
- })]
88
- })
89
- });
90
- }
91
- export {
92
- X as BoxItemTypeSelectorQuickFilter,
93
- X as default
94
- };
1
+ import { t as e } from "../../chunks/box-item-type-selector-quick-filter.js";
2
+ export { e as BoxItemTypeSelectorQuickFilter, e as default };
@@ -1,81 +1,2 @@
1
- import { Checkbox as f, Text as S } from "@box/blueprint-web";
2
- import d from "clsx";
3
- import { forwardRef as T, useCallback as b } from "react";
4
- import { useIntl as v } from "react-intl";
5
- import { b as _, I as x } from "../../chunks/constants.js";
6
- import { jsx as s, jsxs as y } from "react/jsx-runtime";
7
- import '../../styles/box-item-type-selector.css';const N = "_boxItemTypeSelectorContainer_9ahmf_2", k = "_parentItemTypeSelectorContainer_9ahmf_6", g = "_itemTypeSelector_9ahmf_16", E = "_selectorLabel_9ahmf_22", L = "_disabled_9ahmf_36", w = "_childItemTypeSelectorContainer_9ahmf_39", i = {
8
- boxItemTypeSelectorContainer: N,
9
- parentItemTypeSelectorContainer: k,
10
- itemTypeSelector: g,
11
- selectorLabel: E,
12
- disabled: L,
13
- childItemTypeSelectorContainer: w
14
- }, M = (a, o) => {
15
- const r = [...o];
16
- return a.forEach((l) => {
17
- r.includes(l.value) || r.push(l.value);
18
- }), r;
19
- }, R = (a, o) => {
20
- const r = [...o];
21
- return a.forEach((l) => {
22
- const n = r.indexOf(l.value);
23
- n >= 0 && r.splice(n, 1);
24
- }), r;
25
- }, $ = (a, o, r) => {
26
- let l = [...r];
27
- return a ? l.push(o) : l = l.filter((n) => n !== o), l;
28
- }, W = /* @__PURE__ */ T((a, o) => {
29
- const {
30
- className: r,
31
- onSelectionChange: l,
32
- selected: n,
33
- disabled: m = !1,
34
- ...C
35
- } = a, I = v(), h = (e) => e.children ? e.children.every((t) => n.includes(t.value)) ? !0 : e.children.every((t) => !n.includes(t.value)) ? !1 : x : n.includes(e.value), p = b((e, t) => {
36
- let c = [...n];
37
- t.children ? e ? c = M(t.children, c) : c = R(t.children, c) : c = $(e, t.value, c), l(c);
38
- }, [l, n]), u = (e) => /* @__PURE__ */ y("span", {
39
- className: d(i.selectorLabel, {
40
- [i.disabled]: m
41
- }),
42
- children: [e.icon, /* @__PURE__ */ s(S, {
43
- as: "span",
44
- children: I.formatMessage(e.title)
45
- })]
46
- });
47
- return /* @__PURE__ */ s("div", {
48
- ref: o,
49
- className: d(r, i.boxItemTypeSelectorContainer),
50
- ...C,
51
- children: /* @__PURE__ */ s("ul", {
52
- children: _.map((e) => /* @__PURE__ */ y("li", {
53
- className: d(i.parentItemTypeSelectorContainer),
54
- children: [/* @__PURE__ */ s(f.Item, {
55
- checked: h(e),
56
- className: d(i.itemTypeSelector),
57
- disabled: m,
58
- label: u(e),
59
- onCheckedChange: (t) => p(t, e),
60
- value: e.value
61
- }, `box-item-type-selector-${e.value}`), e.children && /* @__PURE__ */ s("ul", {
62
- className: d(i.childItemTypeSelectorContainer),
63
- children: e.children.map((t) => /* @__PURE__ */ s("li", {
64
- children: /* @__PURE__ */ s(f.Item, {
65
- checked: h(t),
66
- className: d(i.itemTypeSelector),
67
- disabled: m,
68
- label: u(t),
69
- onCheckedChange: (c) => p(c, t),
70
- value: t.value
71
- })
72
- }, `box-item-type-selector-${t.value}`))
73
- })]
74
- }, `parent-item-type-selector-container-${e.value}`))
75
- })
76
- });
77
- });
78
- export {
79
- W as BoxItemTypeSelector,
80
- W as default
81
- };
1
+ import { t as e } from "../../chunks/box-item-type-selector.js";
2
+ export { e as BoxItemTypeSelector, e as default };
@@ -1,8 +1,2 @@
1
- import "@box/blueprint-web-assets/icons/Content";
2
- import "@box/blueprint-web-assets/icons/Fill";
3
- import { I as i, b as I } from "../../chunks/constants.js";
4
- import "react/jsx-runtime";
5
- export {
6
- i as INDETERMINATE,
7
- I as boxItemTypeMapping
8
- };
1
+ import { n as e, t } from "../../chunks/constants.js";
2
+ export { t as INDETERMINATE, e as boxItemTypeMapping };
@@ -1,74 +1,72 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const p = e({
3
- apply: {
4
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.apply",
5
- defaultMessage: "Apply"
6
- },
7
- audioType: {
8
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType",
9
- defaultMessage: "Audio"
10
- },
11
- boxcanvasType: {
12
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType",
13
- defaultMessage: "Box Canvas"
14
- },
15
- boxnoteType: {
16
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType",
17
- defaultMessage: "Box Note"
18
- },
19
- clear: {
20
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.clear",
21
- defaultMessage: "Clear"
22
- },
23
- documentType: {
24
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType",
25
- defaultMessage: "Document"
26
- },
27
- drawingType: {
28
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType",
29
- defaultMessage: "Drawing"
30
- },
31
- fileTypeLabelDropdown: {
32
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown",
33
- defaultMessage: "File Type"
34
- },
35
- fileType: {
36
- id: "groupSharedFeatures.boxItemTypeSelector.itemType.fileType",
37
- defaultMessage: "Files"
38
- },
39
- folderType: {
40
- id: "groupSharedFeatures.boxItemTypeSelector.itemType.folderType",
41
- defaultMessage: "Folders"
42
- },
43
- imageType: {
44
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType",
45
- defaultMessage: "Image"
46
- },
47
- multipleFiles: {
48
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles",
49
- defaultMessage: "{fileType} +{count}"
50
- },
51
- pdfType: {
52
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType",
53
- defaultMessage: "PDF"
54
- },
55
- presentationType: {
56
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType",
57
- defaultMessage: "Presentation"
58
- },
59
- spreadsheetType: {
60
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType",
61
- defaultMessage: "Spreadsheet"
62
- },
63
- threedType: {
64
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType",
65
- defaultMessage: "3D"
66
- },
67
- videoType: {
68
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType",
69
- defaultMessage: "Video"
70
- }
2
+ var t = e({
3
+ apply: {
4
+ id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.apply",
5
+ defaultMessage: "Apply"
6
+ },
7
+ audioType: {
8
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType",
9
+ defaultMessage: "Audio"
10
+ },
11
+ boxcanvasType: {
12
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType",
13
+ defaultMessage: "Box Canvas"
14
+ },
15
+ boxnoteType: {
16
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType",
17
+ defaultMessage: "Box Note"
18
+ },
19
+ clear: {
20
+ id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.clear",
21
+ defaultMessage: "Clear"
22
+ },
23
+ documentType: {
24
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType",
25
+ defaultMessage: "Document"
26
+ },
27
+ drawingType: {
28
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType",
29
+ defaultMessage: "Drawing"
30
+ },
31
+ fileTypeLabelDropdown: {
32
+ id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown",
33
+ defaultMessage: "File Type"
34
+ },
35
+ fileType: {
36
+ id: "groupSharedFeatures.boxItemTypeSelector.itemType.fileType",
37
+ defaultMessage: "Files"
38
+ },
39
+ folderType: {
40
+ id: "groupSharedFeatures.boxItemTypeSelector.itemType.folderType",
41
+ defaultMessage: "Folders"
42
+ },
43
+ imageType: {
44
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType",
45
+ defaultMessage: "Image"
46
+ },
47
+ multipleFiles: {
48
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles",
49
+ defaultMessage: "{fileType} +{count}"
50
+ },
51
+ pdfType: {
52
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType",
53
+ defaultMessage: "PDF"
54
+ },
55
+ presentationType: {
56
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType",
57
+ defaultMessage: "Presentation"
58
+ },
59
+ spreadsheetType: {
60
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType",
61
+ defaultMessage: "Spreadsheet"
62
+ },
63
+ threedType: {
64
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType",
65
+ defaultMessage: "3D"
66
+ },
67
+ videoType: {
68
+ id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType",
69
+ defaultMessage: "Video"
70
+ }
71
71
  });
72
- export {
73
- p as default
74
- };
72
+ export { t as default };
@@ -1,46 +1,27 @@
1
- import { Text as d } from "@box/blueprint-web";
2
- import { Fragment as m } from "react";
3
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
4
- const g = ({
5
- defaultProps: t,
6
- DefaultComponentTemplate: s,
7
- variantsMap: n,
8
- containerStyle: o
9
- }) => {
10
- const l = Object.entries(n);
11
- return /* @__PURE__ */ r("div", {
12
- style: {
13
- display: "grid",
14
- gridTemplateColumns: "auto auto",
15
- alignItems: "baseline",
16
- gap: "64px 12px",
17
- ...o
18
- },
19
- children: l.map(([a, {
20
- props: e = {},
21
- ComponentTemplate: i
22
- }]) => /* @__PURE__ */ c(m, {
23
- children: [/* @__PURE__ */ r(d, {
24
- as: "span",
25
- color: "textOnLightSecondary",
26
- style: {
27
- textTransform: "uppercase"
28
- },
29
- variant: "bodyDefaultBold",
30
- children: a
31
- }), /* @__PURE__ */ r("div", {
32
- children: i ? /* @__PURE__ */ r(i, {
33
- ...t,
34
- ...e
35
- }) : /* @__PURE__ */ r(s, {
36
- ...t,
37
- ...e
38
- })
39
- })]
40
- }, a))
41
- });
42
- };
43
- g.displayName = "variants";
44
- export {
45
- g as VariantsAggregator
1
+ import { Text as e } from "@box/blueprint-web";
2
+ import { Fragment as t } from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ var i = ({ defaultProps: i, DefaultComponentTemplate: a, variantsMap: o, containerStyle: s }) => {
5
+ let c = Object.entries(o);
6
+ return /* @__PURE__ */ n("div", {
7
+ style: {
8
+ display: "grid",
9
+ gridTemplateColumns: "auto auto",
10
+ alignItems: "baseline",
11
+ gap: "64px 12px",
12
+ ...s
13
+ },
14
+ children: c.map(([o, { props: s = {}, ComponentTemplate: c }]) => /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(e, {
15
+ as: "span",
16
+ color: "textOnLightSecondary",
17
+ style: { textTransform: "uppercase" },
18
+ variant: "bodyDefaultBold",
19
+ children: o
20
+ }), /* @__PURE__ */ n("div", { children: n(c || a, {
21
+ ...i,
22
+ ...s
23
+ }) })] }, o))
24
+ });
46
25
  };
26
+ i.displayName = "variants";
27
+ export { i as VariantsAggregator };
@@ -1 +1 @@
1
- ._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1{width:320px}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverMainContent_10sjf_4{min-height:var(--size-8);max-height:calc(var(--radix-popover-content-available-height) - var(--space-8) - var(--space-2) - var(--border-1) - var(--space-4) - var(--space-8))}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverMainContent_10sjf_4 ._boxItemTypeSelectorQuickFilter_10sjf_8{margin:0 var(--space-2)}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverFooterInline_10sjf_11{display:flex;justify-content:end}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverFooterInline_10sjf_11 :not(:first-child){margin-left:var(--space-2)}
1
+ ._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1{width:320px}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverMainContent_10sjf_4{min-height:var(--size-8);max-height:calc(var(--radix-popover-content-available-height) - var(--space-8) - var(--space-2) - var(--border-1) - var(--space-4) - var(--space-8))}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverMainContent_10sjf_4 ._boxItemTypeSelectorQuickFilter_10sjf_8{margin:0 var(--space-2)}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverFooterInline_10sjf_11{justify-content:end;display:flex}._itemTypeSelectorQuickFilterPopoverContainer_10sjf_1 ._popoverFooterInline_10sjf_11 :not(:first-child){margin-left:var(--space-2)}
@@ -1 +1 @@
1
- ._boxItemTypeSelectorContainer_9ahmf_2{display:flex;flex-direction:column}._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{display:flex;flex-direction:column;min-height:0}@container (min-width: 374px){._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{max-height:255px}}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16{margin:var(--space-1) 0}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16 label{gap:var(--space-2)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22{font-weight:var(--body-default-font-weight);font-size:var(--body-default-font-size);font-family:var(--body-default-font-family);line-height:var(--body-default-line-height);letter-spacing:var(--body-default-letter-spacing);text-transform:var(--body-default-text-case);text-decoration:var(--body-default-text-decoration);display:flex}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22 svg{margin-inline-end:var(--space-2);font-size:var(--size-5)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22._disabled_9ahmf_36{opacity:60%}._boxItemTypeSelectorContainer_9ahmf_2 ._childItemTypeSelectorContainer_9ahmf_39{margin-inline-start:var(--space-7);display:flex;flex-flow:column wrap;min-height:0}._boxItemTypeSelectorContainer_9ahmf_2 ul,._boxItemTypeSelectorContainer_9ahmf_2 li{display:contents;margin:0;padding:0}
1
+ ._boxItemTypeSelectorContainer_9ahmf_2{flex-direction:column;display:flex}._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{flex-direction:column;min-height:0;display:flex}@container (width>=374px){._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{max-height:255px}}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16{margin:var(--space-1) 0}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16 label{gap:var(--space-2)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22{font-weight:var(--body-default-font-weight);font-size:var(--body-default-font-size);font-family:var(--body-default-font-family);line-height:var(--body-default-line-height);letter-spacing:var(--body-default-letter-spacing);text-transform:var(--body-default-text-case);-webkit-text-decoration:var(--body-default-text-decoration);text-decoration:var(--body-default-text-decoration);display:flex}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22 svg{font-size:var(--size-5);margin-inline-end:var(--space-2)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22._disabled_9ahmf_36{opacity:.6}._boxItemTypeSelectorContainer_9ahmf_2 ._childItemTypeSelectorContainer_9ahmf_39{flex-flow:column wrap;min-height:0;margin-inline-start:var(--space-7);display:flex}._boxItemTypeSelectorContainer_9ahmf_2 ul,._boxItemTypeSelectorContainer_9ahmf_2 li{margin:0;padding:0;display:contents}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@box/box-item-type-selector",
3
- "version": "1.39.32",
3
+ "version": "1.39.34",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^14.5.0",
6
- "@box/blueprint-web-assets": "^4.112.1",
5
+ "@box/blueprint-web": "^14.7.0",
6
+ "@box/blueprint-web-assets": "^4.112.3",
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": "^14.5.0",
13
- "@box/blueprint-web-assets": "^4.112.1",
14
- "@box/storybook-utils": "^0.17.28",
12
+ "@box/blueprint-web": "^14.7.0",
13
+ "@box/blueprint-web-assets": "^4.112.3",
14
+ "@box/storybook-utils": "^0.17.30",
15
15
  "react": "^18.3.0",
16
16
  "react-dom": "^18.3.0",
17
17
  "react-intl": "6.4.2"