@wrdagency/blockout 1.0.13 → 1.0.17
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/assets/index2.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/style10.css +1 -1
- package/dist/assets/style2.css +1 -1
- package/dist/assets/style21.css +1 -1
- package/dist/assets/style3.css +1 -1
- package/dist/assets/style4.css +1 -1
- package/dist/assets/style5.css +1 -1
- package/dist/assets/style6.css +1 -1
- package/dist/assets/style7.css +1 -1
- package/dist/assets/style8.css +1 -1
- package/dist/assets/style9.css +1 -1
- package/dist/combobox-popover-DcwyOnhG.js +650 -0
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +24 -19
- package/dist/components/breadcrumbs/index.js +2 -2
- package/dist/components/button/button.js +2 -2
- package/dist/components/button/icon.js +1 -1
- package/dist/components/controls/base-popover-control/index.js +1 -1
- package/dist/components/controls/checkbox-control/index.js +1 -1
- package/dist/components/controls/choice-control/choice.js +1 -1
- package/dist/components/controls/choice-control/index.js +1 -1
- package/dist/components/controls/date-control/index.js +1 -1
- package/dist/components/controls/list-control/item.js +1 -1
- package/dist/components/controls/recurrence-control/index.js +1 -1
- package/dist/components/controls/select-control/props.d.ts +4 -3
- package/dist/components/controls/select-control/select.d.ts +1 -1
- package/dist/components/controls/select-control/select.js +55 -51
- package/dist/components/controls/tag-control/ariakit-experimental.js +17 -17
- package/dist/components/controls/tag-control/index.js +9 -9
- package/dist/components/controls/tag-control/props.js +1 -1
- package/dist/components/controls/toggle-control/index.js +1 -1
- package/dist/components/controls/toggle-group-control/index.js +1 -1
- package/dist/components/data-form/status.js +1 -1
- package/dist/components/data-form/submit.js +1 -1
- package/dist/components/data-view/data/filter.js +2 -2
- package/dist/components/data-view/index.js +1 -1
- package/dist/components/data-view/layouts/grid/group.js +2 -2
- package/dist/components/data-view/layouts/grid/item.js +2 -2
- package/dist/components/data-view/layouts/kanban/group.js +2 -2
- package/dist/components/data-view/layouts/kanban/item.js +2 -2
- package/dist/components/data-view/layouts/kanban/root.js +1 -1
- package/dist/components/data-view/layouts/list/group.js +2 -2
- package/dist/components/data-view/layouts/list/item.js +2 -2
- package/dist/components/data-view/layouts/table/empty.js +2 -2
- package/dist/components/data-view/layouts/table/group.js +3 -3
- package/dist/components/data-view/layouts/table/item.js +3 -3
- package/dist/components/data-view/layouts/table/root.js +2 -2
- package/dist/components/data-view/parts/body/empty.js +1 -1
- package/dist/components/data-view/parts/body/index.js +4 -4
- package/dist/components/data-view/parts/controls/index.js +2 -2
- package/dist/components/data-view/parts/controls/search.js +2 -2
- package/dist/components/data-view/parts/filters/chip.js +1 -1
- package/dist/components/data-view/parts/filters/editor.js +1 -1
- package/dist/components/data-view/parts/footer/actions.js +2 -2
- package/dist/components/data-view/parts/footer/index.js +2 -2
- package/dist/components/data-view/parts/footer/selection.js +2 -2
- package/dist/components/data-view/parts/view-control/index.js +2 -2
- package/dist/components/data-view/root.js +2 -2
- package/dist/components/data-view/slots/group/checkbox.js +3 -3
- package/dist/components/data-view/slots/group/context.js +1 -1
- package/dist/components/data-view/slots/group/icon.js +1 -1
- package/dist/components/data-view/slots/group/index.js +1 -1
- package/dist/components/data-view/slots/group/label.js +1 -1
- package/dist/components/data-view/slots/index.js +3 -3
- package/dist/components/data-view/slots/item/actions.js +1 -1
- package/dist/components/data-view/slots/item/checkbox.js +2 -2
- package/dist/components/data-view/slots/item/depth.js +3 -3
- package/dist/components/data-view/slots/item/description.js +1 -1
- package/dist/components/data-view/slots/item/index.js +1 -1
- package/dist/components/data-view/slots/item/properties.js +2 -2
- package/dist/components/data-view/slots/item/relations.js +4 -4
- package/dist/components/data-view/slots/item/tags.js +1 -1
- package/dist/components/data-view/slots/item/thumbnail.js +1 -1
- package/dist/components/data-view/slots/item/title.js +3 -3
- package/dist/components/data-view/slots/item/util.js +2 -2
- package/dist/components/data-view/slots/property/field/editable.js +2 -2
- package/dist/components/data-view/slots/property/field/index.js +1 -1
- package/dist/components/data-view/slots/property/field/static.js +1 -1
- package/dist/components/data-view/slots/property/index.js +1 -1
- package/dist/components/data-view/slots/property/label.js +1 -1
- package/dist/components/data-view/slots/root/checkbox.js +2 -2
- package/dist/components/data-view/slots/root/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/shell/pane.js +20 -15
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/window/index.js +2 -2
- package/dist/{filter-DAMRLXNe.js → filter-BqYmWg3n.js} +1 -1
- package/dist/{index-CoFfLb68.js → index-BdzBM_aG.js} +1 -1
- package/dist/{index-CPOlz97j.js → index-BrUAPkzm.js} +3 -3
- package/dist/{index-ClExU5xD.js → index-CWkR83hZ.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/primitives/colourway/index.js +1 -1
- package/dist/primitives/icon-label/index.d.ts +3 -1
- package/dist/primitives/icon-label/index.js +18 -13
- package/dist/primitives/link/index.js +1 -1
- package/dist/primitives/nav-link/index.js +1 -1
- package/dist/primitives/resizable/index.js +1 -1
- package/dist/primitives/tooltip/index.js +1 -1
- package/dist/primitives/truncate/index.js +1 -1
- package/dist/primitives/typography/heading.js +1 -1
- package/dist/primitives/typography/paragraph.js +1 -1
- package/dist/tag-remove-CVXLunYF.js +447 -0
- package/package.json +1 -1
- package/dist/MAXQOH4L-DBaf8WKp.js +0 -564
- package/dist/tag-remove-BVa8oSsq.js +0 -533
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
import { u as Xe } from "./5JTVDSTH-DcfjjEya.js";
|
|
2
|
+
import { a as Ye } from "./WMYDSCNQ-D4CU76mX.js";
|
|
3
|
+
import { a as me, C as Ze, b as ye, c as et, d as tt, e as Ee, u as ot, f as nt } from "./S43UC3DV-CiBKpqp8.js";
|
|
4
|
+
import { I as rt, S as st, V as D, T as te, U as G, a1 as lt, x as ut, a7 as at, m as B, o as E, W as Ie, f as ne, c as re, a as se, _ as le, i as ue, a8 as it, a9 as ct, y as Oe, aa as ce, ab as dt, e as U, B as ft, b as de, j as R, G as mt, q as we, n as Ae, a0 as vt, a4 as ke, $ as pt, K as bt, s as Ct, O as St, P as gt, k as xt, l as _e, ac as ht, r as Ot, C as Pt } from "./LMDWO4NN-CIZvvtic.js";
|
|
5
|
+
import { h as fe } from "./PFRGBC2K-B9ko--FF.js";
|
|
6
|
+
import { m as Vt, p as yt, t as Et, c as It, s as X, e as J, g as wt, b as At, d as oe, u as kt, a as _t } from "./YV4JVR4I-w1-dnslS.js";
|
|
7
|
+
import { createContext as Le, useRef as j, useState as Te, useEffect as Y, useMemo as Lt, useCallback as Tt, useContext as Kt } from "react";
|
|
8
|
+
import { e as Dt, C as Rt } from "./P7GR5CS5-5PtDURPc.js";
|
|
9
|
+
import { c as Ft, a as Bt } from "./O2PQ2652-D2GSkoLq.js";
|
|
10
|
+
import { c as Mt, d as Ht, b as Nt } from "./4CMBR7SL-ChJnawVl.js";
|
|
11
|
+
import { jsx as Z } from "react/jsx-runtime";
|
|
12
|
+
import { u as $t } from "./UQQRIHDV-BBkcyl82.js";
|
|
13
|
+
import { u as Ut } from "./6VRAQV3D-DK_p41oq.js";
|
|
14
|
+
import { c as jt, u as qt } from "./G7GW6PWC-A0eDeXMt.js";
|
|
15
|
+
import { i as Wt } from "./KFH4SEIX-BFT9WmYk.js";
|
|
16
|
+
var wo = Le(null), Ao = Le(
|
|
17
|
+
null
|
|
18
|
+
), ae = rt(
|
|
19
|
+
[Rt],
|
|
20
|
+
[Dt]
|
|
21
|
+
), zt = ae.useContext, ko = ae.useProviderContext, _o = ae.ContextProvider, Lo = ae.ScopedContextProvider, Gt = ut() && at();
|
|
22
|
+
function Jt(o = {}) {
|
|
23
|
+
var r = o, {
|
|
24
|
+
tag: n
|
|
25
|
+
} = r, e = st(r, [
|
|
26
|
+
"tag"
|
|
27
|
+
]);
|
|
28
|
+
const c = Vt(e.store, yt(n, ["value", "rtl"]));
|
|
29
|
+
Et(e, c);
|
|
30
|
+
const v = n == null ? void 0 : n.getState(), u = c == null ? void 0 : c.getState(), T = D(
|
|
31
|
+
e.activeId,
|
|
32
|
+
u == null ? void 0 : u.activeId,
|
|
33
|
+
e.defaultActiveId,
|
|
34
|
+
null
|
|
35
|
+
), P = Mt(te(G({}, e), {
|
|
36
|
+
activeId: T,
|
|
37
|
+
includesBaseElement: D(
|
|
38
|
+
e.includesBaseElement,
|
|
39
|
+
u == null ? void 0 : u.includesBaseElement,
|
|
40
|
+
!0
|
|
41
|
+
),
|
|
42
|
+
orientation: D(
|
|
43
|
+
e.orientation,
|
|
44
|
+
u == null ? void 0 : u.orientation,
|
|
45
|
+
"vertical"
|
|
46
|
+
),
|
|
47
|
+
focusLoop: D(e.focusLoop, u == null ? void 0 : u.focusLoop, !0),
|
|
48
|
+
focusWrap: D(e.focusWrap, u == null ? void 0 : u.focusWrap, !0),
|
|
49
|
+
virtualFocus: D(
|
|
50
|
+
e.virtualFocus,
|
|
51
|
+
u == null ? void 0 : u.virtualFocus,
|
|
52
|
+
!0
|
|
53
|
+
)
|
|
54
|
+
})), p = Ft(te(G({}, e), {
|
|
55
|
+
placement: D(
|
|
56
|
+
e.placement,
|
|
57
|
+
u == null ? void 0 : u.placement,
|
|
58
|
+
"bottom-start"
|
|
59
|
+
)
|
|
60
|
+
})), K = D(
|
|
61
|
+
e.value,
|
|
62
|
+
u == null ? void 0 : u.value,
|
|
63
|
+
e.defaultValue,
|
|
64
|
+
""
|
|
65
|
+
), V = D(
|
|
66
|
+
e.selectedValue,
|
|
67
|
+
u == null ? void 0 : u.selectedValue,
|
|
68
|
+
v == null ? void 0 : v.values,
|
|
69
|
+
e.defaultSelectedValue,
|
|
70
|
+
""
|
|
71
|
+
), f = Array.isArray(V), _ = te(G(G({}, P.getState()), p.getState()), {
|
|
72
|
+
value: K,
|
|
73
|
+
selectedValue: V,
|
|
74
|
+
resetValueOnSelect: D(
|
|
75
|
+
e.resetValueOnSelect,
|
|
76
|
+
u == null ? void 0 : u.resetValueOnSelect,
|
|
77
|
+
f
|
|
78
|
+
),
|
|
79
|
+
resetValueOnHide: D(
|
|
80
|
+
e.resetValueOnHide,
|
|
81
|
+
u == null ? void 0 : u.resetValueOnHide,
|
|
82
|
+
f && !n
|
|
83
|
+
),
|
|
84
|
+
activeValue: u == null ? void 0 : u.activeValue
|
|
85
|
+
}), s = It(_, P, p, c);
|
|
86
|
+
return Gt && X(
|
|
87
|
+
s,
|
|
88
|
+
() => J(s, ["virtualFocus"], () => {
|
|
89
|
+
s.setState("virtualFocus", !1);
|
|
90
|
+
})
|
|
91
|
+
), X(s, () => {
|
|
92
|
+
if (n)
|
|
93
|
+
return lt(
|
|
94
|
+
J(s, ["selectedValue"], (a) => {
|
|
95
|
+
Array.isArray(a.selectedValue) && n.setValues(a.selectedValue);
|
|
96
|
+
}),
|
|
97
|
+
J(n, ["values"], (a) => {
|
|
98
|
+
s.setState("selectedValue", a.values);
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
}), X(
|
|
102
|
+
s,
|
|
103
|
+
() => J(s, ["resetValueOnHide", "mounted"], (a) => {
|
|
104
|
+
a.resetValueOnHide && (a.mounted || s.setState("value", K));
|
|
105
|
+
})
|
|
106
|
+
), X(
|
|
107
|
+
s,
|
|
108
|
+
() => J(s, ["open"], (a) => {
|
|
109
|
+
a.open || (s.setState("activeId", T), s.setState("moves", 0));
|
|
110
|
+
})
|
|
111
|
+
), X(
|
|
112
|
+
s,
|
|
113
|
+
() => J(s, ["moves", "activeId"], (a, S) => {
|
|
114
|
+
a.moves === S.moves && s.setState("activeValue", void 0);
|
|
115
|
+
})
|
|
116
|
+
), X(
|
|
117
|
+
s,
|
|
118
|
+
() => wt(s, ["moves", "renderedItems"], (a, S) => {
|
|
119
|
+
if (a.moves === S.moves) return;
|
|
120
|
+
const { activeId: d } = s.getState(), m = P.item(d);
|
|
121
|
+
s.setState("activeValue", m == null ? void 0 : m.value);
|
|
122
|
+
})
|
|
123
|
+
), te(G(G(G({}, p), P), s), {
|
|
124
|
+
tag: n,
|
|
125
|
+
setValue: (a) => s.setState("value", a),
|
|
126
|
+
resetValue: () => s.setState("value", _.value),
|
|
127
|
+
setSelectedValue: (a) => s.setState("selectedValue", a)
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function Qt(o) {
|
|
131
|
+
const r = zt();
|
|
132
|
+
return o = B(E({}, o), {
|
|
133
|
+
tag: o.tag !== void 0 ? o.tag : r
|
|
134
|
+
}), Ht(o);
|
|
135
|
+
}
|
|
136
|
+
function Xt(o, r, n) {
|
|
137
|
+
return Ie(r, [n.tag]), oe(o, n, "value", "setValue"), oe(o, n, "selectedValue", "setSelectedValue"), oe(o, n, "resetValueOnHide"), oe(o, n, "resetValueOnSelect"), Object.assign(
|
|
138
|
+
Nt(
|
|
139
|
+
Bt(o, r, n),
|
|
140
|
+
r,
|
|
141
|
+
n
|
|
142
|
+
),
|
|
143
|
+
{ tag: n.tag }
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function Yt(o = {}) {
|
|
147
|
+
o = Qt(o);
|
|
148
|
+
const [r, n] = At(Jt, o);
|
|
149
|
+
return Xt(r, n, o);
|
|
150
|
+
}
|
|
151
|
+
var Zt = "input";
|
|
152
|
+
function Pe(o, r, n) {
|
|
153
|
+
if (!n) return !1;
|
|
154
|
+
const e = o.find((c) => !c.disabled && c.value);
|
|
155
|
+
return (e == null ? void 0 : e.value) === r;
|
|
156
|
+
}
|
|
157
|
+
function Ve(o, r) {
|
|
158
|
+
return !r || o == null ? !1 : (o = bt(o), r.length > o.length && r.toLowerCase().indexOf(o.toLowerCase()) === 0);
|
|
159
|
+
}
|
|
160
|
+
function eo(o) {
|
|
161
|
+
return o.type === "input";
|
|
162
|
+
}
|
|
163
|
+
function to(o) {
|
|
164
|
+
return o === "inline" || o === "list" || o === "both" || o === "none";
|
|
165
|
+
}
|
|
166
|
+
function oo(o) {
|
|
167
|
+
const r = o.find((n) => {
|
|
168
|
+
var e;
|
|
169
|
+
return n.disabled ? !1 : ((e = n.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
|
|
170
|
+
});
|
|
171
|
+
return r == null ? void 0 : r.id;
|
|
172
|
+
}
|
|
173
|
+
var no = re(
|
|
174
|
+
function(r) {
|
|
175
|
+
var n = r, {
|
|
176
|
+
store: e,
|
|
177
|
+
focusable: c = !0,
|
|
178
|
+
autoSelect: v = !1,
|
|
179
|
+
getAutoSelectId: u,
|
|
180
|
+
setValueOnChange: T,
|
|
181
|
+
showMinLength: P = 0,
|
|
182
|
+
showOnChange: p,
|
|
183
|
+
showOnMouseDown: K,
|
|
184
|
+
showOnClick: V = K,
|
|
185
|
+
showOnKeyDown: f,
|
|
186
|
+
showOnKeyPress: _ = f,
|
|
187
|
+
blurActiveItemOnClick: s,
|
|
188
|
+
setValueOnClick: a = !0,
|
|
189
|
+
moveOnKeyPress: S = !0,
|
|
190
|
+
autoComplete: d = "list"
|
|
191
|
+
} = n, m = le(n, [
|
|
192
|
+
"store",
|
|
193
|
+
"focusable",
|
|
194
|
+
"autoSelect",
|
|
195
|
+
"getAutoSelectId",
|
|
196
|
+
"setValueOnChange",
|
|
197
|
+
"showMinLength",
|
|
198
|
+
"showOnChange",
|
|
199
|
+
"showOnMouseDown",
|
|
200
|
+
"showOnClick",
|
|
201
|
+
"showOnKeyDown",
|
|
202
|
+
"showOnKeyPress",
|
|
203
|
+
"blurActiveItemOnClick",
|
|
204
|
+
"setValueOnClick",
|
|
205
|
+
"moveOnKeyPress",
|
|
206
|
+
"autoComplete"
|
|
207
|
+
]);
|
|
208
|
+
const k = me();
|
|
209
|
+
e = e || k, ue(
|
|
210
|
+
e,
|
|
211
|
+
process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
212
|
+
);
|
|
213
|
+
const I = j(null), [M, w] = it(), x = j(!1), H = j(!1), A = e.useState(
|
|
214
|
+
(t) => t.virtualFocus && v
|
|
215
|
+
), y = d === "inline" || d === "both", [q, Q] = Te(y);
|
|
216
|
+
ct(() => {
|
|
217
|
+
y && Q(!0);
|
|
218
|
+
}, [y]);
|
|
219
|
+
const l = e.useState("value"), g = j();
|
|
220
|
+
Y(() => J(e, ["selectedValue", "activeId"], (t, i) => {
|
|
221
|
+
g.current = i.selectedValue;
|
|
222
|
+
}), []);
|
|
223
|
+
const h = e.useState((t) => {
|
|
224
|
+
var i;
|
|
225
|
+
if (y && q && !(t.activeValue && Array.isArray(t.selectedValue) && (t.selectedValue.includes(t.activeValue) || (i = g.current) != null && i.includes(t.activeValue))))
|
|
226
|
+
return t.activeValue;
|
|
227
|
+
}), W = e.useState("renderedItems"), N = e.useState("open"), $ = e.useState("contentElement"), ee = Lt(() => {
|
|
228
|
+
if (!y || !q) return l;
|
|
229
|
+
if (Pe(
|
|
230
|
+
W,
|
|
231
|
+
h,
|
|
232
|
+
A
|
|
233
|
+
)) {
|
|
234
|
+
if (Ve(l, h)) {
|
|
235
|
+
const i = (h == null ? void 0 : h.slice(l.length)) || "";
|
|
236
|
+
return l + i;
|
|
237
|
+
}
|
|
238
|
+
return l;
|
|
239
|
+
}
|
|
240
|
+
return h || l;
|
|
241
|
+
}, [y, q, W, h, A, l]);
|
|
242
|
+
Y(() => {
|
|
243
|
+
const t = I.current;
|
|
244
|
+
if (!t) return;
|
|
245
|
+
const i = () => Q(!0);
|
|
246
|
+
return t.addEventListener("combobox-item-move", i), () => {
|
|
247
|
+
t.removeEventListener("combobox-item-move", i);
|
|
248
|
+
};
|
|
249
|
+
}, []), Y(() => {
|
|
250
|
+
if (!y || !q || !h || !Pe(
|
|
251
|
+
W,
|
|
252
|
+
h,
|
|
253
|
+
A
|
|
254
|
+
) || !Ve(l, h)) return;
|
|
255
|
+
let i = dt;
|
|
256
|
+
return queueMicrotask(() => {
|
|
257
|
+
const b = I.current;
|
|
258
|
+
if (!b) return;
|
|
259
|
+
const { start: C, end: L } = Oe(b), F = l.length, O = h.length;
|
|
260
|
+
ce(b, F, O), i = () => {
|
|
261
|
+
if (!fe(b)) return;
|
|
262
|
+
const { start: z, end: Qe } = Oe(b);
|
|
263
|
+
z === F && Qe === O && ce(b, C, L);
|
|
264
|
+
};
|
|
265
|
+
}), () => i();
|
|
266
|
+
}, [
|
|
267
|
+
M,
|
|
268
|
+
y,
|
|
269
|
+
q,
|
|
270
|
+
h,
|
|
271
|
+
W,
|
|
272
|
+
A,
|
|
273
|
+
l
|
|
274
|
+
]);
|
|
275
|
+
const De = j(null), ve = U(u), pe = j(null);
|
|
276
|
+
Y(() => {
|
|
277
|
+
if (!N || !$) return;
|
|
278
|
+
const t = ft($);
|
|
279
|
+
if (!t) return;
|
|
280
|
+
De.current = t;
|
|
281
|
+
const i = () => {
|
|
282
|
+
x.current = !1;
|
|
283
|
+
}, b = () => {
|
|
284
|
+
if (!e || !x.current) return;
|
|
285
|
+
const { activeId: L } = e.getState();
|
|
286
|
+
L !== null && L !== pe.current && (x.current = !1);
|
|
287
|
+
}, C = { passive: !0, capture: !0 };
|
|
288
|
+
return t.addEventListener("wheel", i, C), t.addEventListener("touchmove", i, C), t.addEventListener("scroll", b, C), () => {
|
|
289
|
+
t.removeEventListener("wheel", i, !0), t.removeEventListener("touchmove", i, !0), t.removeEventListener("scroll", b, !0);
|
|
290
|
+
};
|
|
291
|
+
}, [N, $, e]), de(() => {
|
|
292
|
+
l && (H.current || (x.current = !0));
|
|
293
|
+
}, [l]), de(() => {
|
|
294
|
+
A !== "always" && N || (x.current = N);
|
|
295
|
+
}, [A, N]);
|
|
296
|
+
const be = e.useState("resetValueOnSelect");
|
|
297
|
+
Ie(() => {
|
|
298
|
+
var t, i;
|
|
299
|
+
const b = x.current;
|
|
300
|
+
if (!e || !N || !b && !be) return;
|
|
301
|
+
const { baseElement: C, contentElement: L, activeId: F } = e.getState();
|
|
302
|
+
if (!(C && !fe(C))) {
|
|
303
|
+
if (L != null && L.hasAttribute("data-placing")) {
|
|
304
|
+
const O = new MutationObserver(w);
|
|
305
|
+
return O.observe(L, { attributeFilter: ["data-placing"] }), () => O.disconnect();
|
|
306
|
+
}
|
|
307
|
+
if (A && b) {
|
|
308
|
+
const O = ve(W), z = O !== void 0 ? O : (t = oo(W)) != null ? t : e.first();
|
|
309
|
+
pe.current = z, e.move(z ?? null);
|
|
310
|
+
} else {
|
|
311
|
+
const O = (i = e.item(F || e.first())) == null ? void 0 : i.element;
|
|
312
|
+
O && "scrollIntoView" in O && O.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}, [
|
|
316
|
+
e,
|
|
317
|
+
N,
|
|
318
|
+
M,
|
|
319
|
+
l,
|
|
320
|
+
A,
|
|
321
|
+
be,
|
|
322
|
+
ve,
|
|
323
|
+
W
|
|
324
|
+
]), Y(() => {
|
|
325
|
+
if (!y) return;
|
|
326
|
+
const t = I.current;
|
|
327
|
+
if (!t) return;
|
|
328
|
+
const i = [t, $].filter(
|
|
329
|
+
(C) => !!C
|
|
330
|
+
), b = (C) => {
|
|
331
|
+
i.every((L) => pt(C, L)) && (e == null || e.setValue(ee));
|
|
332
|
+
};
|
|
333
|
+
for (const C of i)
|
|
334
|
+
C.addEventListener("focusout", b);
|
|
335
|
+
return () => {
|
|
336
|
+
for (const C of i)
|
|
337
|
+
C.removeEventListener("focusout", b);
|
|
338
|
+
};
|
|
339
|
+
}, [y, $, e, ee]);
|
|
340
|
+
const ie = (t) => t.currentTarget.value.length >= P, Ce = m.onChange, Re = R(p ?? ie), Fe = R(
|
|
341
|
+
// If the combobox is combined with tags, the value will be set by the tag
|
|
342
|
+
// input component.
|
|
343
|
+
T ?? !e.tag
|
|
344
|
+
), Be = U((t) => {
|
|
345
|
+
if (Ce == null || Ce(t), t.defaultPrevented || !e) return;
|
|
346
|
+
const i = t.currentTarget, { value: b, selectionStart: C, selectionEnd: L } = i, F = t.nativeEvent;
|
|
347
|
+
if (x.current = !0, eo(F) && (F.isComposing && (x.current = !1, H.current = !0), y)) {
|
|
348
|
+
const O = F.inputType === "insertText" || F.inputType === "insertCompositionText", z = C === b.length;
|
|
349
|
+
Q(O && z);
|
|
350
|
+
}
|
|
351
|
+
if (Fe(t)) {
|
|
352
|
+
const O = b === e.getState().value;
|
|
353
|
+
e.setValue(b), queueMicrotask(() => {
|
|
354
|
+
ce(i, C, L);
|
|
355
|
+
}), y && A && O && w();
|
|
356
|
+
}
|
|
357
|
+
Re(t) && e.show(), (!A || !x.current) && e.setActiveId(null);
|
|
358
|
+
}), Se = m.onCompositionEnd, Me = U((t) => {
|
|
359
|
+
x.current = !0, H.current = !1, Se == null || Se(t), !t.defaultPrevented && A && w();
|
|
360
|
+
}), ge = m.onMouseDown, He = R(
|
|
361
|
+
s ?? (() => !!(e != null && e.getState().includesBaseElement))
|
|
362
|
+
), Ne = R(a), $e = R(V ?? ie), Ue = U((t) => {
|
|
363
|
+
ge == null || ge(t), !t.defaultPrevented && (t.button || t.ctrlKey || e && (He(t) && e.setActiveId(null), Ne(t) && e.setValue(ee), $e(t) && mt(t.currentTarget, "mouseup", e.show)));
|
|
364
|
+
}), xe = m.onKeyDown, je = R(_ ?? ie), qe = U((t) => {
|
|
365
|
+
if (xe == null || xe(t), t.repeat || (x.current = !1), t.defaultPrevented || t.ctrlKey || t.altKey || t.shiftKey || t.metaKey || !e) return;
|
|
366
|
+
const { open: i } = e.getState();
|
|
367
|
+
i || (t.key === "ArrowUp" || t.key === "ArrowDown") && je(t) && (t.preventDefault(), e.show());
|
|
368
|
+
}), he = m.onBlur, We = U((t) => {
|
|
369
|
+
x.current = !1, he == null || he(t), t.defaultPrevented;
|
|
370
|
+
}), ze = we(m.id), Ge = to(d) ? d : void 0, Je = e.useState((t) => t.activeId === null);
|
|
371
|
+
return m = B(E({
|
|
372
|
+
id: ze,
|
|
373
|
+
role: "combobox",
|
|
374
|
+
"aria-autocomplete": Ge,
|
|
375
|
+
"aria-haspopup": vt($, "listbox"),
|
|
376
|
+
"aria-expanded": N,
|
|
377
|
+
"aria-controls": $ == null ? void 0 : $.id,
|
|
378
|
+
"data-active-item": Je || void 0,
|
|
379
|
+
value: ee
|
|
380
|
+
}, m), {
|
|
381
|
+
ref: Ae(I, m.ref),
|
|
382
|
+
onChange: Be,
|
|
383
|
+
onCompositionEnd: Me,
|
|
384
|
+
onMouseDown: Ue,
|
|
385
|
+
onKeyDown: qe,
|
|
386
|
+
onBlur: We
|
|
387
|
+
}), m = Xe(B(E({
|
|
388
|
+
store: e,
|
|
389
|
+
focusable: c
|
|
390
|
+
}, m), {
|
|
391
|
+
// Enable inline autocomplete when the user moves from the combobox input
|
|
392
|
+
// to an item.
|
|
393
|
+
moveOnKeyPress: (t) => ke(S, t) ? !1 : (y && Q(!0), !0)
|
|
394
|
+
})), m = Ye(E({ store: e }, m)), E({ autoComplete: "off" }, m);
|
|
395
|
+
}
|
|
396
|
+
), To = ne(function(r) {
|
|
397
|
+
const n = no(r);
|
|
398
|
+
return se(Zt, n);
|
|
399
|
+
});
|
|
400
|
+
function Ko(o = {}) {
|
|
401
|
+
const r = Yt(o);
|
|
402
|
+
return /* @__PURE__ */ Z(Ze, { value: r, children: o.children });
|
|
403
|
+
}
|
|
404
|
+
var ro = "div";
|
|
405
|
+
function so(o, r) {
|
|
406
|
+
if (r != null)
|
|
407
|
+
return o == null ? !1 : Array.isArray(o) ? o.includes(r) : o === r;
|
|
408
|
+
}
|
|
409
|
+
function lo(o) {
|
|
410
|
+
var r;
|
|
411
|
+
return (r = {
|
|
412
|
+
menu: "menuitem",
|
|
413
|
+
listbox: "option",
|
|
414
|
+
tree: "treeitem"
|
|
415
|
+
}[o]) != null ? r : "option";
|
|
416
|
+
}
|
|
417
|
+
var uo = re(
|
|
418
|
+
function(r) {
|
|
419
|
+
var n = r, {
|
|
420
|
+
store: e,
|
|
421
|
+
value: c,
|
|
422
|
+
hideOnClick: v,
|
|
423
|
+
setValueOnClick: u,
|
|
424
|
+
selectValueOnClick: T = !0,
|
|
425
|
+
resetValueOnSelect: P,
|
|
426
|
+
focusOnHover: p = !1,
|
|
427
|
+
moveOnKeyPress: K = !0,
|
|
428
|
+
getItem: V
|
|
429
|
+
} = n, f = le(n, [
|
|
430
|
+
"store",
|
|
431
|
+
"value",
|
|
432
|
+
"hideOnClick",
|
|
433
|
+
"setValueOnClick",
|
|
434
|
+
"selectValueOnClick",
|
|
435
|
+
"resetValueOnSelect",
|
|
436
|
+
"focusOnHover",
|
|
437
|
+
"moveOnKeyPress",
|
|
438
|
+
"getItem"
|
|
439
|
+
]), _;
|
|
440
|
+
const s = ye();
|
|
441
|
+
e = e || s, ue(
|
|
442
|
+
e,
|
|
443
|
+
process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
|
|
444
|
+
);
|
|
445
|
+
const { resetValueOnSelectState: a, multiSelectable: S, selected: d } = kt(e, {
|
|
446
|
+
resetValueOnSelectState: "resetValueOnSelect",
|
|
447
|
+
multiSelectable(l) {
|
|
448
|
+
return Array.isArray(l.selectedValue);
|
|
449
|
+
},
|
|
450
|
+
selected(l) {
|
|
451
|
+
return so(l.selectedValue, c);
|
|
452
|
+
}
|
|
453
|
+
}), m = Tt(
|
|
454
|
+
(l) => {
|
|
455
|
+
const g = B(E({}, l), { value: c });
|
|
456
|
+
return V ? V(g) : g;
|
|
457
|
+
},
|
|
458
|
+
[c, V]
|
|
459
|
+
);
|
|
460
|
+
u = u ?? !S, v = v ?? (c != null && !S);
|
|
461
|
+
const k = f.onClick, I = R(u), M = R(T), w = R(
|
|
462
|
+
(_ = P ?? a) != null ? _ : S
|
|
463
|
+
), x = R(v), H = U((l) => {
|
|
464
|
+
k == null || k(l), !l.defaultPrevented && (St(l) || gt(l) || (c != null && (M(l) && (w(l) && (e == null || e.resetValue()), e == null || e.setSelectedValue((g) => Array.isArray(g) ? g.includes(c) ? g.filter((h) => h !== c) : [...g, c] : c)), I(l) && (e == null || e.setValue(c))), x(l) && (e == null || e.hide())));
|
|
465
|
+
}), A = f.onKeyDown, y = U((l) => {
|
|
466
|
+
if (A == null || A(l), l.defaultPrevented) return;
|
|
467
|
+
const g = e == null ? void 0 : e.getState().baseElement;
|
|
468
|
+
if (!g || fe(g)) return;
|
|
469
|
+
(l.key.length === 1 || l.key === "Backspace" || l.key === "Delete") && (queueMicrotask(() => g.focus()), xt(g) && (e == null || e.setValue(g.value)));
|
|
470
|
+
});
|
|
471
|
+
S && d != null && (f = E({
|
|
472
|
+
"aria-selected": d
|
|
473
|
+
}, f)), f = _e(
|
|
474
|
+
f,
|
|
475
|
+
(l) => /* @__PURE__ */ Z(et.Provider, { value: c, children: /* @__PURE__ */ Z(tt.Provider, { value: d ?? !1, children: l }) }),
|
|
476
|
+
[c, d]
|
|
477
|
+
);
|
|
478
|
+
const q = Kt(Ee);
|
|
479
|
+
f = B(E({
|
|
480
|
+
role: lo(q),
|
|
481
|
+
children: c
|
|
482
|
+
}, f), {
|
|
483
|
+
onClick: H,
|
|
484
|
+
onKeyDown: y
|
|
485
|
+
});
|
|
486
|
+
const Q = R(K);
|
|
487
|
+
return f = Ut(B(E({
|
|
488
|
+
store: e
|
|
489
|
+
}, f), {
|
|
490
|
+
getItem: m,
|
|
491
|
+
// Dispatch a custom event on the combobox input when moving to an item
|
|
492
|
+
// with the keyboard so the Combobox component can enable inline
|
|
493
|
+
// autocompletion.
|
|
494
|
+
moveOnKeyPress: (l) => {
|
|
495
|
+
if (!Q(l)) return !1;
|
|
496
|
+
const g = new Event("combobox-item-move"), h = e == null ? void 0 : e.getState().baseElement;
|
|
497
|
+
return h == null || h.dispatchEvent(g), !0;
|
|
498
|
+
}
|
|
499
|
+
})), f = $t(E({ store: e, focusOnHover: p }, f)), f;
|
|
500
|
+
}
|
|
501
|
+
), Do = Ct(
|
|
502
|
+
ne(function(r) {
|
|
503
|
+
const n = uo(r);
|
|
504
|
+
return se(ro, n);
|
|
505
|
+
})
|
|
506
|
+
), ao = "div", Ke = re(
|
|
507
|
+
function(r) {
|
|
508
|
+
var n = r, { store: e, alwaysVisible: c } = n, v = le(n, ["store", "alwaysVisible"]);
|
|
509
|
+
const u = ye(!0), T = ot();
|
|
510
|
+
e = e || T;
|
|
511
|
+
const P = !!e && e === u;
|
|
512
|
+
ue(
|
|
513
|
+
e,
|
|
514
|
+
process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
515
|
+
);
|
|
516
|
+
const p = j(null), K = we(v.id), V = e.useState("mounted"), f = Wt(V, v.hidden, c), _ = f ? B(E({}, v.style), { display: "none" }) : v.style, s = e.useState(
|
|
517
|
+
(w) => Array.isArray(w.selectedValue)
|
|
518
|
+
), a = ht(p, "role", v.role), d = (a === "listbox" || a === "tree" || a === "grid") && s || void 0, [m, k] = Te(!1), I = e.useState("contentElement");
|
|
519
|
+
de(() => {
|
|
520
|
+
if (!V) return;
|
|
521
|
+
const w = p.current;
|
|
522
|
+
if (!w || I !== w) return;
|
|
523
|
+
const x = () => {
|
|
524
|
+
k(!!w.querySelector("[role='listbox']"));
|
|
525
|
+
}, H = new MutationObserver(x);
|
|
526
|
+
return H.observe(w, {
|
|
527
|
+
subtree: !0,
|
|
528
|
+
childList: !0,
|
|
529
|
+
attributeFilter: ["role"]
|
|
530
|
+
}), x(), () => H.disconnect();
|
|
531
|
+
}, [V, I]), m || (v = E({
|
|
532
|
+
role: "listbox",
|
|
533
|
+
"aria-multiselectable": d
|
|
534
|
+
}, v)), v = _e(
|
|
535
|
+
v,
|
|
536
|
+
(w) => /* @__PURE__ */ Z(nt, { value: e, children: /* @__PURE__ */ Z(Ee.Provider, { value: a, children: w }) }),
|
|
537
|
+
[e, a]
|
|
538
|
+
);
|
|
539
|
+
const M = K && (!u || !P) ? e.setContentElement : null;
|
|
540
|
+
return v = B(E({
|
|
541
|
+
id: K,
|
|
542
|
+
hidden: f
|
|
543
|
+
}, v), {
|
|
544
|
+
ref: Ae(M, p, v.ref),
|
|
545
|
+
style: _
|
|
546
|
+
}), Ot(v);
|
|
547
|
+
}
|
|
548
|
+
), Ro = ne(function(r) {
|
|
549
|
+
const n = Ke(r);
|
|
550
|
+
return se(ao, n);
|
|
551
|
+
}), io = "div";
|
|
552
|
+
function co(o, ...r) {
|
|
553
|
+
if (!o) return !1;
|
|
554
|
+
if ("id" in o) {
|
|
555
|
+
const n = r.filter(Boolean).map((e) => `[aria-controls~="${e}"]`).join(", ");
|
|
556
|
+
return n ? o.matches(n) : !1;
|
|
557
|
+
}
|
|
558
|
+
return !1;
|
|
559
|
+
}
|
|
560
|
+
var fo = re(
|
|
561
|
+
function(r) {
|
|
562
|
+
var n = r, {
|
|
563
|
+
store: e,
|
|
564
|
+
modal: c,
|
|
565
|
+
tabIndex: v,
|
|
566
|
+
alwaysVisible: u,
|
|
567
|
+
autoFocusOnHide: T = !0,
|
|
568
|
+
hideOnInteractOutside: P = !0
|
|
569
|
+
} = n, p = le(n, [
|
|
570
|
+
"store",
|
|
571
|
+
"modal",
|
|
572
|
+
"tabIndex",
|
|
573
|
+
"alwaysVisible",
|
|
574
|
+
"autoFocusOnHide",
|
|
575
|
+
"hideOnInteractOutside"
|
|
576
|
+
]);
|
|
577
|
+
const K = me();
|
|
578
|
+
e = e || K, ue(
|
|
579
|
+
e,
|
|
580
|
+
process.env.NODE_ENV !== "production" && "ComboboxPopover must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
581
|
+
);
|
|
582
|
+
const V = e.useState("baseElement"), f = j(!1), _ = _t(
|
|
583
|
+
e.tag,
|
|
584
|
+
(s) => s == null ? void 0 : s.renderedItems.length
|
|
585
|
+
);
|
|
586
|
+
return p = Ke(E({ store: e, alwaysVisible: u }, p)), p = qt(B(E({
|
|
587
|
+
store: e,
|
|
588
|
+
modal: c,
|
|
589
|
+
alwaysVisible: u,
|
|
590
|
+
backdrop: !1,
|
|
591
|
+
autoFocusOnShow: !1,
|
|
592
|
+
finalFocus: V,
|
|
593
|
+
preserveTabOrderAnchor: null,
|
|
594
|
+
unstable_treeSnapshotKey: _
|
|
595
|
+
}, p), {
|
|
596
|
+
// When the combobox popover is modal, we make sure to include the
|
|
597
|
+
// combobox input and all the combobox controls (cancel, disclosure) in
|
|
598
|
+
// the list of persistent elements so they make part of the modal context,
|
|
599
|
+
// allowing users to tab through them.
|
|
600
|
+
getPersistentElements() {
|
|
601
|
+
var s;
|
|
602
|
+
const a = ((s = p.getPersistentElements) == null ? void 0 : s.call(p)) || [];
|
|
603
|
+
if (!c || !e) return a;
|
|
604
|
+
const { contentElement: S, baseElement: d } = e.getState();
|
|
605
|
+
if (!d) return a;
|
|
606
|
+
const m = Pt(d), k = [];
|
|
607
|
+
if (S != null && S.id && k.push(`[aria-controls~="${S.id}"]`), d != null && d.id && k.push(`[aria-controls~="${d.id}"]`), !k.length) return [...a, d];
|
|
608
|
+
const I = k.join(","), M = m.querySelectorAll(I);
|
|
609
|
+
return [...a, ...M];
|
|
610
|
+
},
|
|
611
|
+
// The combobox popover should focus on the combobox input when it hides,
|
|
612
|
+
// unless the event was triggered by a click outside the popover, in which
|
|
613
|
+
// case the input shouldn't be re-focused.
|
|
614
|
+
autoFocusOnHide(s) {
|
|
615
|
+
return ke(T, s) ? !1 : f.current ? (f.current = !1, !1) : !0;
|
|
616
|
+
},
|
|
617
|
+
// Make sure we don't hide the popover when the user interacts with the
|
|
618
|
+
// combobox cancel or the combobox disclosure buttons. They will have the
|
|
619
|
+
// aria-controls attribute pointing to either the combobox input or the
|
|
620
|
+
// combobox popover elements.
|
|
621
|
+
hideOnInteractOutside(s) {
|
|
622
|
+
var a, S;
|
|
623
|
+
const d = e == null ? void 0 : e.getState(), m = (a = d == null ? void 0 : d.contentElement) == null ? void 0 : a.id, k = (S = d == null ? void 0 : d.baseElement) == null ? void 0 : S.id;
|
|
624
|
+
if (co(s.target, m, k)) return !1;
|
|
625
|
+
const I = typeof P == "function" ? P(s) : P;
|
|
626
|
+
return I && (f.current = s.type === "click"), I;
|
|
627
|
+
}
|
|
628
|
+
})), p;
|
|
629
|
+
}
|
|
630
|
+
), Fo = jt(
|
|
631
|
+
ne(function(r) {
|
|
632
|
+
const n = fo(r);
|
|
633
|
+
return se(io, n);
|
|
634
|
+
}),
|
|
635
|
+
me
|
|
636
|
+
);
|
|
637
|
+
export {
|
|
638
|
+
Ko as C,
|
|
639
|
+
wo as T,
|
|
640
|
+
To as a,
|
|
641
|
+
Fo as b,
|
|
642
|
+
Ro as c,
|
|
643
|
+
Do as d,
|
|
644
|
+
Ao as e,
|
|
645
|
+
ko as f,
|
|
646
|
+
Lo as g,
|
|
647
|
+
_o as h,
|
|
648
|
+
Yt as i,
|
|
649
|
+
zt as u
|
|
650
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, HTMLAttributeAnchorTarget } from 'react';
|
|
2
2
|
interface AvatarProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
image?: string;
|
|
5
5
|
name?: string;
|
|
6
|
-
size?: "small" | "
|
|
6
|
+
size?: "x-small" | "small" | "medium" | "large" | "x-large";
|
|
7
7
|
withName?: boolean;
|
|
8
|
+
href?: string;
|
|
9
|
+
target?: HTMLAttributeAnchorTarget;
|
|
8
10
|
}
|
|
9
11
|
export declare const Avatar: FC<AvatarProps>;
|
|
10
12
|
export {};
|