@danxbot/ui 26.3.0 → 26.5.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/index.js CHANGED
@@ -19390,9 +19390,9 @@ function Ko({
19390
19390
  children: d,
19391
19391
  ref: f
19392
19392
  }) {
19393
- const p = FE({ size: l }), h = pe().dialog, m = l === "full" ? "xs" : "sm", g = $E(t), v = LE(t, n), [b, x] = re(null), y = Ne(
19394
- (w) => {
19395
- x(w), typeof f == "function" ? f(w) : f && (f.current = w);
19393
+ const p = FE({ size: l }), h = pe().dialog, m = l === "full" ? "xs" : "sm", g = $E(t), v = LE(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);
19396
19396
  },
19397
19397
  [f]
19398
19398
  );
@@ -19403,10 +19403,10 @@ function Ko({
19403
19403
  /* @__PURE__ */ M(
19404
19404
  xl,
19405
19405
  {
19406
- ref: y,
19406
+ ref: S,
19407
19407
  className: B(p.popup(), c),
19408
19408
  finalFocus: g,
19409
- initialFocus: a ? () => b : void 0,
19409
+ initialFocus: w,
19410
19410
  children: [
19411
19411
  /* @__PURE__ */ M("div", { className: p.header(), children: [
19412
19412
  /* @__PURE__ */ M("div", { className: "min-w-0 flex-1 basis-40", children: [
@@ -36315,37 +36315,57 @@ function bte({
36315
36315
  length: e = 6,
36316
36316
  groupAfter: t,
36317
36317
  className: n,
36318
- ref: r,
36319
- ...o
36318
+ autoFocus: r,
36319
+ ref: o,
36320
+ ...s
36320
36321
  }) {
36321
- return /* @__PURE__ */ u(
36322
+ const i = be(null);
36323
+ return De(() => {
36324
+ r && i.current?.querySelector("input")?.focus();
36325
+ }, [r]), /* @__PURE__ */ u(
36322
36326
  dI,
36323
36327
  {
36324
- ref: r,
36328
+ ref: (a) => {
36329
+ i.current = a, typeof o == "function" ? o(a) : o && (o.current = a);
36330
+ },
36325
36331
  length: e,
36326
36332
  className: B("flex items-center gap-2", n),
36327
- ...o,
36328
- children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ M("span", { className: "flex items-center gap-2", children: [
36329
- /* @__PURE__ */ u(
36330
- fI,
36331
- {
36332
- className: B(
36333
- "grid h-control-md w-11 place-items-center rounded-md",
36334
- "border border-field-border bg-field",
36335
- "text-center font-mono text-lg tabular-nums text-primary",
36336
- "transition-[var(--tx-colors),box-shadow] duration-(--dur-fast) ease-hover",
36337
- "hover:not-disabled:border-field-border-hover",
36338
- /* The active box is marked by the box itself, not by a caret —
36339
- see the note above. */
36340
- "data-active:border-control data-active:shadow-[0_0_0_3px_var(--control-focus-halo)]",
36341
- "data-invalid:border-danger",
36342
- "disabled:opacity-45",
36343
- "outline-none"
36344
- )
36345
- }
36346
- ),
36347
- t && i === t - 1 && i < e - 1 && /* @__PURE__ */ u("span", { "aria-hidden": !0, className: "h-px w-2.5 rounded-full bg-border-strong" })
36348
- ] }, i))
36333
+ ...s,
36334
+ children: Array.from({ length: e }, (a, l) => /* @__PURE__ */ M("span", { className: "flex items-center gap-2", children: [
36335
+ /* @__PURE__ */ M("span", { className: "relative", children: [
36336
+ /* @__PURE__ */ u(
36337
+ fI,
36338
+ {
36339
+ "data-autofocus": r && l === 0 ? "" : void 0,
36340
+ className: B(
36341
+ "peer",
36342
+ "grid h-control-md w-11 place-items-center rounded-md",
36343
+ "border border-field-border bg-field",
36344
+ "text-center font-mono text-lg tabular-nums text-primary",
36345
+ "transition-[var(--tx-colors),box-shadow] duration-(--dur-fast) ease-hover",
36346
+ "hover:not-disabled:border-field-border-hover",
36347
+ /* DX-5127: the box holding real focus IS the active slot (the
36348
+ next digit goes into the focused box), so it gets the ring;
36349
+ Base UI has no per-slot "active" attribute. A filled box
36350
+ reads as filled: stronger border and a tinted background. */
36351
+ "focus:border-control focus:shadow-[0_0_0_3px_var(--control-focus-halo)]",
36352
+ "data-filled:border-border-strong data-filled:bg-surface-sunken",
36353
+ "data-invalid:border-danger",
36354
+ "disabled:opacity-45",
36355
+ "outline-none"
36356
+ )
36357
+ }
36358
+ ),
36359
+ /* @__PURE__ */ u(
36360
+ "span",
36361
+ {
36362
+ "aria-hidden": !0,
36363
+ className: "pointer-events-none absolute left-1/2 top-1/2 hidden h-5 w-px -translate-x-1/2 -translate-y-1/2 bg-primary peer-focus:peer-not-data-filled:block motion-safe:peer-focus:peer-not-data-filled:animate-[dx-otp-caret_1s_steps(1)_infinite]"
36364
+ }
36365
+ )
36366
+ ] }),
36367
+ t && l === t - 1 && l < e - 1 && /* @__PURE__ */ u("span", { "aria-hidden": !0, className: "h-px w-2.5 rounded-full bg-border-strong" })
36368
+ ] }, l))
36349
36369
  }
36350
36370
  );
36351
36371
  }