@box/metadata-taxonomy-picker 3.1.1 → 3.1.2

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.
@@ -3,64 +3,64 @@ 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 ne } from "react";
7
- import { Breadcrumb as re, ChipsGroup as ie, IconButton as ae, InputChip as u, Popover as d, useForkRef as oe } from "@box/blueprint-web";
8
- import { Search as se, XMark as ce } from "@box/blueprint-web-assets/icons/Fill";
9
- import le from "clsx";
10
- import { useIntl as ue } from "react-intl";
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) {
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) {
13
13
  return e.SingleLevel = "single-level", e.MultiLevel = "multi-level", e;
14
- }({}), h = {
15
- container: "_container_bnccr_1",
16
- label: "_label_bnccr_8",
17
- trigger: "_trigger_bnccr_16",
18
- searchInput: "_searchInput_bnccr_34",
19
- chips: "_chips_bnccr_47",
20
- searchIcon: "_searchIcon_bnccr_73",
21
- emptyState: "_emptyState_bnccr_81",
22
- popover: "_popover_bnccr_87",
23
- clearButton: "_clearButton_bnccr_92",
24
- breadcrumbContainer: "_breadcrumbContainer_bnccr_96"
14
+ }({}), g = {
15
+ container: "_container_z60ed_1",
16
+ label: "_label_z60ed_8",
17
+ trigger: "_trigger_z60ed_16",
18
+ searchInput: "_searchInput_z60ed_34",
19
+ chips: "_chips_z60ed_47",
20
+ searchIcon: "_searchIcon_z60ed_73",
21
+ emptyState: "_emptyState_z60ed_81",
22
+ popover: "_popover_z60ed_87",
23
+ clearButton: "_clearButton_z60ed_95",
24
+ breadcrumbContainer: "_breadcrumbContainer_z60ed_99"
25
25
  };
26
- function de(e) {
26
+ function ue(e) {
27
27
  let t = null;
28
28
  for (let n of e) n.selectable !== !1 && (t === null || n.level > t) && (t = n.level);
29
29
  return t;
30
30
  }
31
- var fe = [];
32
- function pe(e) {
31
+ var de = [];
32
+ function fe(e) {
33
33
  if (e != null) return (typeof e == "function" ? e() : e) ?? void 0;
34
34
  }
35
- var g = /*#__PURE__*/ a(function({ itemsService: a, eventService: g, levels: _ = fe, mode: me, multiSelect: v, value: y, onValueChange: b, placeholder: he, disabled: x = !1, label: S, containerClassName: ge, portalElement: _e }, ve) {
36
- let { formatMessage: C } = ue(), w = te(), T = `${w}-listbox`, E = l(null), ye = oe(E, ve), D = l(null), O = l(null), k = l(0), A = l(!1), be = pe(_e), j = me === 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: xe, setSearchScopeOverride: V } = I, H = M.searchInputValue !== "", U = c(() => de(M.availableLevels), [M.availableLevels]);
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]);
37
37
  ee(() => {
38
- V(j && U !== null ? {
38
+ H(M && W !== null ? {
39
39
  parentId: null,
40
- levelFilter: U
40
+ levelFilter: W
41
41
  } : void 0);
42
42
  }, [
43
- j,
44
- U,
45
- V
43
+ M,
44
+ W,
45
+ H
46
46
  ]);
47
- let [Se, W] = ne(""), G = l(!1), Ce = o(() => {
48
- G.current = !0;
49
- }, []), we = o((e) => {
50
- G.current = !1, F(e.target.value);
51
- }, [F]);
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]);
52
52
  s(() => {
53
- G.current ? M.searchInputValue === "" && (G.current = !1, W("")) : W(M.searchInputValue);
54
- }, [M.searchInputValue]), s(() => {
53
+ K.current ? N.searchInputValue === "" && (K.current = !1, G("")) : G(N.searchInputValue);
54
+ }, [N.searchInputValue]), s(() => {
55
55
  let e;
56
- return !H && A.current && (e = requestAnimationFrame(() => {
57
- O.current?.scrollTo(k.current);
58
- })), A.current = H, () => {
56
+ return !U && j.current && (e = requestAnimationFrame(() => {
57
+ k.current?.scrollTo(A.current);
58
+ })), j.current = U, () => {
59
59
  e !== void 0 && cancelAnimationFrame(e);
60
60
  };
61
- }, [H]);
62
- let K = c(() => new Set(y.map((e) => e.id)), [y]), Te = c(() => !v && y.length === 1 ? y[0].id : "", [v, y]), q = o((e, t = !0) => {
63
- let n = L.find((t) => t.id === e);
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);
64
64
  if (!n || !n.selectable) return;
65
65
  let r = {
66
66
  id: n.id,
@@ -68,16 +68,16 @@ var g = /*#__PURE__*/ a(function({ itemsService: a, eventService: g, levels: _ =
68
68
  level: n.level,
69
69
  ancestors: n.ancestors
70
70
  };
71
- v ? b(K.has(e) ? y.filter((t) => t.id !== e) : [...y, r]) : (b([r]), t && P(!1));
71
+ y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t && F(!1));
72
72
  }, [
73
- L,
74
- v,
75
- K,
73
+ R,
76
74
  y,
75
+ q,
77
76
  b,
78
- P
79
- ]), J = o((e, t = !0) => {
80
- let n = M.searchResults.find((t) => t.id === e);
77
+ x,
78
+ F
79
+ ]), Y = o((e, t = !0) => {
80
+ let n = N.searchResults.find((t) => t.id === e);
81
81
  if (!n || !n.selectable) return;
82
82
  let r = {
83
83
  id: n.id,
@@ -85,194 +85,196 @@ var g = /*#__PURE__*/ a(function({ itemsService: a, eventService: g, levels: _ =
85
85
  level: n.level,
86
86
  ancestors: n.ancestors
87
87
  };
88
- v ? b(K.has(e) ? y.filter((t) => t.id !== e) : [...y, r]) : (b([r]), t !== !1 && P(!1));
88
+ y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t !== !1 && F(!1));
89
89
  }, [
90
- M.searchResults,
91
- v,
92
- K,
90
+ N.searchResults,
93
91
  y,
92
+ q,
94
93
  b,
95
- P
96
- ]), Y = o((e) => {
97
- let t = M.searchResults.find((t) => t.id === e);
98
- t && I.drillDown({
94
+ x,
95
+ F
96
+ ]), X = o((e) => {
97
+ let t = N.searchResults.find((t) => t.id === e);
98
+ t && L.drillDown({
99
99
  id: t.id,
100
100
  displayName: t.displayName,
101
101
  ancestors: t.ancestors
102
102
  });
103
- }, [M.searchResults, I]), X = o((e) => {
104
- let t = M.items.find((t) => t.id === e);
105
- t && z({
103
+ }, [N.searchResults, L]), De = o((e) => {
104
+ let t = N.items.find((t) => t.id === e);
105
+ t && B({
106
106
  id: t.id,
107
107
  displayName: t.displayName
108
108
  });
109
- }, [M.items, z]), Z = o((e) => !(!e.hasChildren || j && U !== null && e.level >= U), [j, U]), Ee = c(() => L.map((e) => ({
109
+ }, [N.items, B]), Z = o((e) => !(!e.hasChildren || M && W !== null && e.level >= W), [M, W]), Oe = c(() => R.map((e) => ({
110
110
  id: e.id,
111
111
  displayName: e.displayName,
112
112
  selectable: e.selectable,
113
- multiSelect: v,
114
- isSelected: K.has(e.id),
113
+ multiSelect: y,
114
+ isSelected: q.has(e.id),
115
115
  showDrillDown: Z(e),
116
116
  ancestors: e.ancestors,
117
- onSelect: q,
118
- onDrillDown: X
117
+ onSelect: J,
118
+ onDrillDown: De
119
119
  })), [
120
- L,
121
- v,
122
- K,
123
- Z,
120
+ R,
121
+ y,
124
122
  q,
125
- X
126
- ]), Q = c(() => R.length === 0 ? [] : [{
123
+ Z,
124
+ J,
125
+ De
126
+ ]), Q = c(() => z.length === 0 ? [] : [{
127
127
  id: e,
128
- name: C(i.breadcrumbRootLabel)
129
- }, ...R.map((e) => ({
128
+ name: w(i.breadcrumbRootLabel)
129
+ }, ...z.map((e) => ({
130
130
  id: e.id,
131
131
  name: e.displayName
132
- }))], [R, C]), De = o((e) => {
133
- B(e === "__breadcrumb_root__" ? null : e);
134
- }, [B]), Oe = !j && H && M.availableLevels.length > 1, ke = c(() => M.searchResults.map((e) => ({
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) => ({
135
135
  id: e.id,
136
136
  displayName: e.displayName,
137
137
  selectable: e.selectable,
138
- multiSelect: v,
139
- isSelected: K.has(e.id),
138
+ multiSelect: y,
139
+ isSelected: q.has(e.id),
140
140
  showDrillDown: Z(e),
141
141
  ancestors: e.ancestors,
142
- onSelect: J,
143
- onDrillDown: Y
142
+ onSelect: Y,
143
+ onDrillDown: X
144
144
  })), [
145
- M.searchResults,
146
- v,
147
- K,
145
+ N.searchResults,
146
+ y,
147
+ q,
148
148
  Z,
149
- J,
150
- Y
151
- ]), Ae = o((e) => {
152
- e.target === e.currentTarget && E.current?.focus();
153
- }, [E]), $ = y.length > 0, je = he ?? C(i.placeholder), Me = (e) => {
154
- !x && e.target === e.currentTarget && (e.preventDefault(), E.current?.focus());
155
- }, Ne = () => {
156
- !x && !N && P(!0);
157
- }, Pe = o(() => {
158
- x || (b([]), F(""));
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(""));
159
159
  }, [
160
+ S,
160
161
  x,
161
- b,
162
- F
163
- ]), Fe = (e) => {
164
- !H && e.target.value && (k.current = O.current?.getScrollTop() ?? 0), W(e.target.value), G.current || F(e.target.value);
165
- }, Ie = (e) => {
166
- x || b(y.filter((t) => t.id !== e.id));
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));
167
167
  };
168
- return /* @__PURE__ */ p(d.Root, {
168
+ return /* @__PURE__ */ m(f.Root, {
169
169
  modal: !1,
170
- onOpenChange: P,
171
- open: N,
172
- children: [/* @__PURE__ */ f(d.Anchor, { children: /* @__PURE__ */ p("div", {
173
- className: le(h.container, ge),
174
- children: [S && /* @__PURE__ */ f("label", {
175
- className: h.label,
176
- htmlFor: w,
177
- children: S
178
- }), /* @__PURE__ */ p("div", {
179
- className: h.trigger,
180
- "data-disabled": x,
181
- onMouseDown: Me,
182
- ref: D,
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,
183
183
  children: [
184
- v && $ && /* @__PURE__ */ f(ie, {
185
- onClick: Ae,
186
- children: y.map((e) => /* @__PURE__ */ f(u, {
184
+ y && $ && /* @__PURE__ */ p(re, {
185
+ onClick: Me,
186
+ children: b.map((e) => /* @__PURE__ */ p(d, {
187
187
  label: e.displayName,
188
- onDelete: () => Ie(e),
189
- tabIndex: x ? -1 : void 0
188
+ onDelete: () => Re(e),
189
+ tabIndex: S ? -1 : void 0
190
190
  }, e.id))
191
191
  }),
192
- !v && $ && /* @__PURE__ */ f(u, {
193
- label: y[0].displayName,
194
- tabIndex: x ? -1 : void 0
192
+ !y && $ && /* @__PURE__ */ p(d, {
193
+ label: b[0].displayName,
194
+ tabIndex: S ? -1 : void 0
195
195
  }),
196
- /* @__PURE__ */ f("input", {
197
- "aria-controls": T,
198
- "aria-expanded": N,
196
+ /* @__PURE__ */ p("input", {
197
+ "aria-controls": E,
198
+ "aria-expanded": P,
199
199
  "aria-haspopup": "listbox",
200
- className: h.searchInput,
201
- disabled: x,
202
- id: w,
203
- onChange: Fe,
204
- onCompositionStart: Ce,
205
- onCompositionEnd: we,
206
- onFocus: Ne,
207
- placeholder: $ ? void 0 : je,
208
- ref: ye,
200
+ className: g.searchInput,
201
+ disabled: S,
202
+ id: T,
203
+ onChange: Le,
204
+ onCompositionStart: we,
205
+ onCompositionEnd: Te,
206
+ onFocus: Fe,
207
+ placeholder: $ ? void 0 : Ne,
208
+ ref: ve,
209
209
  role: "combobox",
210
210
  type: "text",
211
- value: Se
211
+ value: Ce
212
212
  }),
213
- !v && $ && /* @__PURE__ */ f(ae, {
214
- "aria-label": C(i.clearAriaLabel),
215
- className: h.clearButton,
216
- icon: ce,
213
+ !y && $ && /* @__PURE__ */ p(ie, {
214
+ "aria-label": w(i.clearAriaLabel),
215
+ className: g.clearButton,
216
+ icon: se,
217
217
  size: "x-small",
218
- tabIndex: x ? -1 : void 0,
219
- onClick: Pe
218
+ tabIndex: S ? -1 : void 0,
219
+ onClick: Ie
220
220
  }),
221
- /* @__PURE__ */ f(se, {
221
+ /* @__PURE__ */ p(oe, {
222
222
  "aria-hidden": "true",
223
- className: h.searchIcon,
223
+ className: g.searchIcon,
224
224
  role: "presentation"
225
225
  })
226
226
  ]
227
227
  })]
228
- }) }), /* @__PURE__ */ p(d.ContentContainer, {
228
+ }) }), /* @__PURE__ */ m(f.ContentContainer, {
229
229
  align: "start",
230
- className: h.popover,
231
- container: be,
230
+ className: g.popover,
231
+ container: xe,
232
232
  onInteractOutside: (e) => {
233
- D.current?.contains(e.target) && e.preventDefault();
233
+ O.current?.contains(e.target) && e.preventDefault();
234
234
  },
235
235
  onOpenAutoFocus: (e) => e.preventDefault(),
236
+ ref: be,
236
237
  children: [
237
- Q.length > 0 && !H && /* @__PURE__ */ f("div", {
238
- className: h.breadcrumbContainer,
239
- children: /* @__PURE__ */ f(re, {
240
- breadcrumbAriaLabel: C(i.breadcrumbAriaLabel),
238
+ Q.length > 0 && !U && /* @__PURE__ */ p("div", {
239
+ className: g.breadcrumbContainer,
240
+ children: /* @__PURE__ */ p(ne, {
241
+ breadcrumbAriaLabel: w(i.breadcrumbAriaLabel),
241
242
  crumbs: Q,
242
- onPageLinkClick: De,
243
+ onPageLinkClick: ke,
243
244
  rootIconVariant: "taxonomy",
244
- isInteractive: !x,
245
+ isInteractive: !S,
245
246
  isResponsiveEnabled: !1,
246
247
  size: "small",
247
- truncatedLinksIconAriaLabel: C(i.breadcrumbTruncatedLinksLabel),
248
+ truncatedLinksIconAriaLabel: w(i.breadcrumbTruncatedLinksLabel),
248
249
  truncationMethod: "folder-tree"
249
250
  })
250
251
  }),
251
- Oe && /* @__PURE__ */ f(r, {
252
- availableLevels: _,
253
- levelFilter: M.levelFilter,
254
- onLevelFilterChange: I.setLevelFilter
252
+ Ae && /* @__PURE__ */ p(r, {
253
+ availableLevels: v,
254
+ container: ye,
255
+ levelFilter: N.levelFilter,
256
+ onLevelFilterChange: L.setLevelFilter
255
257
  }),
256
- /* @__PURE__ */ f(n, {
257
- error: H ? M.searchError : M.initialLoadError,
258
- estimatedRowHeight: H ? 44 : void 0,
259
- hasMore: H ? M.searchNextMarker !== void 0 : M.itemsNextMarker !== void 0,
260
- hasVariableRowHeight: H,
261
- isFetching: H ? M.isFetchingSearch : M.isFetching,
262
- isFetchingMore: H ? M.isFetchingSearchMore : M.isFetchingMore,
263
- isSearchMode: H,
264
- items: H ? ke : Ee,
265
- listboxId: T,
266
- loadMoreError: H ? M.searchLoadMoreError : M.loadMoreError,
267
- multiSelect: v,
268
- onFocusExit: () => E.current?.focus(),
269
- onLoadMore: H ? I.searchLoadMore : xe,
270
- onRetry: I.retry,
271
- ref: O,
272
- selectedValue: Te
258
+ /* @__PURE__ */ p(n, {
259
+ error: U ? N.searchError : N.initialLoadError,
260
+ estimatedRowHeight: U ? 44 : void 0,
261
+ hasMore: U ? N.searchNextMarker !== void 0 : N.itemsNextMarker !== void 0,
262
+ hasVariableRowHeight: U,
263
+ isFetching: U ? N.isFetchingSearch : N.isFetching,
264
+ isFetchingMore: U ? N.isFetchingSearchMore : N.isFetchingMore,
265
+ isSearchMode: U,
266
+ items: U ? je : Oe,
267
+ listboxId: E,
268
+ loadMoreError: U ? N.searchLoadMoreError : N.loadMoreError,
269
+ multiSelect: y,
270
+ onFocusExit: () => D.current?.focus(),
271
+ onLoadMore: U ? L.searchLoadMore : Se,
272
+ onRetry: L.retry,
273
+ ref: k,
274
+ selectedValue: Ee
273
275
  })
274
276
  ]
275
277
  })]
276
278
  });
277
279
  });
278
- export { m as n, g as t };
280
+ export { h as n, _ as t };
@@ -9,8 +9,8 @@ import '../styles/taxonomy-level-filter.css';var c = {
9
9
  itemStartElement: "_itemStartElement_mbgfz_16",
10
10
  levelFilterButton: "_levelFilterButton_mbgfz_26"
11
11
  };
12
- function l({ availableLevels: l, levelFilter: u, onLevelFilterChange: d }) {
13
- let { formatMessage: f } = r(), p = f(e.allOption), m = u === null ? p : l.find((e) => e.level === u)?.displayName ?? p;
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;
14
14
  return /* @__PURE__ */ i("div", {
15
15
  className: c.container,
16
16
  children: /* @__PURE__ */ a(t.Root, {
@@ -19,17 +19,18 @@ function l({ availableLevels: l, levelFilter: u, onLevelFilterChange: d }) {
19
19
  className: c.levelFilterButton,
20
20
  icon: s,
21
21
  variant: "bodyDefault",
22
- children: m
22
+ children: h
23
23
  }) }), /* @__PURE__ */ a(t.Content, {
24
24
  className: c.popoverContent,
25
25
  align: "start",
26
+ container: f,
26
27
  children: [
27
28
  /* @__PURE__ */ a(t.Item, {
28
29
  onClick: () => d(null),
29
30
  children: [/* @__PURE__ */ i(t.Item.StartElement, {
30
31
  className: c.itemStartElement,
31
32
  icon: u === null ? o : void 0
32
- }), /* @__PURE__ */ i(t.Item.MainContent, { label: p })]
33
+ }), /* @__PURE__ */ i(t.Item.MainContent, { label: m })]
33
34
  }),
34
35
  /* @__PURE__ */ i(t.Separator, {}),
35
36
  l.map((e) => /* @__PURE__ */ a(t.Item, {
@@ -1 +1 @@
1
- ._container_bnccr_1{gap:var(--bp-space-020,.5rem);flex-direction:column;width:100%;display:flex}._label_bnccr_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_bnccr_16{box-sizing:border-box;align-items:center;gap:var(--space-2);width:100%;min-height:var(--bp-size-090,2.25rem);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_bnccr_16:has(._searchInput_bnccr_34:focus){background-color:var(--surface-dropdown-surface-focus);border-color:var(--outline-focus-on-light);border-width:var(--bp-border-02,.125rem)}._trigger_bnccr_16[data-disabled=true]{opacity:.6;cursor:not-allowed}._trigger_bnccr_16[data-disabled=true] button{pointer-events:none}._chips_bnccr_47{gap:var(--space-2);flex-wrap:wrap;display:flex}._trigger_bnccr_16[data-disabled=true] ._chips_bnccr_47{pointer-events:none}._searchInput_bnccr_34{min-width:var(--size-12);color:var(--bp-text-text-on-light);font:inherit;cursor:inherit;background:0 0;border:none;outline:none;flex:1;padding:0}._searchInput_bnccr_34::placeholder{color:var(--bp-text-text-on-light-secondary);font-size:var(--bp-font-size-05,.9375rem);font-weight:var(--bp-font-weight-regular,400)}._searchIcon_bnccr_73{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}._emptyState_bnccr_81{padding-block:var(--space-3);padding-inline:var(--space-3);text-align:center}._popover_bnccr_87{width:var(--radix-popover-trigger-width);max-width:none}._clearButton_bnccr_92{flex-shrink:0}._breadcrumbContainer_bnccr_96{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_bnccr_96 li:first-child:has(button){margin-inline-start:calc(-1 * var(--bp-space-010,.25rem))}
1
+ ._container_z60ed_1{gap:var(--bp-space-020,.5rem);flex-direction:column;width:100%;display:flex}._label_z60ed_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_z60ed_16{box-sizing:border-box;align-items:center;gap:var(--space-2);width:100%;min-height:var(--bp-size-090,2.25rem);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_z60ed_16:has(._searchInput_z60ed_34:focus){background-color:var(--surface-dropdown-surface-focus);border-color:var(--outline-focus-on-light);border-width:var(--bp-border-02,.125rem)}._trigger_z60ed_16[data-disabled=true]{opacity:.6;cursor:not-allowed}._trigger_z60ed_16[data-disabled=true] button{pointer-events:none}._chips_z60ed_47{gap:var(--space-2);flex-wrap:wrap;display:flex}._trigger_z60ed_16[data-disabled=true] ._chips_z60ed_47{pointer-events:none}._searchInput_z60ed_34{min-width:var(--size-12);color:var(--bp-text-text-on-light);font:inherit;cursor:inherit;background:0 0;border:none;outline:none;flex:1;padding:0}._searchInput_z60ed_34::placeholder{color:var(--bp-text-text-on-light-secondary);font-size:var(--bp-font-size-05,.9375rem);font-weight:var(--bp-font-weight-regular,400)}._searchIcon_z60ed_73{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}._emptyState_z60ed_81{padding-block:var(--space-3);padding-inline:var(--space-3);text-align:center}._popover_z60ed_87{width:var(--radix-popover-trigger-width);max-width:none}._popover_z60ed_87 div[data-radix-popper-content-wrapper]:has([role=menu]){background-color:var(--bp-surface-menu-surface-dropdown)}._clearButton_z60ed_95{flex-shrink:0}._breadcrumbContainer_z60ed_99{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_z60ed_99 li:first-child:has(button){margin-inline-start:calc(-1 * var(--bp-space-010,.25rem))}
@@ -3,9 +3,15 @@ export interface TaxonomyLevelFilterProps {
3
3
  availableLevels: readonly TaxonomyLevel[];
4
4
  levelFilter: number | null;
5
5
  onLevelFilterChange: (level: number | null) => void;
6
+ /**
7
+ * Element to portal the dropdown content into. Defaults to `document.body`.
8
+ * Passed by the picker shell so the menu mounts inside the popover and stays
9
+ * within its dismissable layer.
10
+ */
11
+ container?: HTMLElement | null;
6
12
  }
7
13
  /**
8
14
  * Dropdown above the search results that scopes search to a single taxonomy
9
15
  * level. "All levels" clears the filter.
10
16
  */
11
- export declare function TaxonomyLevelFilter({ availableLevels, levelFilter, onLevelFilterChange }: TaxonomyLevelFilterProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function TaxonomyLevelFilter({ availableLevels, levelFilter, onLevelFilterChange, container, }: TaxonomyLevelFilterProps): import("react/jsx-runtime").JSX.Element;
@@ -77,6 +77,19 @@ export declare const LevelFilterAutoSelectsChildLevelAfterDrillDown: Story;
77
77
  * available taxonomy level.
78
78
  */
79
79
  export declare const LevelFilterDropdownListsAllLevels: Story;
80
+ /**
81
+ * The level filter dropdown renders inside the picker's popover layer rather
82
+ * than as a separate `document.body` portal. This keeps the menu within the
83
+ * popover's dismissable layer, so interacting with it does not dismiss the
84
+ * picker.
85
+ */
86
+ export declare const LevelFilterDropdownRendersInsidePickerPopover: Story;
87
+ /**
88
+ * Opening the level filter dropdown keeps the picker popover open — the menu
89
+ * is inside the dismissable layer, so opening it is not treated as an
90
+ * interaction outside the picker.
91
+ */
92
+ export declare const OpeningLevelFilterKeepsPickerOpen: Story;
80
93
  /**
81
94
  * Selecting a level from the dropdown re-runs the search restricted to that
82
95
  * level, so only matching nodes from that level appear.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-taxonomy-picker",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@ariakit/react": "^0.4.21",