@danxbot/ui 26.5.1 → 26.5.3

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/index.js CHANGED
@@ -19390,12 +19390,17 @@ function Ko({
19390
19390
  children: d,
19391
19391
  ref: f
19392
19392
  }) {
19393
- const p = VE({ size: l }), h = pe().dialog, m = l === "full" ? "xs" : "sm", g = LE(t), v = FE(t, n), [b, x] = re(null), y = be(null), w = () => a ? b : y.current?.querySelector("[data-autofocus]") ?? !0, S = Ne(
19394
- (C) => {
19395
- y.current = C, x(C), typeof f == "function" ? f(C) : f && (f.current = C);
19393
+ const p = VE({ size: l }), h = pe().dialog, m = l === "full" ? "xs" : "sm", g = LE(t), v = FE(t, n), b = be(null), x = Ne(
19394
+ (w) => {
19395
+ b.current = w, typeof f == "function" ? f(w) : f && (f.current = w);
19396
19396
  },
19397
19397
  [f]
19398
- );
19398
+ ), y = (w) => {
19399
+ const S = b.current;
19400
+ if (a) return S;
19401
+ const C = S?.querySelector("[data-autofocus]");
19402
+ return C || (w === "touch" ? S : !0);
19403
+ };
19399
19404
  return /* @__PURE__ */ M(sb, { open: t, onOpenChange: v, children: [
19400
19405
  e && /* @__PURE__ */ u(tf, { render: e }),
19401
19406
  /* @__PURE__ */ M(yl, { children: [
@@ -19403,10 +19408,10 @@ function Ko({
19403
19408
  /* @__PURE__ */ M(
19404
19409
  xl,
19405
19410
  {
19406
- ref: S,
19411
+ ref: x,
19407
19412
  className: B(p.popup(), c),
19408
19413
  finalFocus: g,
19409
- initialFocus: w,
19414
+ initialFocus: y,
19410
19415
  children: [
19411
19416
  /* @__PURE__ */ M("div", { className: p.header(), children: [
19412
19417
  /* @__PURE__ */ M("div", { className: "min-w-0 flex-1 basis-40", children: [
@@ -28498,6 +28503,9 @@ const OR = ht({
28498
28503
  instead of 12px everywhere else. The wrapper carries the group's vertical
28499
28504
  rhythm (cancelled at the two ends the divider does not need) so a child's
28500
28505
  own box keeps its own padding. */
28506
+ /* `Children.toArray` first: it drops `false`/`null` (a conditional child), which
28507
+ `Children.map` would hand to the callback and wrap as an empty, padded,
28508
+ divided item. */
28501
28509
  item: "min-w-0 py-4 first:pt-0 last:pb-0"
28502
28510
  },
28503
28511
  variants: {
@@ -28581,7 +28589,7 @@ function Yee({
28581
28589
  const i = OR();
28582
28590
  return /* @__PURE__ */ M(bf, { className: o, children: [
28583
28591
  /* @__PURE__ */ u(TR, { title: e, description: t, titleAs: n }),
28584
- /* @__PURE__ */ u("div", { className: i.rows(), children: Dk.map(s, (a) => /* @__PURE__ */ u("div", { className: i.item(), "data-slot": "setting-group-item", children: a })) }),
28592
+ /* @__PURE__ */ u("div", { className: i.rows(), children: Dk.toArray(s).map((a, l) => /* @__PURE__ */ u("div", { className: i.item(), "data-slot": "setting-group-item", children: a }, l)) }),
28585
28593
  r && /* @__PURE__ */ u(PR, { children: r })
28586
28594
  ] });
28587
28595
  }
@@ -36324,23 +36332,28 @@ function bte({
36324
36332
  ...s
36325
36333
  }) {
36326
36334
  const i = be(null);
36327
- return De(() => {
36335
+ De(() => {
36328
36336
  r && i.current?.querySelector("input")?.focus();
36329
- }, [r]), /* @__PURE__ */ u(
36337
+ }, [r]);
36338
+ const a = Ne(
36339
+ (l) => {
36340
+ i.current = l, typeof o == "function" ? o(l) : o && (o.current = l);
36341
+ },
36342
+ [o]
36343
+ );
36344
+ return /* @__PURE__ */ u(
36330
36345
  fI,
36331
36346
  {
36332
- ref: (a) => {
36333
- i.current = a, typeof o == "function" ? o(a) : o && (o.current = a);
36334
- },
36347
+ ref: a,
36335
36348
  length: e,
36336
36349
  className: B("flex items-center gap-2", n),
36337
36350
  ...s,
36338
- children: Array.from({ length: e }, (a, l) => /* @__PURE__ */ M("span", { className: "flex items-center gap-2", children: [
36351
+ children: Array.from({ length: e }, (l, c) => /* @__PURE__ */ M("span", { className: "flex items-center gap-2", children: [
36339
36352
  /* @__PURE__ */ M("span", { className: "relative", children: [
36340
36353
  /* @__PURE__ */ u(
36341
36354
  pI,
36342
36355
  {
36343
- "data-autofocus": r && l === 0 ? "" : void 0,
36356
+ "data-autofocus": r && c === 0 ? "" : void 0,
36344
36357
  className: B(
36345
36358
  "peer",
36346
36359
  "grid h-control-md w-11 place-items-center rounded-md",
@@ -36368,8 +36381,8 @@ function bte({
36368
36381
  }
36369
36382
  )
36370
36383
  ] }),
36371
- t && l === t - 1 && l < e - 1 && /* @__PURE__ */ u("span", { "aria-hidden": !0, className: "h-px w-2.5 rounded-full bg-border-strong" })
36372
- ] }, l))
36384
+ t && c === t - 1 && c < e - 1 && /* @__PURE__ */ u("span", { "aria-hidden": !0, className: "h-px w-2.5 rounded-full bg-border-strong" })
36385
+ ] }, c))
36373
36386
  }
36374
36387
  );
36375
36388
  }