@wirecore/wirelayer-react 0.1.0 → 0.2.0

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/virtual.js CHANGED
@@ -10,25 +10,25 @@ import { Portal as C } from "@ark-ui/react/portal";
10
10
  import { createListCollection as w } from "@ark-ui/react/collection";
11
11
  import { Select as T } from "@ark-ui/react/select";
12
12
  import { TreeView as E } from "@ark-ui/react/tree-view";
13
- import { defaultRangeExtractor as D, useVirtualizer as ae } from "@tanstack/react-virtual";
13
+ import { defaultRangeExtractor as D, useVirtualizer as O } from "@tanstack/react-virtual";
14
14
  //#region src/virtual/VirtualSelect.tsx
15
- function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder: c, disabled: l, invalid: te, required: ne, name: re, itemValue: E, itemLabel: D, itemDisabled: O, valueKey: A, clearable: j, loading: M, loadingText: N, size: P, filter: F, manualFilter: I, onFilterChange: L, emptyText: R, hasMore: z, onLoadMore: B, dataSource: V, pageSize: H, minSearchLength: U, className: oe, style: W, onKeyDown: G, ...se }) {
15
+ function k({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder: c, disabled: l, invalid: te, required: ne, name: re, itemValue: E, itemLabel: D, itemDisabled: k, valueKey: j, clearable: M, loading: N, loadingText: P, size: F, filter: I, manualFilter: L, onFilterChange: R, emptyText: z, hasMore: B, onLoadMore: V, dataSource: H, pageSize: U, minSearchLength: ae, className: oe, style: W, onKeyDown: G, ...se }) {
16
16
  let ce = t("select", u), le = t("virtualList", d), K = ce({
17
- size: P,
18
- clearable: j
17
+ size: F,
18
+ clearable: M
19
19
  }), q = le(), J = e(), ue = J.select, de = {
20
20
  itemValue: E,
21
21
  itemLabel: D,
22
- itemDisabled: O,
23
- itemGroup: k,
24
- valueKey: A
22
+ itemDisabled: k,
23
+ itemGroup: A,
24
+ valueKey: j
25
25
  }, [Y, fe] = ie(""), X = r({
26
26
  items: a,
27
- source: V,
27
+ source: H,
28
28
  accessors: de,
29
- pageSize: H,
30
- minSearchLength: U
31
- }), { options: pe, visible: Z, firstFor: me } = n(X.items, de, F && !I && !V ? Y : ""), he = v(() => [...pe, ...X.resolvedOptions], [pe, X.resolvedOptions]), { selected: ge, keys: _e, commit: ve, commitKeys: ye } = i({
29
+ pageSize: U,
30
+ minSearchLength: ae
31
+ }), { options: pe, visible: Z, firstFor: me } = n(X.items, de, I && !L && !H ? Y : ""), he = v(() => [...pe, ...X.resolvedOptions], [pe, X.resolvedOptions]), { selected: ge, keys: _e, commit: ve, commitKeys: ye } = i({
32
32
  multiple: !1,
33
33
  value: o,
34
34
  defaultValue: ee,
@@ -38,20 +38,20 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
38
38
  }), be = _e.join("\0");
39
39
  g(() => {
40
40
  X.resolve(_e, he);
41
- }, [be, V]);
42
- let Q = !!M || X.loading, xe = !!z || X.hasMore, Se = ge[0], Ce = Se?.icon, we = v(() => w({
41
+ }, [be, H]);
42
+ let Q = !!N || X.loading, xe = !!B || X.hasMore, Se = ge[0], Ce = Se?.icon, we = v(() => w({
43
43
  items: Z,
44
44
  itemToString: (e) => e.label,
45
45
  itemToValue: (e) => e.key,
46
46
  isItemDisabled: (e) => e.disabled
47
- }), [Z]), Te = _(), Ee = y(null), De = y(null), $ = ae({
47
+ }), [Z]), Te = _(), Ee = y(null), De = y(null), $ = O({
48
48
  count: Z.length,
49
- getScrollElement: () => F ? De.current : Ee.current,
49
+ getScrollElement: () => I ? De.current : Ee.current,
50
50
  estimateSize: () => 36,
51
51
  overscan: 8
52
- }), Oe = $.getVirtualItems().at(-1)?.index ?? -1, ke = y(B);
52
+ }), Oe = $.getVirtualItems().at(-1)?.index ?? -1, ke = y(V);
53
53
  g(() => {
54
- ke.current = V ? X.loadMore : B;
54
+ ke.current = H ? X.loadMore : V;
55
55
  }), g(() => {
56
56
  xe && !Q && Z.length && Oe >= Z.length - 1 && ke.current?.();
57
57
  }, [
@@ -61,7 +61,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
61
61
  xe
62
62
  ]);
63
63
  function Ae(e) {
64
- G?.(e), j && ge.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), ve([]));
64
+ G?.(e), M && ge.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), ve([]));
65
65
  }
66
66
  let je = /* @__PURE__ */ S(b, { children: [
67
67
  /* @__PURE__ */ x("div", {
@@ -97,13 +97,13 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
97
97
  children: [/* @__PURE__ */ x(m, {
98
98
  className: K.loadingIcon(),
99
99
  "aria-hidden": "true"
100
- }), N ?? J.common.loading]
100
+ }), P ?? J.common.loading]
101
101
  }),
102
102
  !Z.length && !Q && /* @__PURE__ */ x("div", {
103
103
  role: "option",
104
104
  "aria-disabled": "true",
105
105
  className: K.empty(),
106
- children: R ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
106
+ children: z ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
107
107
  })
108
108
  ] });
109
109
  return /* @__PURE__ */ S(T.Root, {
@@ -113,7 +113,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
113
113
  value: _e,
114
114
  onValueChange: (e) => ye(e.value, e.items),
115
115
  onOpenChange: (e) => {
116
- e.open && X.open(), !e.open && Y && (fe(""), L?.(""), V && X.search(""));
116
+ e.open && X.open(), !e.open && Y && (fe(""), R?.(""), H && X.search(""));
117
117
  },
118
118
  disabled: l,
119
119
  invalid: te,
@@ -123,11 +123,11 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
123
123
  sameWidth: !0,
124
124
  gutter: 4
125
125
  },
126
- composite: !F,
126
+ composite: !I,
127
127
  scrollToIndexFn: (e) => $.scrollToIndex(e.index, { align: "auto" }),
128
128
  children: [
129
129
  /* @__PURE__ */ S(T.Control, {
130
- ...j ? { className: K.control() } : {},
130
+ ...M ? { className: K.control() } : {},
131
131
  children: [/* @__PURE__ */ S(T.Trigger, {
132
132
  ...se,
133
133
  className: K.trigger(),
@@ -152,7 +152,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
152
152
  "aria-hidden": "true"
153
153
  })
154
154
  })]
155
- }), j && /* @__PURE__ */ x(T.Context, { children: (e) => Se && !e.disabled && /* @__PURE__ */ x("button", {
155
+ }), M && /* @__PURE__ */ x(T.Context, { children: (e) => Se && !e.disabled && /* @__PURE__ */ x("button", {
156
156
  type: "button",
157
157
  tabIndex: -1,
158
158
  className: K.clear(),
@@ -170,8 +170,8 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
170
170
  ref: Ee,
171
171
  className: K.content(),
172
172
  "aria-busy": Q || void 0,
173
- "aria-label": F ? se["aria-label"] : void 0,
174
- children: F ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
173
+ "aria-label": I ? se["aria-label"] : void 0,
174
+ children: I ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
175
175
  className: K.header(),
176
176
  children: /* @__PURE__ */ x(T.Context, { children: (e) => /* @__PURE__ */ x("input", {
177
177
  type: "text",
@@ -188,8 +188,8 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
188
188
  className: K.search(),
189
189
  onChange: (t) => {
190
190
  let n = t.target.value;
191
- fe(n), L?.(n), V && X.search(n);
192
- let r = I || V ? void 0 : me(n);
191
+ fe(n), R?.(n), H && X.search(n);
192
+ let r = L || H ? void 0 : me(n);
193
193
  r && requestAnimationFrame(() => e.setHighlightValue(r.key));
194
194
  },
195
195
  onKeyDown: (e) => {
@@ -208,7 +208,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
208
208
  })] }) : je
209
209
  }) }) }),
210
210
  /* @__PURE__ */ x(T.HiddenSelect, {}),
211
- V && /* @__PURE__ */ x("span", {
211
+ H && /* @__PURE__ */ x("span", {
212
212
  role: "status",
213
213
  className: K.status(),
214
214
  children: X.announcement
@@ -216,22 +216,22 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
216
216
  ]
217
217
  });
218
218
  }
219
- var k = () => void 0;
219
+ var A = () => void 0;
220
220
  //#endregion
221
221
  //#region src/virtual/VirtualList.tsx
222
- function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, height: ee = "20rem", itemGroup: s, hasMore: c = !1, loading: l = !1, loadingMore: u = !1, endThreshold: te = 5, onLoadMore: d, onEndReached: f, dataSource: p, query: h, pageSize: _, children: ie, className: C, style: w, ref: T }) {
223
- let E = t("virtualListBox", ne)(), O = e(), k = y(null), { search: A, ...j } = h ?? {}, M = a({
222
+ function j({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, height: ee = "20rem", itemGroup: s, hasMore: c = !1, loading: l = !1, loadingMore: u = !1, endThreshold: te = 5, onLoadMore: d, onEndReached: f, dataSource: p, query: h, pageSize: _, children: ie, className: C, style: w, ref: T }) {
223
+ let E = t("virtualListBox", ne)(), k = e(), A = y(null), { search: j, ...M } = h ?? {}, N = a({
224
224
  source: p,
225
225
  pageSize: _,
226
- query: h ? j : void 0
227
- }), N = y(null);
226
+ query: h ? M : void 0
227
+ }), P = y(null);
228
228
  g(() => {
229
229
  if (!p) return;
230
- let e = N.current === null;
231
- N.current = A ?? "", M.search(A ?? "", !e);
232
- }, [p, A]);
233
- let P = p ? M.state.items : n, F = p ? M.state.hasMore : c, I = p ? M.state.status === "loading" : l || u, L = v(() => {
234
- if (!s) return P.map((e, t) => ({
230
+ let e = P.current === null;
231
+ P.current = j ?? "", N.search(j ?? "", !e);
232
+ }, [p, j]);
233
+ let F = p ? N.state.items : n, I = p ? N.state.hasMore : c, L = p ? N.state.status === "loading" : l || u, R = v(() => {
234
+ if (!s) return F.map((e, t) => ({
235
235
  kind: "item",
236
236
  item: e,
237
237
  index: t
@@ -240,7 +240,7 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
240
240
  let t = typeof s == "function" ? s(e) : e?.[s];
241
241
  return t == null || t === "" ? void 0 : String(t);
242
242
  }, t = [], n;
243
- return P.forEach((r, i) => {
243
+ return F.forEach((r, i) => {
244
244
  let a = e(r);
245
245
  a !== void 0 && a !== n && t.push({
246
246
  kind: "header",
@@ -251,40 +251,40 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
251
251
  index: i
252
252
  });
253
253
  }), t;
254
- }, [P, s]), R = v(() => L.flatMap((e, t) => e.kind === "header" ? [t] : []), [L]), z = (e) => [...R].reverse().find((t) => e >= t) ?? -1, B = ae({
255
- count: L.length,
256
- getScrollElement: () => k.current,
254
+ }, [F, s]), z = v(() => R.flatMap((e, t) => e.kind === "header" ? [t] : []), [R]), B = (e) => [...z].reverse().find((t) => e >= t) ?? -1, V = O({
255
+ count: R.length,
256
+ getScrollElement: () => A.current,
257
257
  estimateSize: (e) => {
258
- let t = L[e];
258
+ let t = R[e];
259
259
  return t?.kind === "item" && o ? o(t.item, t.index) : i;
260
260
  },
261
261
  measureElement: (e) => e.getBoundingClientRect().height || i,
262
262
  overscan: 6,
263
- rangeExtractor: R.length ? (e) => {
264
- let t = z(e.startIndex), n = new Set(D(e));
263
+ rangeExtractor: z.length ? (e) => {
264
+ let t = B(e.startIndex), n = new Set(D(e));
265
265
  return t >= 0 && n.add(t), [...n].sort((e, t) => e - t);
266
266
  } : D,
267
267
  initialRect: {
268
268
  width: 0,
269
269
  height: 320
270
270
  }
271
- }), V = B.getVirtualItems(), H = R.length ? z(B.range?.startIndex ?? 0) : -1, U = y(-1), oe = V.at(-1)?.index;
271
+ }), H = V.getVirtualItems(), U = z.length ? B(V.range?.startIndex ?? 0) : -1, ae = y(-1), oe = H.at(-1)?.index;
272
272
  g(() => {
273
- oe !== void 0 && F && !I && U.current !== L.length && (oe < L.length - 1 - te || (U.current = L.length, p ? M.loadMore() : (d?.(), f?.())));
273
+ oe !== void 0 && I && !L && ae.current !== R.length && (oe < R.length - 1 - te || (ae.current = R.length, p ? N.loadMore() : (d?.(), f?.())));
274
274
  });
275
275
  let W = !!p || c || l || u;
276
276
  re(T, () => ({
277
277
  scrollToIndex(e, t = {}) {
278
- let n = L.findIndex((t) => t.kind === "item" && t.index === e);
279
- n >= 0 && B.scrollToIndex(n, { align: t.align ?? "auto" });
278
+ let n = R.findIndex((t) => t.kind === "item" && t.index === e);
279
+ n >= 0 && V.scrollToIndex(n, { align: t.align ?? "auto" });
280
280
  },
281
- refresh: () => M.refresh()
281
+ refresh: () => N.refresh()
282
282
  }));
283
283
  let G = /* @__PURE__ */ S("div", {
284
- ref: k,
284
+ ref: A,
285
285
  role: "list",
286
286
  "aria-label": r,
287
- "aria-busy": W && I || void 0,
287
+ "aria-busy": W && L || void 0,
288
288
  tabIndex: 0,
289
289
  className: E.base({ class: C }),
290
290
  style: {
@@ -293,14 +293,14 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
293
293
  },
294
294
  children: [/* @__PURE__ */ x("div", {
295
295
  className: E.spacer(),
296
- style: { height: B.getTotalSize() },
297
- children: V.map((e) => {
298
- let t = L[e.index];
296
+ style: { height: V.getTotalSize() },
297
+ children: H.map((e) => {
298
+ let t = R[e.index];
299
299
  if (!t) return null;
300
300
  if (t.kind === "header") {
301
- let n = e.index === H;
301
+ let n = e.index === U;
302
302
  return /* @__PURE__ */ x("div", {
303
- ref: B.measureElement,
303
+ ref: V.measureElement,
304
304
  role: "presentation",
305
305
  "data-index": e.index,
306
306
  className: n ? E.groupHeader({ class: E.sticky() }) : E.item({ class: E.groupHeader() }),
@@ -309,39 +309,39 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
309
309
  }, e.key);
310
310
  }
311
311
  return /* @__PURE__ */ x("div", {
312
- ref: B.measureElement,
312
+ ref: V.measureElement,
313
313
  role: "listitem",
314
314
  "aria-posinset": t.index + 1,
315
- "aria-setsize": P.length,
315
+ "aria-setsize": F.length,
316
316
  "data-index": e.index,
317
317
  className: E.item(),
318
318
  style: { transform: `translateY(${e.start}px)` },
319
319
  children: ie(t.item, t.index)
320
320
  }, e.key);
321
321
  })
322
- }), W && I && P.length > 0 && /* @__PURE__ */ S("div", {
322
+ }), W && L && F.length > 0 && /* @__PURE__ */ S("div", {
323
323
  className: E.loading(),
324
324
  "aria-hidden": "true",
325
- children: [/* @__PURE__ */ x(m, { className: E.loadingIcon() }), O.dataSource.loadingMore]
325
+ children: [/* @__PURE__ */ x(m, { className: E.loadingIcon() }), k.dataSource.loadingMore]
326
326
  })]
327
327
  });
328
328
  return p ? /* @__PURE__ */ S(b, { children: [G, /* @__PURE__ */ x("p", {
329
329
  role: "status",
330
330
  className: E.status(),
331
- children: M.announcement
331
+ children: N.announcement
332
332
  })] }) : G;
333
333
  }
334
334
  //#endregion
335
335
  //#region src/virtual/VirtualTree.tsx
336
- function j(e, t = 6) {
336
+ function M(e, t = 6) {
337
337
  requestAnimationFrame(() => {
338
338
  let n = e();
339
- n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 && j(e, t - 1);
339
+ n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 && M(e, t - 1);
340
340
  });
341
341
  }
342
- function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u = "single", checkable: d = !1, checkStrictly: ne = !1, checkedValue: f, defaultCheckedValue: p, reorderable: h = !1, filter: g = !1, filterMode: _ = "filter", expandControls: ie = !1, renderNode: b, emptyText: C, empty: w, height: T = "20rem", itemHeight: D = 32, className: O, style: k, ref: A, ...M }) {
343
- let N = t("tree", te, n)(), P = e(), F = P.tree, I = y(null), L = y(null), R = s({
344
- ...M,
342
+ function N({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u = "single", checkable: d = !1, checkStrictly: ne = !1, checkedValue: f, defaultCheckedValue: p, reorderable: h = !1, filter: g = !1, filterMode: _ = "filter", expandControls: ie = !1, renderNode: b, emptyText: C, empty: w, height: T = "20rem", itemHeight: D = 32, className: k, style: A, ref: j, ...N }) {
343
+ let P = t("tree", te, n)(), F = e(), I = F.tree, L = y(null), R = y(null), z = s({
344
+ ...N,
345
345
  items: r,
346
346
  checkable: d,
347
347
  checkStrictly: ne,
@@ -349,29 +349,29 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
349
349
  defaultCheckedValue: p,
350
350
  reorderable: h,
351
351
  filterMode: _
352
- }, I), z = v(() => {
352
+ }, L), B = v(() => {
353
353
  let e = [];
354
- for (let t of l(R.view, R.expanded)) e.push({
354
+ for (let t of l(z.view, z.expanded)) e.push({
355
355
  ...t,
356
356
  kind: "node"
357
- }), t.expanded && R.loadingOf(t.node) && e.push({
357
+ }), t.expanded && z.loadingOf(t.node) && e.push({
358
358
  kind: "loading",
359
359
  parentId: t.node.id,
360
360
  level: t.level
361
361
  });
362
362
  return e;
363
363
  }, [
364
- R.view,
365
- R.expanded,
366
- R.loadingOf
367
- ]), B = ae({
368
- count: z.length,
369
- getScrollElement: () => L.current,
364
+ z.view,
365
+ z.expanded,
366
+ z.loadingOf
367
+ ]), V = O({
368
+ count: B.length,
369
+ getScrollElement: () => R.current,
370
370
  estimateSize: () => D,
371
371
  measureElement: (e) => e.getBoundingClientRect().height || D,
372
372
  overscan: 8,
373
373
  getItemKey: (e) => {
374
- let t = z[e];
374
+ let t = B[e];
375
375
  return t.kind === "node" ? t.node.id : `${t.parentId}\u0000loading`;
376
376
  },
377
377
  initialRect: {
@@ -379,44 +379,44 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
379
379
  height: 320
380
380
  }
381
381
  });
382
- re(A, () => ({
383
- expandAll: R.expandAll,
384
- collapseAll: R.collapseAll,
385
- invalidate: R.invalidate,
382
+ re(j, () => ({
383
+ expandAll: z.expandAll,
384
+ collapseAll: z.collapseAll,
385
+ invalidate: z.invalidate,
386
386
  focusNode: (e) => {
387
- let t = z.findIndex((t) => t.kind === "node" && t.node.id === e);
388
- t >= 0 && B.scrollToIndex(t, { align: "auto" }), requestAnimationFrame(() => R.focusNode(e));
387
+ let t = B.findIndex((t) => t.kind === "node" && t.node.id === e);
388
+ t >= 0 && V.scrollToIndex(t, { align: "auto" }), requestAnimationFrame(() => z.focusNode(e));
389
389
  }
390
390
  }));
391
- let V = C ?? (R.query.trim() ? F.noMatches : M.group === void 0 ? void 0 : P.common.empty), H = !R.view.length && (V !== void 0 || !!w || M.group !== void 0);
391
+ let H = C ?? (z.query.trim() ? I.noMatches : N.group === void 0 ? void 0 : F.common.empty), U = !z.view.length && (H !== void 0 || !!w || N.group !== void 0);
392
392
  return /* @__PURE__ */ S(E.Root, {
393
- ref: I,
394
- className: N.base({ class: O }),
395
- style: k,
396
- collection: R.collection,
393
+ ref: L,
394
+ className: P.base({ class: k }),
395
+ style: A,
396
+ collection: z.collection,
397
397
  selectionMode: u,
398
- selectedValue: R.selected,
399
- onSelectionChange: (e) => R.onSelectionChange(e.selectedValue),
400
- expandedValue: R.expanded,
401
- onExpandedChange: (e) => R.setExpanded(e.expandedValue),
402
- ...R.ownChecks ? {} : {
398
+ selectedValue: z.selected,
399
+ onSelectionChange: (e) => z.onSelectionChange(e.selectedValue),
400
+ expandedValue: z.expanded,
401
+ onExpandedChange: (e) => z.setExpanded(e.expandedValue),
402
+ ...z.ownChecks ? {} : {
403
403
  checkedValue: f,
404
404
  defaultCheckedValue: p
405
405
  },
406
- onCheckedChange: (e) => R.ownChecks || R.onArkCheckedChange(e.checkedValue),
407
- translations: { treeLabel: i ?? a ?? P.tree.treeLabel },
406
+ onCheckedChange: (e) => z.ownChecks || z.onArkCheckedChange(e.checkedValue),
407
+ translations: { treeLabel: i ?? a ?? F.tree.treeLabel },
408
408
  scrollToIndexFn: ({ node: e, getElement: t }) => {
409
- let n = z.findIndex((t) => t.kind === "node" && t.node.id === e.id);
410
- n < 0 || (B.scrollToIndex(n, { align: "auto" }), j(t));
409
+ let n = B.findIndex((t) => t.kind === "node" && t.node.id === e.id);
410
+ n < 0 || (V.scrollToIndex(n, { align: "auto" }), M(t));
411
411
  },
412
- onKeyDownCapture: R.onKeyDown,
412
+ onKeyDownCapture: z.onKeyDown,
413
413
  children: [
414
414
  i && /* @__PURE__ */ x(E.Label, {
415
- className: N.label(),
415
+ className: P.label(),
416
416
  children: i
417
417
  }),
418
418
  /* @__PURE__ */ x(o, {
419
- model: R,
419
+ model: z,
420
420
  filter: g,
421
421
  filterMode: _,
422
422
  expandControls: ie,
@@ -424,25 +424,25 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
424
424
  }),
425
425
  /* @__PURE__ */ x(c, {
426
426
  value: {
427
- model: R,
427
+ model: z,
428
428
  checkable: d,
429
429
  showLines: !1,
430
430
  renderNode: b
431
431
  },
432
432
  children: /* @__PURE__ */ x(E.Tree, {
433
- ref: L,
434
- className: N.tree({ class: N.viewport() }),
433
+ ref: R,
434
+ className: P.tree({ class: P.viewport() }),
435
435
  style: { height: T },
436
- hidden: H || void 0,
436
+ hidden: U || void 0,
437
437
  children: /* @__PURE__ */ x("div", {
438
- className: N.spacer(),
439
- style: { height: B.getTotalSize() },
440
- children: B.getVirtualItems().map((e) => {
441
- let t = z[e.index];
438
+ className: P.spacer(),
439
+ style: { height: V.getTotalSize() },
440
+ children: V.getVirtualItems().map((e) => {
441
+ let t = B[e.index];
442
442
  return /* @__PURE__ */ x("div", {
443
- ref: B.measureElement,
443
+ ref: V.measureElement,
444
444
  "data-index": e.index,
445
- className: N.row(),
445
+ className: P.row(),
446
446
  style: { transform: `translateY(${e.start}px)` },
447
447
  children: t.kind === "node" ? /* @__PURE__ */ x(ee, {
448
448
  node: t.node,
@@ -451,29 +451,32 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
451
451
  posinset: t.posinset,
452
452
  setsize: t.setsize
453
453
  }) : /* @__PURE__ */ S("div", {
454
- className: N.loadingRow(),
454
+ className: P.loadingRow(),
455
455
  style: { "--depth": t.level },
456
456
  "aria-hidden": "true",
457
- children: [/* @__PURE__ */ x(m, { className: N.loadingIcon() }), F.loadingRow]
457
+ children: [/* @__PURE__ */ x(m, { className: P.loadingIcon() }), I.loadingRow]
458
458
  })
459
459
  }, e.key);
460
460
  })
461
461
  })
462
462
  })
463
463
  }),
464
- H && /* @__PURE__ */ x("div", {
465
- className: N.empty(),
466
- onDragOver: R.onEmptyDragOver,
467
- onDrop: R.onEmptyDrop,
468
- children: w ?? V
464
+ U && /* @__PURE__ */ x("div", {
465
+ className: P.empty(),
466
+ onDragOver: z.onEmptyDragOver,
467
+ onDrop: z.onEmptyDrop,
468
+ children: w ?? H
469
469
  }),
470
470
  /* @__PURE__ */ x("p", {
471
471
  role: "status",
472
- className: N.status(),
473
- children: R.status
472
+ className: P.status(),
473
+ children: z.status
474
474
  })
475
475
  ]
476
476
  });
477
477
  }
478
478
  //#endregion
479
- export { A as VirtualList, O as VirtualSelect, M as VirtualTree };
479
+ //#region src/virtual/virtual-rows.ts
480
+ var P = { useVirtualizer: O };
481
+ //#endregion
482
+ export { j as VirtualList, k as VirtualSelect, N as VirtualTree, P as virtualRows };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecore/wirelayer-react",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "WireLayer components for React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -157,8 +157,8 @@
157
157
  "dependencies": {
158
158
  "@ark-ui/react": "^5.39.3",
159
159
  "@internationalized/date": "^3.12.4",
160
- "@wirecore/wirelayer-recipes": "^0.1.0",
161
- "@wirecore/wirelayer-tokens": "^0.1.0",
160
+ "@wirecore/wirelayer-recipes": "^0.2.0",
161
+ "@wirecore/wirelayer-tokens": "^0.2.0",
162
162
  "lucide-react": "^1.59.0"
163
163
  },
164
164
  "devDependencies": {