@box/metadata-taxonomy-picker 3.1.33 → 3.1.35

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,18 +1,18 @@
1
1
  import { messages as e } from "../esm/lib/components/taxonomy-items-list/messages.js";
2
- import { Text as t } from "@box/blueprint-web";
3
- import { useIntl as n } from "react-intl";
2
+ import { useIntl as t } from "react-intl";
3
+ import { Text as n } from "@box/blueprint-web";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import '../styles/empty-state.css';var a = { root: "_root_1fze8_1" };
6
6
  function o({ isSearchMode: o = !1 }) {
7
- let { formatMessage: s } = n(), c = s(o ? e.searchEmptyStateHeading : e.emptyStateHeading), l = s(o ? e.searchEmptyStateBody : e.emptyStateBody);
7
+ let { formatMessage: s } = t(), c = s(o ? e.searchEmptyStateHeading : e.emptyStateHeading), l = s(o ? e.searchEmptyStateBody : e.emptyStateBody);
8
8
  return /* @__PURE__ */ i("div", {
9
9
  className: a.root,
10
10
  role: "status",
11
- children: [/* @__PURE__ */ r(t, {
11
+ children: [/* @__PURE__ */ r(n, {
12
12
  as: "h3",
13
13
  variant: "titleSmall",
14
14
  children: c
15
- }), /* @__PURE__ */ r(t, {
15
+ }), /* @__PURE__ */ r(n, {
16
16
  as: "p",
17
17
  color: "textOnLightSecondary",
18
18
  children: l
@@ -1,7 +1,7 @@
1
1
  import { messages as e } from "../esm/lib/components/taxonomy-items-list/messages.js";
2
- import { Button as t, EmptyState as n, Text as r } from "@box/blueprint-web";
3
- import { Loader as i } from "@box/blueprint-web-assets/icons/Fill";
4
- import { useIntl as a } from "react-intl";
2
+ import { useIntl as t } from "react-intl";
3
+ import { Button as n, EmptyState as r, Text as i } from "@box/blueprint-web";
4
+ import { Loader as a } from "@box/blueprint-web-assets/icons/Fill";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  import { Unplugged as c } from "@box/blueprint-web-assets/illustrations/Medium";
7
7
  import '../styles/error-state.css';var l = {
@@ -9,17 +9,17 @@ import '../styles/error-state.css';var l = {
9
9
  body: "_body_1ml46_8"
10
10
  };
11
11
  function u({ onRetry: u }) {
12
- let { formatMessage: d } = a();
12
+ let { formatMessage: d } = t();
13
13
  return /* @__PURE__ */ o("div", {
14
14
  className: l.root,
15
- children: /* @__PURE__ */ o(n, {
15
+ children: /* @__PURE__ */ o(r, {
16
16
  body: /* @__PURE__ */ s("div", {
17
17
  className: l.body,
18
- children: [/* @__PURE__ */ o(r, {
18
+ children: [/* @__PURE__ */ o(i, {
19
19
  as: "p",
20
20
  variant: "bodyDefault",
21
21
  children: d(e.errorStateHeading)
22
- }), /* @__PURE__ */ o(r, {
22
+ }), /* @__PURE__ */ o(i, {
23
23
  as: "p",
24
24
  variant: "bodyDefault",
25
25
  children: d(e.errorStateBody)
@@ -28,8 +28,8 @@ function u({ onRetry: u }) {
28
28
  illustration: c,
29
29
  role: "alert",
30
30
  size: "large",
31
- children: /* @__PURE__ */ o(t, {
32
- endIcon: i,
31
+ children: /* @__PURE__ */ o(n, {
32
+ endIcon: a,
33
33
  onClick: u,
34
34
  size: "large",
35
35
  variant: "secondary",
@@ -1,19 +1,18 @@
1
1
  import { messages as e } from "../esm/lib/components/taxonomy-items-list/load-more-feedback/messages.js";
2
2
  import { useEffect as t } from "react";
3
- import { InlineNotice as n, Text as r, TextButton as i } from "@box/blueprint-web";
4
- import { Loader as a } from "@box/blueprint-web-assets/icons/Fill";
5
- import { useIntl as o } from "react-intl";
3
+ import { useIntl as n } from "react-intl";
4
+ import { InlineNotice as r, Text as i, TextButton as a } from "@box/blueprint-web";
5
+ import { Loader as o } from "@box/blueprint-web-assets/icons/Fill";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import { AlertCircle as l } from "@box/blueprint-web-assets/icons/Medium";
8
8
  import { bpIconIconErrorOnColor as u } from "@box/blueprint-web-assets/tokens/tokens";
9
9
  import '../styles/load-more-error-row.css';var d = {
10
- container: "_container_19xfu_1",
11
- retryButton: "_retryButton_19xfu_11",
12
- errorText: "_errorText_19xfu_15",
13
- reloadButton: "_reloadButton_19xfu_20"
10
+ container: "_container_1sz1a_1",
11
+ errorText: "_errorText_1sz1a_11",
12
+ reloadButton: "_reloadButton_1sz1a_16"
14
13
  };
15
14
  function f({ onRetry: f }) {
16
- let { formatMessage: p } = o();
15
+ let { formatMessage: p } = n();
17
16
  return t(() => {
18
17
  let e = document.activeElement, t = e?.closest("[role=\"listbox\"]") != null;
19
18
  return () => {
@@ -23,7 +22,7 @@ function f({ onRetry: f }) {
23
22
  "aria-live": "polite",
24
23
  className: d.container,
25
24
  role: "status",
26
- children: [/* @__PURE__ */ s(n, {
25
+ children: [/* @__PURE__ */ s(r, {
27
26
  icon: () => /* @__PURE__ */ s(l, {
28
27
  width: 20,
29
28
  height: 20,
@@ -31,7 +30,7 @@ function f({ onRetry: f }) {
31
30
  }),
32
31
  variant: "error",
33
32
  variantIconAriaLabel: p(e.errorNoticeIconAriaLabel),
34
- children: /* @__PURE__ */ s(r, {
33
+ children: /* @__PURE__ */ s(i, {
35
34
  as: "span",
36
35
  className: d.errorText,
37
36
  color: "textOnLightError",
@@ -40,9 +39,9 @@ function f({ onRetry: f }) {
40
39
  })
41
40
  }), /* @__PURE__ */ s("div", {
42
41
  className: d.reloadButton,
43
- children: /* @__PURE__ */ s(i, {
42
+ children: /* @__PURE__ */ s(a, {
44
43
  "data-testid": "reload-button",
45
- icon: a,
44
+ icon: o,
46
45
  onClick: f,
47
46
  type: "button",
48
47
  children: p(e.reloadButtonLabel)
@@ -1,17 +1,17 @@
1
1
  import "../esm/lib/constants.js";
2
2
  import { messages as e } from "../esm/lib/components/taxonomy-items-list/load-more-feedback/messages.js";
3
- import { Ghost as t } from "@box/blueprint-web";
4
- import { useIntl as n } from "react-intl";
3
+ import { useIntl as t } from "react-intl";
4
+ import { Ghost as n } from "@box/blueprint-web";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  import '../styles/load-more-loading-row.css';var i = { container: "_container_1ubpr_1" };
7
7
  function a() {
8
- let { formatMessage: a } = n();
8
+ let { formatMessage: a } = t();
9
9
  return /* @__PURE__ */ r("div", {
10
10
  "aria-busy": "true",
11
11
  "aria-label": a(e.loadingRowAriaLabel),
12
12
  className: i.container,
13
13
  role: "status",
14
- children: Array.from({ length: 3 }, (e, n) => /* @__PURE__ */ r(t, { height: 16 }, n))
14
+ children: Array.from({ length: 3 }, (e, t) => /* @__PURE__ */ r(n, { height: 16 }, t))
15
15
  });
16
16
  }
17
17
  export { a as t };
@@ -1,17 +1,17 @@
1
1
  import "../esm/lib/constants.js";
2
2
  import { messages as e } from "../esm/lib/components/taxonomy-items-list/messages.js";
3
- import { Ghost as t } from "@box/blueprint-web";
4
- import { useIntl as n } from "react-intl";
3
+ import { useIntl as t } from "react-intl";
4
+ import { Ghost as n } from "@box/blueprint-web";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  import '../styles/loading-state.css';var i = { root: "_root_t50cx_1" };
7
7
  function a() {
8
- let { formatMessage: a } = n();
8
+ let { formatMessage: a } = t();
9
9
  return /* @__PURE__ */ r("div", {
10
10
  "aria-busy": "true",
11
11
  "aria-label": a(e.loadingAriaLabel),
12
12
  className: i.root,
13
13
  role: "status",
14
- children: Array.from({ length: 9 }, (e, n) => /* @__PURE__ */ r(t, { height: 16 }, n))
14
+ children: Array.from({ length: 9 }, (e, t) => /* @__PURE__ */ r(n, { height: 16 }, t))
15
15
  });
16
16
  }
17
17
  export { a as t };
@@ -3,64 +3,63 @@ import { useTaxonomyPickerController as t } from "../esm/lib/hooks/use-taxonomy-
3
3
  import { t as n } from "./taxonomy-items-list.js";
4
4
  import { t as r } from "./taxonomy-level-filter.js";
5
5
  import { messages as i } from "../esm/lib/components/metadata-taxonomy-picker-shell/messages.js";
6
- import { forwardRef as a, useCallback as o, useEffect as ee, useId as te, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
7
- import { Breadcrumb as ne, ChipsGroup as re, IconButton as ie, InputChip as d, Popover as f, useForkRef as ae } from "@box/blueprint-web";
8
- import { Search as oe, XMark as se } from "@box/blueprint-web-assets/icons/Fill";
9
- import ce from "clsx";
10
- import { useIntl as le } from "react-intl";
11
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
- import '../styles/metadata-taxonomy-picker-shell.css';var h = /* @__PURE__ */ function(e) {
6
+ import { forwardRef as a, useCallback as o, useEffect as ee, useId as te, useLayoutEffect as s, useMemo as c, useRef as l, useState as ne } from "react";
7
+ import re from "clsx";
8
+ import { useIntl as ie } from "react-intl";
9
+ import { Breadcrumb as ae, ChipsGroup as oe, IconButton as se, InputChip as u, Popover as d, Text as ce, useForkRef as le } from "@box/blueprint-web";
10
+ import { Search as ue, XMark as de } from "@box/blueprint-web-assets/icons/Fill";
11
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import '../styles/metadata-taxonomy-picker-shell.css';var m = /* @__PURE__ */ function(e) {
13
13
  return e.SingleLevel = "single-level", e.MultiLevel = "multi-level", e;
14
- }({}), g = {
15
- container: "_container_hdbsq_1",
16
- label: "_label_hdbsq_8",
17
- trigger: "_trigger_hdbsq_16",
18
- searchInput: "_searchInput_hdbsq_34",
19
- chips: "_chips_hdbsq_46",
20
- searchIcon: "_searchIcon_hdbsq_83",
21
- emptyState: "_emptyState_hdbsq_92",
22
- popover: "_popover_hdbsq_98",
23
- clearButton: "_clearButton_hdbsq_106",
24
- breadcrumbContainer: "_breadcrumbContainer_hdbsq_110"
14
+ }({}), h = {
15
+ container: "_container_nitxb_1",
16
+ label: "_label_nitxb_8",
17
+ trigger: "_trigger_nitxb_12",
18
+ searchInput: "_searchInput_nitxb_30",
19
+ chips: "_chips_nitxb_42",
20
+ searchIcon: "_searchIcon_nitxb_79",
21
+ popover: "_popover_nitxb_88",
22
+ clearButton: "_clearButton_nitxb_96",
23
+ breadcrumbContainer: "_breadcrumbContainer_nitxb_100"
25
24
  };
26
- function ue(e) {
25
+ function fe(e) {
27
26
  let t = null;
28
27
  for (let n of e) n.selectable !== !1 && (t === null || n.level > t) && (t = n.level);
29
28
  return t;
30
29
  }
31
- var de = [];
32
- function fe(e) {
30
+ var pe = [];
31
+ function me(e) {
33
32
  if (e != null) return (typeof e == "function" ? e() : e) ?? void 0;
34
33
  }
35
- var _ = /*#__PURE__*/ a(function({ itemsService: a, eventService: _, levels: v = de, mode: pe, multiSelect: y, value: b, onValueChange: x, placeholder: me, disabled: S = !1, label: C, containerClassName: he, portalElement: ge }, _e) {
36
- let { formatMessage: w } = le(), T = te(), E = `${T}-listbox`, D = l(null), ve = ae(D, _e), O = l(null), k = l(null), [ye, be] = u(null), A = l(0), j = l(!1), xe = fe(ge), M = pe === h.SingleLevel, { state: N, isOpen: P, handleOpenChange: F, handleInputValueChange: I, actions: L } = t(a, v, _), { items: R, levelStack: z } = N, { drillDown: B, navigateBack: V, loadMore: Se, setSearchScopeOverride: H } = L, U = N.searchInputValue !== "", W = c(() => ue(N.availableLevels), [N.availableLevels]);
34
+ var g = /*#__PURE__*/ a(function({ itemsService: a, eventService: g, levels: _ = pe, mode: he, multiSelect: v, value: y, onValueChange: b, placeholder: ge, disabled: x = !1, label: S, containerClassName: _e, portalElement: ve }, ye) {
35
+ let { formatMessage: C } = ie(), w = te(), T = `${w}-listbox`, E = l(null), be = le(E, ye), D = l(null), O = l(null), [xe, Se] = ne(null), k = l(0), A = l(!1), Ce = me(ve), j = he === m.SingleLevel, { state: M, isOpen: N, handleOpenChange: P, handleInputValueChange: F, actions: I } = t(a, _, g), { items: L, levelStack: R } = M, { drillDown: z, navigateBack: B, loadMore: we, setSearchScopeOverride: V } = I, H = M.searchInputValue !== "", U = c(() => fe(M.availableLevels), [M.availableLevels]);
37
36
  ee(() => {
38
- H(M && W !== null ? {
37
+ V(j && U !== null ? {
39
38
  parentId: null,
40
- levelFilter: W
39
+ levelFilter: U
41
40
  } : void 0);
42
41
  }, [
43
- M,
44
- W,
45
- H
42
+ j,
43
+ U,
44
+ V
46
45
  ]);
47
- let [Ce, G] = u(""), K = l(!1), we = o(() => {
48
- K.current = !0;
49
- }, []), Te = o((e) => {
50
- K.current = !1, I(e.target.value);
51
- }, [I]);
46
+ let [Te, W] = ne(""), G = l(!1), Ee = o(() => {
47
+ G.current = !0;
48
+ }, []), De = o((e) => {
49
+ G.current = !1, F(e.target.value);
50
+ }, [F]);
52
51
  s(() => {
53
- K.current ? N.searchInputValue === "" && (K.current = !1, G("")) : G(N.searchInputValue);
54
- }, [N.searchInputValue]), s(() => {
52
+ G.current ? M.searchInputValue === "" && (G.current = !1, W("")) : W(M.searchInputValue);
53
+ }, [M.searchInputValue]), s(() => {
55
54
  let e;
56
- return !U && j.current && (e = requestAnimationFrame(() => {
57
- k.current?.scrollTo(A.current);
58
- })), j.current = U, () => {
55
+ return !H && A.current && (e = requestAnimationFrame(() => {
56
+ O.current?.scrollTo(k.current);
57
+ })), A.current = H, () => {
59
58
  e !== void 0 && cancelAnimationFrame(e);
60
59
  };
61
- }, [U]);
62
- let q = c(() => new Set(b.map((e) => e.id)), [b]), Ee = c(() => !y && b.length === 1 ? b[0].id : "", [y, b]), J = o((e, t = !0) => {
63
- let n = R.find((t) => t.id === e);
60
+ }, [H]);
61
+ let K = c(() => new Set(y.map((e) => e.id)), [y]), Oe = c(() => !v && y.length === 1 ? y[0].id : "", [v, y]), q = o((e, t = !0) => {
62
+ let n = L.find((t) => t.id === e);
64
63
  if (!n || !n.selectable) return;
65
64
  let r = {
66
65
  id: n.id,
@@ -68,16 +67,16 @@ var _ = /*#__PURE__*/ a(function({ itemsService: a, eventService: _, levels: v =
68
67
  level: n.level,
69
68
  ancestors: n.ancestors
70
69
  };
71
- y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t && F(!1));
70
+ v ? b(K.has(e) ? y.filter((t) => t.id !== e) : [...y, r]) : (b([r]), t && P(!1));
72
71
  }, [
73
- R,
72
+ L,
73
+ v,
74
+ K,
74
75
  y,
75
- q,
76
76
  b,
77
- x,
78
- F
79
- ]), Y = o((e, t = !0) => {
80
- let n = N.searchResults.find((t) => t.id === e);
77
+ P
78
+ ]), J = o((e, t = !0) => {
79
+ let n = M.searchResults.find((t) => t.id === e);
81
80
  if (!n || !n.selectable) return;
82
81
  let r = {
83
82
  id: n.id,
@@ -85,197 +84,199 @@ var _ = /*#__PURE__*/ a(function({ itemsService: a, eventService: _, levels: v =
85
84
  level: n.level,
86
85
  ancestors: n.ancestors
87
86
  };
88
- y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t !== !1 && F(!1));
87
+ v ? b(K.has(e) ? y.filter((t) => t.id !== e) : [...y, r]) : (b([r]), t !== !1 && P(!1));
89
88
  }, [
90
- N.searchResults,
89
+ M.searchResults,
90
+ v,
91
+ K,
91
92
  y,
92
- q,
93
93
  b,
94
- x,
95
- F
96
- ]), X = o((e) => {
97
- let t = N.searchResults.find((t) => t.id === e);
98
- t && L.drillDown({
94
+ P
95
+ ]), Y = o((e) => {
96
+ let t = M.searchResults.find((t) => t.id === e);
97
+ t && I.drillDown({
99
98
  id: t.id,
100
99
  displayName: t.displayName,
101
100
  ancestors: t.ancestors
102
101
  });
103
- }, [N.searchResults, L]), De = o((e) => {
104
- let t = N.items.find((t) => t.id === e);
105
- t && B({
102
+ }, [M.searchResults, I]), X = o((e) => {
103
+ let t = M.items.find((t) => t.id === e);
104
+ t && z({
106
105
  id: t.id,
107
106
  displayName: t.displayName
108
107
  });
109
- }, [N.items, B]), Z = o((e) => !(!e.hasChildren || M && W !== null && e.level >= W), [M, W]), Oe = c(() => R.map((e) => ({
108
+ }, [M.items, z]), Z = o((e) => !(!e.hasChildren || j && U !== null && e.level >= U), [j, U]), ke = c(() => L.map((e) => ({
110
109
  id: e.id,
111
110
  displayName: e.displayName,
112
111
  selectable: e.selectable,
113
- multiSelect: y,
114
- isSelected: q.has(e.id),
112
+ multiSelect: v,
113
+ isSelected: K.has(e.id),
115
114
  showDrillDown: Z(e),
116
115
  ancestors: e.ancestors,
117
- onSelect: J,
118
- onDrillDown: De
116
+ onSelect: q,
117
+ onDrillDown: X
119
118
  })), [
120
- R,
121
- y,
122
- q,
119
+ L,
120
+ v,
121
+ K,
123
122
  Z,
124
- J,
125
- De
126
- ]), Q = c(() => z.length === 0 ? [] : [{
123
+ q,
124
+ X
125
+ ]), Q = c(() => R.length === 0 ? [] : [{
127
126
  id: e,
128
- name: w(i.breadcrumbRootLabel)
129
- }, ...z.map((e) => ({
127
+ name: C(i.breadcrumbRootLabel)
128
+ }, ...R.map((e) => ({
130
129
  id: e.id,
131
130
  name: e.displayName
132
- }))], [z, w]), ke = o((e) => {
133
- V(e === "__breadcrumb_root__" ? null : e);
134
- }, [V]), Ae = !M && U && N.availableLevels.length > 1, je = c(() => N.searchResults.map((e) => ({
131
+ }))], [R, C]), Ae = o((e) => {
132
+ B(e === "__breadcrumb_root__" ? null : e);
133
+ }, [B]), je = !j && H && M.availableLevels.length > 1, Me = c(() => M.searchResults.map((e) => ({
135
134
  id: e.id,
136
135
  displayName: e.displayName,
137
136
  selectable: e.selectable,
138
- multiSelect: y,
139
- isSelected: q.has(e.id),
137
+ multiSelect: v,
138
+ isSelected: K.has(e.id),
140
139
  showDrillDown: Z(e),
141
140
  ancestors: e.ancestors,
142
- onSelect: Y,
143
- onDrillDown: X
141
+ onSelect: J,
142
+ onDrillDown: Y
144
143
  })), [
145
- N.searchResults,
146
- y,
147
- q,
144
+ M.searchResults,
145
+ v,
146
+ K,
148
147
  Z,
149
- Y,
150
- X
151
- ]), Me = o((e) => {
152
- e.target === e.currentTarget && D.current?.focus();
153
- }, [D]), $ = b.length > 0, Ne = me ?? w(i.placeholder), Pe = (e) => {
154
- !S && e.target === e.currentTarget && (e.preventDefault(), D.current?.focus());
155
- }, Fe = () => {
156
- !S && !P && F(!0);
157
- }, Ie = o(() => {
158
- S || (x([]), I(""));
148
+ J,
149
+ Y
150
+ ]), Ne = o((e) => {
151
+ e.target === e.currentTarget && E.current?.focus();
152
+ }, [E]), $ = y.length > 0, Pe = ge ?? C(i.placeholder), Fe = (e) => {
153
+ !x && e.target === e.currentTarget && (e.preventDefault(), E.current?.focus());
154
+ }, Ie = () => {
155
+ !x && !N && P(!0);
156
+ }, Le = o(() => {
157
+ x || (b([]), F(""));
159
158
  }, [
160
- S,
161
159
  x,
162
- I
163
- ]), Le = (e) => {
164
- !U && e.target.value && (A.current = k.current?.getScrollTop() ?? 0), G(e.target.value), K.current || I(e.target.value);
165
- }, Re = (e) => {
166
- S || x(b.filter((t) => t.id !== e.id));
160
+ b,
161
+ F
162
+ ]), Re = (e) => {
163
+ !H && e.target.value && (k.current = O.current?.getScrollTop() ?? 0), W(e.target.value), G.current || F(e.target.value);
164
+ }, ze = (e) => {
165
+ x || b(y.filter((t) => t.id !== e.id));
167
166
  };
168
- return /* @__PURE__ */ m(f.Root, {
167
+ return /* @__PURE__ */ p(d.Root, {
169
168
  modal: !1,
170
- onOpenChange: F,
171
- open: P,
172
- children: [/* @__PURE__ */ p(f.Anchor, { children: /* @__PURE__ */ m("div", {
173
- className: ce(g.container, he),
174
- children: [C && /* @__PURE__ */ p("label", {
175
- className: g.label,
176
- htmlFor: T,
177
- children: C
178
- }), /* @__PURE__ */ m("div", {
179
- className: g.trigger,
180
- "data-disabled": S,
181
- onMouseDown: Pe,
182
- ref: O,
169
+ onOpenChange: P,
170
+ open: N,
171
+ children: [/* @__PURE__ */ f(d.Anchor, { children: /* @__PURE__ */ p("div", {
172
+ className: re(h.container, _e),
173
+ children: [S && /* @__PURE__ */ f(ce, {
174
+ as: "label",
175
+ className: h.label,
176
+ htmlFor: w,
177
+ variant: "bodyDefaultBold",
178
+ children: S
179
+ }), /* @__PURE__ */ p("div", {
180
+ className: h.trigger,
181
+ "data-disabled": x,
182
+ onMouseDown: Fe,
183
+ ref: D,
183
184
  children: [
184
- y && $ && /* @__PURE__ */ p(re, {
185
- className: g.chips,
186
- onClick: Me,
187
- children: b.map((e) => /* @__PURE__ */ p(d, {
185
+ v && $ && /* @__PURE__ */ f(oe, {
186
+ className: h.chips,
187
+ onClick: Ne,
188
+ children: y.map((e) => /* @__PURE__ */ f(u, {
188
189
  label: e.displayName,
189
- onDelete: () => Re(e),
190
- tabIndex: S ? -1 : void 0
190
+ onDelete: () => ze(e),
191
+ tabIndex: x ? -1 : void 0
191
192
  }, e.id))
192
193
  }),
193
- !y && $ && /* @__PURE__ */ p(d, {
194
- label: b[0].displayName,
195
- tabIndex: S ? -1 : void 0
194
+ !v && $ && /* @__PURE__ */ f(u, {
195
+ label: y[0].displayName,
196
+ tabIndex: x ? -1 : void 0
196
197
  }),
197
- /* @__PURE__ */ p("input", {
198
- "aria-controls": E,
199
- "aria-expanded": P,
198
+ /* @__PURE__ */ f("input", {
199
+ "aria-controls": T,
200
+ "aria-expanded": N,
200
201
  "aria-haspopup": "listbox",
201
- className: g.searchInput,
202
- disabled: S,
203
- id: T,
204
- onChange: Le,
205
- onCompositionStart: we,
206
- onCompositionEnd: Te,
207
- onFocus: Fe,
208
- placeholder: $ ? void 0 : Ne,
209
- ref: ve,
202
+ className: h.searchInput,
203
+ disabled: x,
204
+ id: w,
205
+ onChange: Re,
206
+ onCompositionStart: Ee,
207
+ onCompositionEnd: De,
208
+ onFocus: Ie,
209
+ placeholder: $ ? void 0 : Pe,
210
+ ref: be,
210
211
  role: "combobox",
211
212
  type: "text",
212
- value: Ce
213
+ value: Te
213
214
  }),
214
- !y && $ && /* @__PURE__ */ p(ie, {
215
- "aria-label": w(i.clearAriaLabel),
216
- className: g.clearButton,
217
- icon: se,
215
+ !v && $ && /* @__PURE__ */ f(se, {
216
+ "aria-label": C(i.clearAriaLabel),
217
+ className: h.clearButton,
218
+ icon: de,
218
219
  size: "x-small",
219
- tabIndex: S ? -1 : void 0,
220
- onClick: Ie
220
+ tabIndex: x ? -1 : void 0,
221
+ onClick: Le
221
222
  }),
222
- /* @__PURE__ */ p(oe, {
223
+ /* @__PURE__ */ f(ue, {
223
224
  "aria-hidden": "true",
224
- className: g.searchIcon,
225
+ className: h.searchIcon,
225
226
  role: "presentation"
226
227
  })
227
228
  ]
228
229
  })]
229
- }) }), /* @__PURE__ */ m(f.ContentContainer, {
230
+ }) }), /* @__PURE__ */ p(d.ContentContainer, {
230
231
  align: "start",
231
- className: g.popover,
232
- container: xe,
232
+ className: h.popover,
233
+ container: Ce,
233
234
  onInteractOutside: (e) => {
234
- O.current?.contains(e.target) && e.preventDefault();
235
+ D.current?.contains(e.target) && e.preventDefault();
235
236
  },
236
237
  onOpenAutoFocus: (e) => e.preventDefault(),
237
- ref: be,
238
+ ref: Se,
238
239
  children: [
239
- Q.length > 0 && !U && /* @__PURE__ */ p("div", {
240
- className: g.breadcrumbContainer,
241
- children: /* @__PURE__ */ p(ne, {
242
- breadcrumbAriaLabel: w(i.breadcrumbAriaLabel),
240
+ Q.length > 0 && !H && /* @__PURE__ */ f("div", {
241
+ className: h.breadcrumbContainer,
242
+ children: /* @__PURE__ */ f(ae, {
243
+ breadcrumbAriaLabel: C(i.breadcrumbAriaLabel),
243
244
  crumbs: Q,
244
- onPageLinkClick: ke,
245
+ onPageLinkClick: Ae,
245
246
  rootIconVariant: "taxonomy",
246
- isInteractive: !S,
247
+ isInteractive: !x,
247
248
  isResponsiveEnabled: !1,
248
249
  size: "small",
249
- truncatedLinksIconAriaLabel: w(i.breadcrumbTruncatedLinksLabel),
250
+ truncatedLinksIconAriaLabel: C(i.breadcrumbTruncatedLinksLabel),
250
251
  truncationMethod: "folder-tree"
251
252
  })
252
253
  }),
253
- Ae && /* @__PURE__ */ p(r, {
254
- availableLevels: v,
255
- container: ye,
256
- levelFilter: N.levelFilter,
257
- onLevelFilterChange: L.setLevelFilter
254
+ je && /* @__PURE__ */ f(r, {
255
+ availableLevels: _,
256
+ container: xe,
257
+ levelFilter: M.levelFilter,
258
+ onLevelFilterChange: I.setLevelFilter
258
259
  }),
259
- /* @__PURE__ */ p(n, {
260
- error: U ? N.searchError : N.initialLoadError,
261
- estimatedRowHeight: U ? 44 : void 0,
262
- hasMore: U ? N.searchNextMarker !== void 0 : N.itemsNextMarker !== void 0,
263
- hasVariableRowHeight: U,
264
- isFetching: U ? N.isFetchingSearch : N.isFetching,
265
- isFetchingMore: U ? N.isFetchingSearchMore : N.isFetchingMore,
266
- isSearchMode: U,
267
- items: U ? je : Oe,
268
- listboxId: E,
269
- loadMoreError: U ? N.searchLoadMoreError : N.loadMoreError,
270
- multiSelect: y,
271
- onFocusExit: () => D.current?.focus(),
272
- onLoadMore: U ? L.searchLoadMore : Se,
273
- onRetry: L.retry,
274
- ref: k,
275
- selectedValue: Ee
260
+ /* @__PURE__ */ f(n, {
261
+ error: H ? M.searchError : M.initialLoadError,
262
+ estimatedRowHeight: H ? 44 : void 0,
263
+ hasMore: H ? M.searchNextMarker !== void 0 : M.itemsNextMarker !== void 0,
264
+ hasVariableRowHeight: H,
265
+ isFetching: H ? M.isFetchingSearch : M.isFetching,
266
+ isFetchingMore: H ? M.isFetchingSearchMore : M.isFetchingMore,
267
+ isSearchMode: H,
268
+ items: H ? Me : ke,
269
+ listboxId: T,
270
+ loadMoreError: H ? M.searchLoadMoreError : M.loadMoreError,
271
+ multiSelect: v,
272
+ onFocusExit: () => E.current?.focus(),
273
+ onLoadMore: H ? I.searchLoadMore : we,
274
+ onRetry: I.retry,
275
+ ref: O,
276
+ selectedValue: Oe
276
277
  })
277
278
  ]
278
279
  })]
279
280
  });
280
281
  });
281
- export { h as n, _ as t };
282
+ export { m as n, g as t };
@@ -1,6 +1,6 @@
1
1
  import { messages as e } from "../esm/lib/components/taxonomy-level-filter/messages.js";
2
- import { DropdownMenu as t, TextButton as n } from "@box/blueprint-web";
3
- import { useIntl as r } from "react-intl";
2
+ import { useIntl as t } from "react-intl";
3
+ import { DropdownMenu as n, TextButton as r } from "@box/blueprint-web";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import { Checkmark as o, ChevronDown as s } from "@box/blueprint-web-assets/icons/Medium";
6
6
  import '../styles/taxonomy-level-filter.css';var c = {
@@ -10,35 +10,35 @@ import '../styles/taxonomy-level-filter.css';var c = {
10
10
  levelFilterButton: "_levelFilterButton_mbgfz_26"
11
11
  };
12
12
  function l({ availableLevels: l, levelFilter: u, onLevelFilterChange: d, container: f }) {
13
- let { formatMessage: p } = r(), m = p(e.allOption), h = u === null ? m : l.find((e) => e.level === u)?.displayName ?? m;
13
+ let { formatMessage: p } = t(), m = p(e.allOption), h = u === null ? m : l.find((e) => e.level === u)?.displayName ?? m;
14
14
  return /* @__PURE__ */ i("div", {
15
15
  className: c.container,
16
- children: /* @__PURE__ */ a(t.Root, {
16
+ children: /* @__PURE__ */ a(n.Root, {
17
17
  modal: !1,
18
- children: [/* @__PURE__ */ i(t.Trigger, { children: /* @__PURE__ */ i(n, {
18
+ children: [/* @__PURE__ */ i(n.Trigger, { children: /* @__PURE__ */ i(r, {
19
19
  className: c.levelFilterButton,
20
20
  icon: s,
21
21
  variant: "bodyDefault",
22
22
  children: h
23
- }) }), /* @__PURE__ */ a(t.Content, {
23
+ }) }), /* @__PURE__ */ a(n.Content, {
24
24
  className: c.popoverContent,
25
25
  align: "start",
26
26
  container: f,
27
27
  children: [
28
- /* @__PURE__ */ a(t.Item, {
28
+ /* @__PURE__ */ a(n.Item, {
29
29
  onClick: () => d(null),
30
- children: [/* @__PURE__ */ i(t.Item.StartElement, {
30
+ children: [/* @__PURE__ */ i(n.Item.StartElement, {
31
31
  className: c.itemStartElement,
32
32
  icon: u === null ? o : void 0
33
- }), /* @__PURE__ */ i(t.Item.MainContent, { label: m })]
33
+ }), /* @__PURE__ */ i(n.Item.MainContent, { label: m })]
34
34
  }),
35
- /* @__PURE__ */ i(t.Separator, {}),
36
- l.map((e) => /* @__PURE__ */ a(t.Item, {
35
+ /* @__PURE__ */ i(n.Separator, {}),
36
+ l.map((e) => /* @__PURE__ */ a(n.Item, {
37
37
  onClick: () => d(e.level),
38
- children: [/* @__PURE__ */ i(t.Item.StartElement, {
38
+ children: [/* @__PURE__ */ i(n.Item.StartElement, {
39
39
  className: c.itemStartElement,
40
40
  icon: u === e.level ? o : void 0
41
- }), /* @__PURE__ */ i(t.Item.MainContent, { label: e.displayName })]
41
+ }), /* @__PURE__ */ i(n.Item.MainContent, { label: e.displayName })]
42
42
  }, e.level))
43
43
  ]
44
44
  })]
@@ -2,9 +2,9 @@ import { t as e } from "./taxonomy-ancestor-breadcrumb.js";
2
2
  import { messages as t } from "../esm/lib/components/taxonomy-menu-item/messages.js";
3
3
  import { useTaxonomyMenuItemKeyboard as n } from "../esm/lib/components/taxonomy-menu-item/use-taxonomy-menu-item-keyboard.js";
4
4
  import { memo as r, useCallback as i, useRef as a } from "react";
5
- import { Checkbox as o, EllipsizableText as s, IconButton as c, Radio as l } from "@box/blueprint-web";
6
- import u from "clsx";
7
- import { useIntl as d } from "react-intl";
5
+ import o from "clsx";
6
+ import { useIntl as s } from "react-intl";
7
+ import { Checkbox as c, EllipsizableText as l, IconButton as u, Radio as d } from "@box/blueprint-web";
8
8
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
9
  import { CompositeItem as m } from "@ariakit/react";
10
10
  import { ChevronRight as h } from "@box/blueprint-web-assets/icons/Medium";
@@ -16,7 +16,7 @@ import '../styles/taxonomy-menu-item.css';var g = {
16
16
  content: "_content_1a4ve_41",
17
17
  drillDown: "_drillDown_1a4ve_48"
18
18
  }, _ = /*#__PURE__*/ r(function({ id: r, displayName: _, isSearchMode: v = !1, selectable: y, multiSelect: b, isSelected: x, showDrillDown: S, ancestors: C, onSelect: w, onDrillDown: T, onFocusExit: E }) {
19
- let { formatMessage: D } = d(), O = C != null && C.length > 0 && v, k = a(null), A = a(null), j = a(null), { handleSelectionControlFocus: M, handleRowKeyDown: N, handleRowKeyDownCapture: P, handleSelectionControlKeyDown: F, handleDrillDownKeyDown: I } = n({
19
+ let { formatMessage: D } = s(), O = C != null && C.length > 0 && v, k = a(null), A = a(null), j = a(null), { handleSelectionControlFocus: M, handleRowKeyDown: N, handleRowKeyDownCapture: P, handleSelectionControlKeyDown: F, handleDrillDownKeyDown: I } = n({
20
20
  id: r,
21
21
  multiSelect: b,
22
22
  onSelect: w,
@@ -41,7 +41,7 @@ import '../styles/taxonomy-menu-item.css';var g = {
41
41
  role: "option",
42
42
  "aria-selected": x
43
43
  }),
44
- className: u(g.row, {
44
+ className: o(g.row, {
45
45
  [g.rowWithAncestors]: O,
46
46
  [g.nonSelectable]: !y
47
47
  }),
@@ -50,7 +50,7 @@ import '../styles/taxonomy-menu-item.css';var g = {
50
50
  onKeyDown: N,
51
51
  onKeyDownCapture: P,
52
52
  children: [
53
- y && b && /* @__PURE__ */ f(o.Item, {
53
+ y && b && /* @__PURE__ */ f(c.Item, {
54
54
  ref: A,
55
55
  "aria-label": _,
56
56
  checked: x,
@@ -62,7 +62,7 @@ import '../styles/taxonomy-menu-item.css';var g = {
62
62
  onKeyDown: F,
63
63
  value: r
64
64
  }),
65
- y && !b && /* @__PURE__ */ f(l.Item, {
65
+ y && !b && /* @__PURE__ */ f(d.Item, {
66
66
  ref: A,
67
67
  "aria-label": _,
68
68
  className: g.selectionControl,
@@ -75,14 +75,14 @@ import '../styles/taxonomy-menu-item.css';var g = {
75
75
  }),
76
76
  /* @__PURE__ */ p("div", {
77
77
  className: g.content,
78
- children: [/* @__PURE__ */ f(s, {
78
+ children: [/* @__PURE__ */ f(l, {
79
79
  as: "span",
80
80
  lineClamp: 1,
81
81
  variant: O ? "bodyDefaultBold" : "bodyDefault",
82
82
  children: _
83
83
  }), O && /* @__PURE__ */ f(e, { ancestors: C })]
84
84
  }),
85
- S && /* @__PURE__ */ f(c, {
85
+ S && /* @__PURE__ */ f(u, {
86
86
  ref: j,
87
87
  "aria-label": D(t.drillDownAriaLabel, { name: _ }),
88
88
  className: g.drillDown,
@@ -1 +1 @@
1
- ._container_19xfu_1{box-sizing:border-box;gap:var(--bp-space-020,.5rem);padding-block:var(--bp-space-030,.75rem);padding-inline:var(--bp-size-060,1.5rem) var(--bp-space-010,.5rem);flex-direction:column;width:100%;display:flex}._retryButton_19xfu_11{align-self:flex-start}._errorText_19xfu_15{--text-color-on-light-error:var(--bp-text-text-error-on-color);padding-block-start:var(--bp-space-005)}._reloadButton_19xfu_20{padding-inline-start:var(--bp-space-040,1rem)}
1
+ ._container_1sz1a_1{box-sizing:border-box;gap:var(--bp-space-020,.5rem);padding-block:var(--bp-space-030,.75rem);padding-inline:var(--bp-size-060,1.5rem) var(--bp-space-010,.5rem);flex-direction:column;width:100%;display:flex}._errorText_1sz1a_11{--text-color-on-light-error:var(--bp-text-text-error-on-color);padding-block-start:var(--bp-space-005)}._reloadButton_1sz1a_16{padding-inline-start:var(--bp-space-040,1rem)}
@@ -1 +1 @@
1
- ._container_hdbsq_1{gap:var(--bp-space-020,.5rem);flex-direction:column;width:100%;display:flex}._label_hdbsq_8{color:var(--bp-text-text-on-light);font-size:var(--bp-font-size-040,1rem);font-weight:var(--bp-font-weight-bold,600);line-height:var(--bp-line-height-040,1.5rem);cursor:pointer}._trigger_hdbsq_16{box-sizing:border-box;align-items:center;gap:var(--space-2);width:100%;min-height:var(--bp-size-100,2.5rem);padding-block:var(--bp-space-020,.5rem);padding-inline:var(--bp-space-030,.75rem);color:var(--bp-text-text-on-light);background-color:var(--surface-dropdown-surface);border:var(--bp-border-01,.0625rem) solid var(--bp-border-input-border);border-radius:var(--bp-radius-06,.75rem);font:inherit;cursor:pointer;outline:none;flex-wrap:wrap;display:flex}._trigger_hdbsq_16:has(._searchInput_hdbsq_34:focus){background-color:var(--surface-dropdown-surface-focus);border-color:var(--outline-focus-on-light);border-width:var(--bp-border-02,.125rem)}._trigger_hdbsq_16[data-disabled=true]{opacity:.6;cursor:not-allowed}._trigger_hdbsq_16[data-disabled=true] button{pointer-events:none}._trigger_hdbsq_16 ._chips_hdbsq_46{display:contents}._trigger_hdbsq_16[data-disabled=true] ._chips_hdbsq_46>*{pointer-events:none}input[type=text]._searchInput_hdbsq_34{width:auto;min-width:var(--size-12);color:var(--bp-text-text-on-light);box-shadow:none;font:inherit;font-size:var(--bp-font-size-05,.9375rem);line-height:var(--body-default-line-height,1.25rem);cursor:inherit;background:0 0;border:none;border-radius:0;outline:none;flex:1;padding:0}input[type=text]._searchInput_hdbsq_34:hover,input[type=text]._searchInput_hdbsq_34:focus,input[type=text]._searchInput_hdbsq_34:disabled{box-shadow:none;background:0 0;border:none;border-radius:0;outline:none}input[type=text]._searchInput_hdbsq_34::placeholder{color:var(--bp-text-text-on-light-secondary);font-family:inherit;font-size:var(--bp-font-size-05,.9375rem);font-weight:var(--bp-font-weight-regular,400)}._searchIcon_hdbsq_83{width:var(--bp-size-040,1rem);height:var(--bp-size-040,1rem);color:var(--bp-icon-icon-on-light-secondary);pointer-events:none;flex-shrink:0;margin-inline-start:auto}._emptyState_hdbsq_92{padding-block:var(--space-3);padding-inline:var(--space-3);text-align:center}._popover_hdbsq_98{width:var(--radix-popover-trigger-width);max-width:none}._popover_hdbsq_98 div[data-radix-popper-content-wrapper]:has([role=menu]){background-color:var(--bp-surface-menu-surface-dropdown)}._clearButton_hdbsq_106{flex-shrink:0}._breadcrumbContainer_hdbsq_110{min-width:0;padding-block:var(--bp-space-020,.5rem);padding-inline:var(--bp-space-020,.5rem);border-bottom:var(--bp-border-01,.0625rem) solid var(--bp-border-divider);align-items:center;display:flex}._breadcrumbContainer_hdbsq_110 li:first-child:has(button){margin-inline-start:calc(-1 * var(--bp-space-010,.25rem))}
1
+ ._container_nitxb_1{gap:var(--bp-space-020,.5rem);flex-direction:column;width:100%;display:flex}._label_nitxb_8{cursor:pointer}._trigger_nitxb_12{box-sizing:border-box;align-items:center;gap:var(--space-2);width:100%;min-height:var(--bp-size-100,2.5rem);padding-block:var(--bp-space-020,.5rem);padding-inline:var(--bp-space-030,.75rem);color:var(--bp-text-text-on-light);background-color:var(--surface-dropdown-surface);border:var(--bp-border-01,.0625rem) solid var(--bp-border-input-border);border-radius:var(--bp-radius-06,.75rem);font:inherit;cursor:pointer;outline:none;flex-wrap:wrap;display:flex}._trigger_nitxb_12:has(._searchInput_nitxb_30:focus){background-color:var(--surface-dropdown-surface-focus);border-color:var(--outline-focus-on-light);border-width:var(--bp-border-02,.125rem)}._trigger_nitxb_12[data-disabled=true]{opacity:.6;cursor:not-allowed}._trigger_nitxb_12[data-disabled=true] button{pointer-events:none}._trigger_nitxb_12 ._chips_nitxb_42{display:contents}._trigger_nitxb_12[data-disabled=true] ._chips_nitxb_42>*{pointer-events:none}input[type=text]._searchInput_nitxb_30{width:auto;min-width:var(--size-12);color:var(--bp-text-text-on-light);box-shadow:none;font:inherit;font-size:var(--bp-font-size-05,.9375rem);line-height:var(--body-default-line-height,1.25rem);cursor:inherit;background:0 0;border:none;border-radius:0;outline:none;flex:1;padding:0}input[type=text]._searchInput_nitxb_30:hover,input[type=text]._searchInput_nitxb_30:focus,input[type=text]._searchInput_nitxb_30:disabled{box-shadow:none;background:0 0;border:none;border-radius:0;outline:none}input[type=text]._searchInput_nitxb_30::placeholder{color:var(--bp-text-text-on-light-secondary);font-family:inherit;font-size:var(--bp-font-size-05,.9375rem);font-weight:var(--bp-font-weight-regular,400)}._searchIcon_nitxb_79{width:var(--bp-size-040,1rem);height:var(--bp-size-040,1rem);color:var(--bp-icon-icon-on-light-secondary);pointer-events:none;flex-shrink:0;margin-inline-start:auto}._popover_nitxb_88{width:var(--radix-popover-trigger-width);max-width:none}._popover_nitxb_88 div[data-radix-popper-content-wrapper]:has([role=menu]){background-color:var(--bp-surface-menu-surface-dropdown)}._clearButton_nitxb_96{flex-shrink:0}._breadcrumbContainer_nitxb_100{min-width:0;padding-block:var(--bp-space-020,.5rem);padding-inline:var(--bp-space-020,.5rem);border-bottom:var(--bp-border-01,.0625rem) solid var(--bp-border-divider);align-items:center;display:flex}._breadcrumbContainer_nitxb_100 li:first-child:has(button){margin-inline-start:calc(-1 * var(--bp-space-010,.25rem))}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@box/metadata-taxonomy-picker",
3
- "version": "3.1.33",
3
+ "version": "3.1.35",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@ariakit/react": "^0.4.21",
7
- "@box/blueprint-web": "^16.12.0",
8
- "@box/blueprint-web-assets": "^5.5.7",
7
+ "@box/blueprint-web": "^16.12.1",
8
+ "@box/blueprint-web-assets": "^5.5.8",
9
9
  "@tanstack/react-virtual": "^3.10.8",
10
10
  "react": "^18.0.0",
11
11
  "react-dom": "^18.0.0",
@@ -13,10 +13,10 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "^0.4.21",
16
- "@box/blueprint-web": "^16.12.0",
17
- "@box/blueprint-web-assets": "^5.5.7",
16
+ "@box/blueprint-web": "^16.12.1",
17
+ "@box/blueprint-web-assets": "^5.5.8",
18
18
  "@box/eslint-plugin-blueprint": "2.1.10",
19
- "@box/storybook-utils": "1.1.31",
19
+ "@box/storybook-utils": "1.1.32",
20
20
  "@tanstack/react-virtual": "^3.10.8",
21
21
  "react-intl": "^6.4.2"
22
22
  },