@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.
- package/dist/chunks/metadata-taxonomy-picker-shell.js +176 -174
- package/dist/chunks/taxonomy-level-filter.js +5 -4
- package/dist/styles/metadata-taxonomy-picker-shell.css +1 -1
- package/dist/types/lib/components/taxonomy-level-filter/taxonomy-level-filter.d.ts +7 -1
- package/dist/types/lib/stories/tests/level-filter.interaction-tests.stories.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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
|
|
7
|
-
import { Breadcrumb as
|
|
8
|
-
import { Search as
|
|
9
|
-
import
|
|
10
|
-
import { useIntl as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import '../styles/metadata-taxonomy-picker-shell.css';var
|
|
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
|
-
}({}),
|
|
15
|
-
container: "
|
|
16
|
-
label: "
|
|
17
|
-
trigger: "
|
|
18
|
-
searchInput: "
|
|
19
|
-
chips: "
|
|
20
|
-
searchIcon: "
|
|
21
|
-
emptyState: "
|
|
22
|
-
popover: "
|
|
23
|
-
clearButton: "
|
|
24
|
-
breadcrumbContainer: "
|
|
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
|
|
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
|
|
32
|
-
function
|
|
31
|
+
var de = [];
|
|
32
|
+
function fe(e) {
|
|
33
33
|
if (e != null) return (typeof e == "function" ? e() : e) ?? void 0;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
36
|
-
let { formatMessage:
|
|
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
|
-
|
|
38
|
+
H(M && W !== null ? {
|
|
39
39
|
parentId: null,
|
|
40
|
-
levelFilter:
|
|
40
|
+
levelFilter: W
|
|
41
41
|
} : void 0);
|
|
42
42
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
M,
|
|
44
|
+
W,
|
|
45
|
+
H
|
|
46
46
|
]);
|
|
47
|
-
let [
|
|
48
|
-
|
|
49
|
-
}, []),
|
|
50
|
-
|
|
51
|
-
}, [
|
|
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
|
-
|
|
54
|
-
}, [
|
|
53
|
+
K.current ? N.searchInputValue === "" && (K.current = !1, G("")) : G(N.searchInputValue);
|
|
54
|
+
}, [N.searchInputValue]), s(() => {
|
|
55
55
|
let e;
|
|
56
|
-
return !
|
|
57
|
-
|
|
58
|
-
})),
|
|
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
|
-
}, [
|
|
62
|
-
let
|
|
63
|
-
let n =
|
|
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
|
-
|
|
71
|
+
y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t && F(!1));
|
|
72
72
|
}, [
|
|
73
|
-
|
|
74
|
-
v,
|
|
75
|
-
K,
|
|
73
|
+
R,
|
|
76
74
|
y,
|
|
75
|
+
q,
|
|
77
76
|
b,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
88
|
+
y ? x(q.has(e) ? b.filter((t) => t.id !== e) : [...b, r]) : (x([r]), t !== !1 && F(!1));
|
|
89
89
|
}, [
|
|
90
|
-
|
|
91
|
-
v,
|
|
92
|
-
K,
|
|
90
|
+
N.searchResults,
|
|
93
91
|
y,
|
|
92
|
+
q,
|
|
94
93
|
b,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
t
|
|
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
|
-
}, [
|
|
104
|
-
let t =
|
|
105
|
-
t &&
|
|
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
|
-
}, [
|
|
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:
|
|
114
|
-
isSelected:
|
|
113
|
+
multiSelect: y,
|
|
114
|
+
isSelected: q.has(e.id),
|
|
115
115
|
showDrillDown: Z(e),
|
|
116
116
|
ancestors: e.ancestors,
|
|
117
|
-
onSelect:
|
|
118
|
-
onDrillDown:
|
|
117
|
+
onSelect: J,
|
|
118
|
+
onDrillDown: De
|
|
119
119
|
})), [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
K,
|
|
123
|
-
Z,
|
|
120
|
+
R,
|
|
121
|
+
y,
|
|
124
122
|
q,
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
Z,
|
|
124
|
+
J,
|
|
125
|
+
De
|
|
126
|
+
]), Q = c(() => z.length === 0 ? [] : [{
|
|
127
127
|
id: e,
|
|
128
|
-
name:
|
|
129
|
-
}, ...
|
|
128
|
+
name: w(i.breadcrumbRootLabel)
|
|
129
|
+
}, ...z.map((e) => ({
|
|
130
130
|
id: e.id,
|
|
131
131
|
name: e.displayName
|
|
132
|
-
}))], [
|
|
133
|
-
|
|
134
|
-
}, [
|
|
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:
|
|
139
|
-
isSelected:
|
|
138
|
+
multiSelect: y,
|
|
139
|
+
isSelected: q.has(e.id),
|
|
140
140
|
showDrillDown: Z(e),
|
|
141
141
|
ancestors: e.ancestors,
|
|
142
|
-
onSelect:
|
|
143
|
-
onDrillDown:
|
|
142
|
+
onSelect: Y,
|
|
143
|
+
onDrillDown: X
|
|
144
144
|
})), [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
N.searchResults,
|
|
146
|
+
y,
|
|
147
|
+
q,
|
|
148
148
|
Z,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
]),
|
|
152
|
-
e.target === e.currentTarget &&
|
|
153
|
-
}, [
|
|
154
|
-
!
|
|
155
|
-
},
|
|
156
|
-
!
|
|
157
|
-
},
|
|
158
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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__ */
|
|
168
|
+
return /* @__PURE__ */ m(f.Root, {
|
|
169
169
|
modal: !1,
|
|
170
|
-
onOpenChange:
|
|
171
|
-
open:
|
|
172
|
-
children: [/* @__PURE__ */ f
|
|
173
|
-
className:
|
|
174
|
-
children: [
|
|
175
|
-
className:
|
|
176
|
-
htmlFor:
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
179
|
-
className:
|
|
180
|
-
"data-disabled":
|
|
181
|
-
onMouseDown:
|
|
182
|
-
ref:
|
|
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
|
-
|
|
185
|
-
onClick:
|
|
186
|
-
children:
|
|
184
|
+
y && $ && /* @__PURE__ */ p(re, {
|
|
185
|
+
onClick: Me,
|
|
186
|
+
children: b.map((e) => /* @__PURE__ */ p(d, {
|
|
187
187
|
label: e.displayName,
|
|
188
|
-
onDelete: () =>
|
|
189
|
-
tabIndex:
|
|
188
|
+
onDelete: () => Re(e),
|
|
189
|
+
tabIndex: S ? -1 : void 0
|
|
190
190
|
}, e.id))
|
|
191
191
|
}),
|
|
192
|
-
!
|
|
193
|
-
label:
|
|
194
|
-
tabIndex:
|
|
192
|
+
!y && $ && /* @__PURE__ */ p(d, {
|
|
193
|
+
label: b[0].displayName,
|
|
194
|
+
tabIndex: S ? -1 : void 0
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
"aria-controls":
|
|
198
|
-
"aria-expanded":
|
|
196
|
+
/* @__PURE__ */ p("input", {
|
|
197
|
+
"aria-controls": E,
|
|
198
|
+
"aria-expanded": P,
|
|
199
199
|
"aria-haspopup": "listbox",
|
|
200
|
-
className:
|
|
201
|
-
disabled:
|
|
202
|
-
id:
|
|
203
|
-
onChange:
|
|
204
|
-
onCompositionStart:
|
|
205
|
-
onCompositionEnd:
|
|
206
|
-
onFocus:
|
|
207
|
-
placeholder: $ ? void 0 :
|
|
208
|
-
ref:
|
|
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:
|
|
211
|
+
value: Ce
|
|
212
212
|
}),
|
|
213
|
-
!
|
|
214
|
-
"aria-label":
|
|
215
|
-
className:
|
|
216
|
-
icon:
|
|
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:
|
|
219
|
-
onClick:
|
|
218
|
+
tabIndex: S ? -1 : void 0,
|
|
219
|
+
onClick: Ie
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ p(oe, {
|
|
222
222
|
"aria-hidden": "true",
|
|
223
|
-
className:
|
|
223
|
+
className: g.searchIcon,
|
|
224
224
|
role: "presentation"
|
|
225
225
|
})
|
|
226
226
|
]
|
|
227
227
|
})]
|
|
228
|
-
}) }), /* @__PURE__ */
|
|
228
|
+
}) }), /* @__PURE__ */ m(f.ContentContainer, {
|
|
229
229
|
align: "start",
|
|
230
|
-
className:
|
|
231
|
-
container:
|
|
230
|
+
className: g.popover,
|
|
231
|
+
container: xe,
|
|
232
232
|
onInteractOutside: (e) => {
|
|
233
|
-
|
|
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 && !
|
|
238
|
-
className:
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
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:
|
|
243
|
+
onPageLinkClick: ke,
|
|
243
244
|
rootIconVariant: "taxonomy",
|
|
244
|
-
isInteractive: !
|
|
245
|
+
isInteractive: !S,
|
|
245
246
|
isResponsiveEnabled: !1,
|
|
246
247
|
size: "small",
|
|
247
|
-
truncatedLinksIconAriaLabel:
|
|
248
|
+
truncatedLinksIconAriaLabel: w(i.breadcrumbTruncatedLinksLabel),
|
|
248
249
|
truncationMethod: "folder-tree"
|
|
249
250
|
})
|
|
250
251
|
}),
|
|
251
|
-
|
|
252
|
-
availableLevels:
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
Ae && /* @__PURE__ */ p(r, {
|
|
253
|
+
availableLevels: v,
|
|
254
|
+
container: ye,
|
|
255
|
+
levelFilter: N.levelFilter,
|
|
256
|
+
onLevelFilterChange: L.setLevelFilter
|
|
255
257
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
error:
|
|
258
|
-
estimatedRowHeight:
|
|
259
|
-
hasMore:
|
|
260
|
-
hasVariableRowHeight:
|
|
261
|
-
isFetching:
|
|
262
|
-
isFetchingMore:
|
|
263
|
-
isSearchMode:
|
|
264
|
-
items:
|
|
265
|
-
listboxId:
|
|
266
|
-
loadMoreError:
|
|
267
|
-
multiSelect:
|
|
268
|
-
onFocusExit: () =>
|
|
269
|
-
onLoadMore:
|
|
270
|
-
onRetry:
|
|
271
|
-
ref:
|
|
272
|
-
selectedValue:
|
|
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 {
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
.
|
|
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.
|