@nice2dev/ui-core 1.4.1 → 1.4.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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import je, { createContext as ne, useContext as Q, useState as M, useRef as T, useCallback as k, useEffect as L, useId as Ar, useMemo as X, useSyncExternalStore as Xa, Profiler as ja, memo as Ua, startTransition as Er, useDeferredValue as Kt, useTransition as Ka } from "react";
2
2
  import { jsx as w, jsxs as H, Fragment as Tt } from "react/jsx-runtime";
3
- import { u as qa, N as ie, c as Tr, a as Ga, b as Ja, d as Ya, e as Qa, g as qt, f as Za } from "./input-layer-ZtEUgROz.js";
4
- import { I as W0, L as V0, h as X0, i as j0, j as U0, k as K0, l as q0, m as G0, n as J0, o as Y0, p as Q0, q as Z0, r as ep, s as tp, t as rp, v as ap, w as np, x as op, y as ip, z as sp, A as cp, B as lp, C as dp, D as up, E as fp, F as pp, G as mp, H as gp, J as yp, K as hp, M as bp, R as vp, O as xp, P as Sp, Q as wp, S as kp, T as Cp, U as Np, V as Mp, W as Ap, X as Ep, Y as Tp, Z as Lp, _ as Ip, $ as $p, a0 as Fp, a1 as Rp, a2 as zp, a3 as Hp, a4 as Dp, a5 as Pp, a6 as Bp, a7 as Op, a8 as _p, a9 as Wp, aa as Vp, ab as Xp, ac as jp, ad as Up, ae as Kp, af as qp, ag as Gp, ah as Jp, ai as Yp, aj as Qp, ak as Zp, al as em, am as tm, an as rm, ao as am, ap as nm, aq as om, ar as im, as as sm, at as cm, au as lm, av as dm, aw as um, ax as fm, ay as pm, az as mm, aA as gm, aB as ym, aC as hm, aD as bm, aE as vm, aF as xm, aG as Sm, aH as wm, aI as km, aJ as Cm, aK as Nm, aL as Mm, aM as Am, aN as Em, aO as Tm } from "./input-layer-ZtEUgROz.js";
3
+ import { u as Ga, N as ie, c as Tr, a as qa, b as Ja, d as Ya, e as Qa, g as Gt, f as Za } from "./input-layer-ZtEUgROz.js";
4
+ import { I as W0, L as V0, h as X0, i as j0, j as U0, k as K0, l as G0, m as q0, n as J0, o as Y0, p as Q0, q as Z0, r as ep, s as tp, t as rp, v as ap, w as np, x as op, y as ip, z as sp, A as cp, B as lp, C as dp, D as up, E as fp, F as pp, G as mp, H as gp, J as yp, K as hp, M as bp, R as vp, O as xp, P as Sp, Q as wp, S as kp, T as Cp, U as Np, V as Mp, W as Ap, X as Ep, Y as Tp, Z as Lp, _ as Ip, $ as $p, a0 as Fp, a1 as Rp, a2 as zp, a3 as Hp, a4 as Dp, a5 as Pp, a6 as Bp, a7 as Op, a8 as _p, a9 as Wp, aa as Vp, ab as Xp, ac as jp, ad as Up, ae as Kp, af as Gp, ag as qp, ah as Jp, ai as Yp, aj as Qp, ak as Zp, al as em, am as tm, an as rm, ao as am, ap as nm, aq as om, ar as im, as as sm, at as cm, au as lm, av as dm, aw as um, ax as fm, ay as pm, az as mm, aA as gm, aB as ym, aC as hm, aD as bm, aE as vm, aF as xm, aG as Sm, aH as wm, aI as km, aJ as Cm, aK as Nm, aL as Mm, aM as Am, aN as Em, aO as Tm } from "./input-layer-ZtEUgROz.js";
5
5
  import { useNiceTranslation as Z, NiceI18nLazyProvider as en } from "@nice2dev/i18n";
6
6
  import { NICE_SUPPORTED_LANGS as Im, NiceI18nLazyProvider as $m, NiceI18nProvider as Fm, createICUTranslator as Rm, formatICU as zm, getLoadedNiceDictionary as Hm, loadNiceDictionary as Dm, useNiceTranslation as Pm } from "@nice2dev/i18n";
7
7
  const tn = {
@@ -2323,7 +2323,7 @@ const _l = ({ style: e }) => /* @__PURE__ */ w(
2323
2323
  ...e
2324
2324
  }
2325
2325
  }
2326
- ), Gt = {
2326
+ ), qt = {
2327
2327
  down: { transform: "rotate(45deg)", margin: "0 0 0.2em" },
2328
2328
  up: { transform: "rotate(-135deg)", margin: "0.2em 0 0" },
2329
2329
  left: { transform: "rotate(135deg)", margin: "0 0 0 0.2em" },
@@ -2336,10 +2336,10 @@ const _l = ({ style: e }) => /* @__PURE__ */ w(
2336
2336
  display: "inline-block",
2337
2337
  width: "0.45em",
2338
2338
  height: "0.45em",
2339
- margin: Gt[e].margin,
2339
+ margin: qt[e].margin,
2340
2340
  borderRight: "0.12em solid currentColor",
2341
2341
  borderBottom: "0.12em solid currentColor",
2342
- transform: Gt[e].transform,
2342
+ transform: qt[e].transform,
2343
2343
  ...t
2344
2344
  }
2345
2345
  }
@@ -2423,7 +2423,7 @@ function Kl() {
2423
2423
  };
2424
2424
  }, []), e;
2425
2425
  }
2426
- function ql(e, t = 500) {
2426
+ function Gl(e, t = 500) {
2427
2427
  const r = T(null), a = k(() => {
2428
2428
  r.current && (clearTimeout(r.current), r.current = null);
2429
2429
  }, []);
@@ -2434,7 +2434,7 @@ function ql(e, t = 500) {
2434
2434
  [e, t, a]
2435
2435
  ), onPointerUp: a, onPointerCancel: a };
2436
2436
  }
2437
- function Gl() {
2437
+ function ql() {
2438
2438
  const e = T(null), t = k(() => {
2439
2439
  e.current && (clearTimeout(e.current), e.current = null);
2440
2440
  }, []), r = k(
@@ -2472,7 +2472,7 @@ function Ql(e, t) {
2472
2472
  }, [e, t]);
2473
2473
  }
2474
2474
  function Zl(e, t) {
2475
- qa(e, { open: t, modal: !0 });
2475
+ Ga(e, { open: t, modal: !0 });
2476
2476
  }
2477
2477
  function ed(e = {}) {
2478
2478
  const {
@@ -3721,7 +3721,7 @@ const Mn = ({
3721
3721
  size: a = "sm",
3722
3722
  className: n
3723
3723
  }) => {
3724
- const { t: o } = Z(), i = Ga(), s = i === "gamepad" || i === "remote", [c, l] = M(!1), d = T(null), [u, h] = M({ top: 0, left: 0 }), y = k(() => {
3724
+ const { t: o } = Z(), i = qa(), s = i === "gamepad" || i === "remote", [c, l] = M(!1), d = T(null), [u, h] = M({ top: 0, left: 0 }), y = k(() => {
3725
3725
  if (!d.current)
3726
3726
  return;
3727
3727
  const f = d.current.getBoundingClientRect(), b = 8;
@@ -4502,13 +4502,13 @@ const $e = (e) => !!e && /gradient\(/i.test(e), Vn = [1, 0.4, 0.28, 0.18, 0.11,
4502
4502
  "layout.topNav.background",
4503
4503
  "layout.sideNav.background",
4504
4504
  "scrollbar.thumb"
4505
- ], Kn = /^\{\s*([\w.-]+)\s*\}$/, qr = /\{\s*([\w.-]+)\s*\}/g;
4506
- function qn(e) {
4505
+ ], Kn = /^\{\s*([\w.-]+)\s*\}$/, Gr = /\{\s*([\w.-]+)\s*\}/g;
4506
+ function Gn(e) {
4507
4507
  var t;
4508
4508
  return typeof e == "string" ? ((t = e.match(Kn)) == null ? void 0 : t[1]) ?? null : null;
4509
4509
  }
4510
4510
  function Rt(e) {
4511
- return [...(typeof e == "string" ? e : e && typeof e == "object" && "css" in e ? `${e.css} ${e.base ?? ""}` : "").matchAll(qr)].map((r) => r[1]);
4511
+ return [...(typeof e == "string" ? e : e && typeof e == "object" && "css" in e ? `${e.css} ${e.base ?? ""}` : "").matchAll(Gr)].map((r) => r[1]);
4512
4512
  }
4513
4513
  function zt(e, t) {
4514
4514
  return t.split(".").reduce((r, a) => {
@@ -4527,10 +4527,10 @@ function Ht(e, t, r) {
4527
4527
  }
4528
4528
  return r;
4529
4529
  }
4530
- function qd(e, t) {
4530
+ function Gd(e, t) {
4531
4531
  return Ht(e, "", []).filter((r) => Rt(r.value).includes(t)).map((r) => r.path);
4532
4532
  }
4533
- function Gd(e, t, r) {
4533
+ function qd(e, t, r) {
4534
4534
  const a = /* @__PURE__ */ new Set(), n = [r];
4535
4535
  for (; n.length > 0; ) {
4536
4536
  const o = n.pop();
@@ -4580,7 +4580,7 @@ class Fe {
4580
4580
  }
4581
4581
  if (typeof r != "string")
4582
4582
  return null;
4583
- const n = qn(r);
4583
+ const n = Gn(r);
4584
4584
  if (n) {
4585
4585
  const i = this.resolve(n, a);
4586
4586
  return !i && !this.cyclic.has(n) && this.diag({ path: t, kind: "missing", ref: n, message: `Link to a missing value: {${n}}` }), i;
@@ -4592,7 +4592,7 @@ class Fe {
4592
4592
  return { css: r, color: r };
4593
4593
  }
4594
4594
  substitute(t, r, a) {
4595
- return r.replace(qr, (n, o) => {
4595
+ return r.replace(Gr, (n, o) => {
4596
4596
  const i = this.resolve(o, a);
4597
4597
  return i ? i.color : (this.diag({ path: t, kind: "missing", ref: o, message: `Link to a missing value: {${o}}` }), "transparent");
4598
4598
  });
@@ -4612,17 +4612,17 @@ class Fe {
4612
4612
  return r === void 0 ? null : ((a = this.resolveRaw(t, r, [t])) == null ? void 0 : a.color) ?? null;
4613
4613
  }
4614
4614
  }
4615
- function Gr(e, t, r) {
4615
+ function qr(e, t, r) {
4616
4616
  return J(e) ? rr(e, t) >= rr(e, r) ? t : r : t;
4617
4617
  }
4618
4618
  function nr(e, t, r) {
4619
4619
  return J(e) ? ve(e) > 0.5 ? Ur(e, r) : jr(e, r * 1.3) : ue(e, t, r);
4620
4620
  }
4621
- function Gn(e, t) {
4621
+ function qn(e, t) {
4622
4622
  var l, d, u;
4623
4623
  const r = Math.max(1, Math.min(10, Math.round(e.count ?? jn))), a = (l = e.curve) != null && l.length ? e.curve : t.curve, n = e.mode ?? "shade", o = t.color(e.base, `${t.path}.base`) ?? t.base, i = n === "palette" ? ((d = e.swatches) != null && d.length ? e.swatches : Object.keys(t.palette)).map((h) => t.palette[h]).filter((h) => !!h) : [], s = n === "list" || e.sync === !1, c = [];
4624
4624
  for (let h = 0; h < r; h++) {
4625
- const y = s ? (u = e.levels) == null ? void 0 : u[h] : void 0, m = `${t.path}.levels.${h}`, p = i.length > 0 ? i[h % i.length] : ue(t.over, o, a[Math.min(h, a.length - 1)]), f = t.color(y == null ? void 0 : y.background, `${m}.background`) ?? p, b = t.color(y == null ? void 0 : y.text, `${m}.text`) ?? Gr(f, t.text, t.onBase);
4625
+ const y = s ? (u = e.levels) == null ? void 0 : u[h] : void 0, m = `${t.path}.levels.${h}`, p = i.length > 0 ? i[h % i.length] : ue(t.over, o, a[Math.min(h, a.length - 1)]), f = t.color(y == null ? void 0 : y.background, `${m}.background`) ?? p, b = t.color(y == null ? void 0 : y.text, `${m}.text`) ?? qr(f, t.text, t.onBase);
4626
4626
  c.push({
4627
4627
  bg: f,
4628
4628
  text: b,
@@ -4636,7 +4636,7 @@ function Yd(e, t) {
4636
4636
  return new Fe(e).resolve(t);
4637
4637
  }
4638
4638
  function Qd(e, t) {
4639
- const r = qe(e);
4639
+ const r = Ge(e);
4640
4640
  if (t === "headers")
4641
4641
  return (r.headerLevels ?? et(e, new Fe(e))).map((o) => ({ background: o.bg, text: o.text }));
4642
4642
  const a = new Fe(e);
@@ -4662,7 +4662,7 @@ function Jn(e, t, r, a) {
4662
4662
  function et(e, t) {
4663
4663
  var a, n;
4664
4664
  const r = ((n = (a = e.layout) == null ? void 0 : a.sideNav) == null ? void 0 : n.headers) ?? {};
4665
- return Gn(r, Jn(e, t, "layout.sideNav.headers", Vn));
4665
+ return qn(r, Jn(e, t, "layout.sideNav.headers", Vn));
4666
4666
  }
4667
4667
  function Jr(e, t) {
4668
4668
  var c, l, d;
@@ -4672,7 +4672,7 @@ function Jr(e, t) {
4672
4672
  const y = s ? (f = r.levels) == null ? void 0 : f[h] : void 0, m = `layout.sideNav.highlight.levels.${h}`, p = t.inlineColor(`${m}.background`, y == null ? void 0 : y.background) ?? ue(u.bg, n, i[Math.min(h, i.length - 1)]);
4673
4673
  return {
4674
4674
  bg: p,
4675
- text: t.inlineColor(`${m}.text`, y == null ? void 0 : y.text) ?? Gr(p, u.text, o)
4675
+ text: t.inlineColor(`${m}.text`, y == null ? void 0 : y.text) ?? qr(p, u.text, o)
4676
4676
  };
4677
4677
  });
4678
4678
  }
@@ -4714,7 +4714,7 @@ const Yn = [
4714
4714
  ["layout.topNav", "topnav"],
4715
4715
  ["layout.sideNav", "sidenav"]
4716
4716
  ], ir = (e) => `${Math.round(Math.max(0, Math.min(1, e)) * 1e3) / 10}%`, sr = /* @__PURE__ */ new WeakMap();
4717
- function qe(e) {
4717
+ function Ge(e) {
4718
4718
  var y, m, p;
4719
4719
  const t = sr.get(e);
4720
4720
  if (t)
@@ -4902,7 +4902,7 @@ function Qr(e) {
4902
4902
  }
4903
4903
  function kt(e) {
4904
4904
  var n, o, i;
4905
- const t = qe(e), r = t.theme, a = {};
4905
+ const t = Ge(e), r = t.theme, a = {};
4906
4906
  for (const [s, c] of Object.entries(Yr)) {
4907
4907
  const l = Qn(r, s);
4908
4908
  if (l !== void 0) {
@@ -6454,18 +6454,18 @@ const da = ({
6454
6454
  return;
6455
6455
  o && (F.style.transition = "background-color 300ms ease, color 300ms ease");
6456
6456
  const R = kt(E);
6457
- for (const [q, G] of Object.entries(R))
6458
- F.style.setProperty(q, G);
6457
+ for (const [G, q] of Object.entries(R))
6458
+ F.style.setProperty(G, q);
6459
6459
  const z = h.current;
6460
6460
  if (z)
6461
- for (const [q, G] of Object.entries(R))
6462
- z.style.setProperty(q, G);
6461
+ for (const [G, q] of Object.entries(R))
6462
+ z.style.setProperty(G, q);
6463
6463
  F.style.colorScheme = A ? "dark" : "light", F.dataset.ntdColorScheme = A ? "dark" : "light", F.dataset.theme = A ? "dark" : "light", A ? F.classList.add("nice-dark") : F.classList.remove("nice-dark"), z && (z.style.colorScheme = A ? "dark" : "light", z.dataset.ntdColorScheme = A ? "dark" : "light", z.dataset.theme = A ? "dark" : "light", A ? z.classList.add("nice-dark") : z.classList.remove("nice-dark"));
6464
6464
  const _ = E.backgroundImage;
6465
6465
  if (_ && _.type !== "none" && _.type === "gradient" && _.gradient && F.style.setProperty("--ntd-bg-image", _.gradient), process.env.NODE_ENV !== "production") {
6466
- const { diagnostics: q } = qe(E);
6467
- q.length > 0 && !y.current.has(E.name) && (y.current.add(E.name), console.warn(
6468
- `[NiceThemeProvider] theme "${E.name}": ${q.map((G) => G.message).join("; ")}`
6466
+ const { diagnostics: G } = Ge(E);
6467
+ G.length > 0 && !y.current.has(E.name) && (y.current.add(E.name), console.warn(
6468
+ `[NiceThemeProvider] theme "${E.name}": ${G.map((q) => q.message).join("; ")}`
6469
6469
  ));
6470
6470
  }
6471
6471
  return () => {
@@ -6485,12 +6485,12 @@ const da = ({
6485
6485
  const _ = String(R[z] ?? "").trim();
6486
6486
  if (!_)
6487
6487
  return;
6488
- const q = getComputedStyle(document.documentElement).getPropertyValue(z).trim();
6489
- if (!q || q === _)
6488
+ const G = getComputedStyle(document.documentElement).getPropertyValue(z).trim();
6489
+ if (!G || G === _)
6490
6490
  return;
6491
- const G = `${d}::${E.name ?? "unnamed"}::${z}`;
6492
- I.current.has(G) || (I.current.add(G), console.warn(
6493
- `[NiceThemeProvider] CSS var "${z}" on documentElement (${q}) does not match the active provider pack "${E.name ?? "unnamed"}" (${_}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`
6491
+ const q = `${d}::${E.name ?? "unnamed"}::${z}`;
6492
+ I.current.has(q) || (I.current.add(q), console.warn(
6493
+ `[NiceThemeProvider] CSS var "${z}" on documentElement (${G}) does not match the active provider pack "${E.name ?? "unnamed"}" (${_}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`
6494
6494
  ));
6495
6495
  }, 0);
6496
6496
  return () => window.clearTimeout(F);
@@ -6518,8 +6518,8 @@ const da = ({
6518
6518
  const R = r ? { ...fe, ...r } : Ke(N);
6519
6519
  Rr(R, F, d);
6520
6520
  const z = un(N);
6521
- for (const [_, q] of Object.entries(z))
6522
- F.setAttribute(_, q);
6521
+ for (const [_, G] of Object.entries(z))
6522
+ F.setAttribute(_, G);
6523
6523
  return () => {
6524
6524
  ln(d, F);
6525
6525
  };
@@ -6529,7 +6529,7 @@ const da = ({
6529
6529
  [s, c]
6530
6530
  ), O = X(
6531
6531
  () => ({
6532
- theme: qe(E).theme,
6532
+ theme: Ge(E).theme,
6533
6533
  sourceTheme: E,
6534
6534
  setTheme: B,
6535
6535
  portalTarget: m
@@ -7108,7 +7108,7 @@ let j = {
7108
7108
  closureSizeThreshold: 1024 * 1024
7109
7109
  // 1MB
7110
7110
  };
7111
- const nt = [], Ge = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map(), mr = /* @__PURE__ */ new WeakMap();
7111
+ const nt = [], qe = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map(), mr = /* @__PURE__ */ new WeakMap();
7112
7112
  let Do = 1;
7113
7113
  function Po() {
7114
7114
  return Math.random() < (j.samplingRate ?? 1);
@@ -7180,10 +7180,10 @@ function Nu(e, t) {
7180
7180
  }
7181
7181
  function Mu(e) {
7182
7182
  const t = T(null), r = T(e), a = k(() => {
7183
- t.current && (clearTimeout(t.current), j.enabled && Ge.delete(t.current), t.current = null);
7183
+ t.current && (clearTimeout(t.current), j.enabled && qe.delete(t.current), t.current = null);
7184
7184
  }, []), n = k(
7185
7185
  (o, i) => {
7186
- a(), t.current = setTimeout(o, i), j.enabled && Ge.set(t.current, {
7186
+ a(), t.current = setTimeout(o, i), j.enabled && qe.set(t.current, {
7187
7187
  id: t.current,
7188
7188
  type: "timeout",
7189
7189
  componentName: r.current,
@@ -7207,10 +7207,10 @@ function Mu(e) {
7207
7207
  }
7208
7208
  function Au(e) {
7209
7209
  const t = T(null), r = T(e), a = k(() => {
7210
- t.current && (clearInterval(t.current), j.enabled && Ge.delete(t.current), t.current = null);
7210
+ t.current && (clearInterval(t.current), j.enabled && qe.delete(t.current), t.current = null);
7211
7211
  }, []), n = k(
7212
7212
  (o, i) => {
7213
- a(), t.current = setInterval(o, i), j.enabled && Ge.set(t.current, {
7213
+ a(), t.current = setInterval(o, i), j.enabled && qe.set(t.current, {
7214
7214
  id: t.current,
7215
7215
  type: "interval",
7216
7216
  componentName: r.current,
@@ -7957,7 +7957,7 @@ const gr = ({
7957
7957
  );
7958
7958
  };
7959
7959
  process.env.NODE_ENV !== "production" && (Ko.displayName = "NiceQuickHelp");
7960
- const qo = ({
7960
+ const Go = ({
7961
7961
  content: e,
7962
7962
  size: t = "sm",
7963
7963
  className: r,
@@ -7992,7 +7992,7 @@ const qo = ({
7992
7992
  ] })
7993
7993
  ] });
7994
7994
  };
7995
- process.env.NODE_ENV !== "production" && (qo.displayName = "NiceHelpIcon");
7995
+ process.env.NODE_ENV !== "production" && (Go.displayName = "NiceHelpIcon");
7996
7996
  const Vt = /* @__PURE__ */ ne({
7997
7997
  enabled: !0,
7998
7998
  active: !1,
@@ -8011,13 +8011,13 @@ const Vt = /* @__PURE__ */ ne({
8011
8011
  );
8012
8012
  return /* @__PURE__ */ w(Vt.Provider, { value: n, children: a });
8013
8013
  };
8014
- function Go() {
8014
+ function qo() {
8015
8015
  return Q(Vt);
8016
8016
  }
8017
- function qu() {
8017
+ function Gu() {
8018
8018
  return Q(Vt).enabled;
8019
8019
  }
8020
- function Gu(e, t) {
8020
+ function qu(e, t) {
8021
8021
  if (!e)
8022
8022
  return null;
8023
8023
  if (e === !0)
@@ -8049,7 +8049,7 @@ const Ju = ({
8049
8049
  "data-testid": i
8050
8050
  }) => {
8051
8051
  Yo();
8052
- const { enabled: s, run: c } = Go(), { t: l } = Z();
8052
+ const { enabled: s, run: c } = qo(), { t: l } = Z();
8053
8053
  if (!s || !e || e.length === 0)
8054
8054
  return null;
8055
8055
  const d = r ?? l("tutorial.startAria", "Start tutorial");
@@ -11545,7 +11545,7 @@ const Kf = {
11545
11545
  return this.importFromJSON(e, a, r);
11546
11546
  }
11547
11547
  };
11548
- function qf(e = "nice_user_prefs") {
11548
+ function Gf(e = "nice_user_prefs") {
11549
11549
  let t = null;
11550
11550
  function r() {
11551
11551
  if (t)
@@ -12025,7 +12025,7 @@ const Si = /* @__PURE__ */ $(
12025
12025
  { primary: "#161616", secondary: "#262626", tertiary: "#393939", hover: "#393939" },
12026
12026
  { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
12027
12027
  "#525252"
12028
- ), qi = /* @__PURE__ */ K(
12028
+ ), Gi = /* @__PURE__ */ K(
12029
12029
  "Cosmos",
12030
12030
  {
12031
12031
  primary: "#6366f1",
@@ -12039,7 +12039,7 @@ const Si = /* @__PURE__ */ $(
12039
12039
  // indigo-500 is a dark fill: white on it reads better than the dark default of dark themes
12040
12040
  { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563", onPrimary: "#ffffff" },
12041
12041
  "#374151"
12042
- ), Gi = /* @__PURE__ */ K(
12042
+ ), qi = /* @__PURE__ */ K(
12043
12043
  "Nebula",
12044
12044
  {
12045
12045
  primary: "#e879f9",
@@ -12731,7 +12731,7 @@ const Si = /* @__PURE__ */ $(
12731
12731
  { primary: "#faf9f6", secondary: "#f0ece3", tertiary: "#e6e0d4", hover: "#f0ece3" },
12732
12732
  { primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
12733
12733
  "#d5cec0"
12734
- ), qs = /* @__PURE__ */ $(
12734
+ ), Gs = /* @__PURE__ */ $(
12735
12735
  "Moroccan",
12736
12736
  {
12737
12737
  primary: "#c2410c",
@@ -12744,7 +12744,7 @@ const Si = /* @__PURE__ */ $(
12744
12744
  { primary: "#fffbf0", secondary: "#fef3e0", tertiary: "#fde6c4", hover: "#fef3e0" },
12745
12745
  { primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
12746
12746
  "#f5d0a0"
12747
- ), Gs = /* @__PURE__ */ $(
12747
+ ), qs = /* @__PURE__ */ $(
12748
12748
  "Scandinavian",
12749
12749
  {
12750
12750
  primary: "#4b5563",
@@ -13125,8 +13125,8 @@ const Si = /* @__PURE__ */ $(
13125
13125
  ji,
13126
13126
  Ui,
13127
13127
  Ki,
13128
- qi,
13129
13128
  Gi,
13129
+ qi,
13130
13130
  Ji,
13131
13131
  Yi,
13132
13132
  Qi,
@@ -13186,8 +13186,8 @@ const Si = /* @__PURE__ */ $(
13186
13186
  Us,
13187
13187
  // Cultural
13188
13188
  Ks,
13189
- qs,
13190
13189
  Gs,
13190
+ qs,
13191
13191
  Js,
13192
13192
  Ys,
13193
13193
  Qs,
@@ -13207,7 +13207,7 @@ const Si = /* @__PURE__ */ $(
13207
13207
  dc,
13208
13208
  uc,
13209
13209
  fc
13210
- ], Gf = [
13210
+ ], qf = [
13211
13211
  // Obsidian Editorial, Newspaper Broadsheet — serif display + body
13212
13212
  "https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap",
13213
13213
  // Terminal, Neon Arcade — monospace
@@ -15964,7 +15964,7 @@ const Qf = [
15964
15964
  },
15965
15965
  displayStyle: "zen",
15966
15966
  variantConfig: { radius: "none", shadow: "none", density: "spacious", animation: "subtle" }
15967
- }, qc = {
15967
+ }, Gc = {
15968
15968
  meta: {
15969
15969
  id: "dieterRams",
15970
15970
  name: "Dieter Rams",
@@ -16044,7 +16044,7 @@ const Qf = [
16044
16044
  },
16045
16045
  displayStyle: "swiss",
16046
16046
  variantConfig: { radius: "sm", shadow: "subtle", density: "compact", animation: "subtle" }
16047
- }, Gc = {
16047
+ }, qc = {
16048
16048
  meta: {
16049
16049
  id: "blackTieGala",
16050
16050
  name: "Black Tie Gala",
@@ -16231,8 +16231,8 @@ const Qf = [
16231
16231
  memphis80s: Uc,
16232
16232
  inkSumie: Kc,
16233
16233
  // Minimal / Luxury
16234
- dieterRams: qc,
16235
- blackTieGala: Gc,
16234
+ dieterRams: Gc,
16235
+ blackTieGala: qc,
16236
16236
  swissGrid: Jc
16237
16237
  }, za = /* @__PURE__ */ Object.values(Ra);
16238
16238
  function Zf(e) {
@@ -16762,10 +16762,10 @@ function a0(e) {
16762
16762
  o.observe(document.documentElement, i);
16763
16763
  const s = (d = (l = e == null ? void 0 : e.current) == null ? void 0 : l.closest) == null ? void 0 : d.call(l, "[data-theme], .nice-dark, .nice-light, .dark");
16764
16764
  s && s !== document.documentElement && o.observe(s, i);
16765
- const c = window.matchMedia("(prefers-color-scheme: dark)");
16766
- return (u = c.addEventListener) == null || u.call(c, "change", n), () => {
16765
+ const c = typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null;
16766
+ return (u = c == null ? void 0 : c.addEventListener) == null || u.call(c, "change", n), () => {
16767
16767
  var h;
16768
- o.disconnect(), (h = c.removeEventListener) == null || h.call(c, "change", n);
16768
+ o.disconnect(), (h = c == null ? void 0 : c.removeEventListener) == null || h.call(c, "change", n);
16769
16769
  };
16770
16770
  }, [e]), t;
16771
16771
  }
@@ -18131,7 +18131,7 @@ function R0(e = {}) {
18131
18131
  y.current = { onButtonDown: i, onButtonUp: s };
18132
18132
  const m = T({ left: 0, right: 0 }), p = k(
18133
18133
  (b, g = 0.5, v = 0.5) => {
18134
- typeof window < "u" && qt().rumble(t, b, g, v);
18134
+ typeof window < "u" && Gt().rumble(t, b, g, v);
18135
18135
  },
18136
18136
  [t]
18137
18137
  ), f = k(
@@ -18146,10 +18146,10 @@ function R0(e = {}) {
18146
18146
  return L(() => {
18147
18147
  if (!o || typeof window > "u")
18148
18148
  return;
18149
- const b = qt();
18149
+ const b = Gt();
18150
18150
  let g = -1 / 0;
18151
18151
  const v = (C, A) => {
18152
- var q, G, oe, Ne, _e, We, Me, Ut;
18152
+ var G, q, oe, Ne, _e, We, Me, Ut;
18153
18153
  if (A - g < a)
18154
18154
  return;
18155
18155
  g = A;
@@ -18166,7 +18166,7 @@ function R0(e = {}) {
18166
18166
  const D = yl[U];
18167
18167
  D && (P[D] = f(E.axes[U]));
18168
18168
  }
18169
- const B = ((q = E.buttons[6]) == null ? void 0 : q.value) ?? 0, O = ((G = E.buttons[7]) == null ? void 0 : G.value) ?? 0, { onButtonDown: W, onButtonUp: F } = y.current;
18169
+ const B = ((G = E.buttons[6]) == null ? void 0 : G.value) ?? 0, O = ((q = E.buttons[7]) == null ? void 0 : q.value) ?? 0, { onButtonDown: W, onButtonUp: F } = y.current;
18170
18170
  if (W || F)
18171
18171
  for (const U of Va)
18172
18172
  I[U] && !d.current[U] ? W == null || W(U) : !I[U] && d.current[U] && (F == null || F(U));
@@ -18350,13 +18350,13 @@ const bl = {
18350
18350
  return;
18351
18351
  let W = null, F = 1 / 0;
18352
18352
  for (const _ of B) {
18353
- const q = Mr(_.ref.current);
18354
- if (!q)
18353
+ const G = Mr(_.ref.current);
18354
+ if (!G)
18355
18355
  continue;
18356
- const G = q.x - O.x, oe = q.y - O.y, Ne = N * G + S * oe;
18356
+ const q = G.x - O.x, oe = G.y - O.y, Ne = N * q + S * oe;
18357
18357
  if (Ne <= 0)
18358
18358
  continue;
18359
- const _e = Ne, We = Math.abs(N * oe - S * G), Me = Math.sqrt(G * G + oe * oe) + We * 2 - _e * 1e-3;
18359
+ const _e = Ne, We = Math.abs(N * oe - S * q), Me = Math.sqrt(q * q + oe * oe) + We * 2 - _e * 1e-3;
18360
18360
  Me < F && (F = Me, W = _);
18361
18361
  }
18362
18362
  W && (b(W.id), (z = W.ref.current) == null || z.focus());
@@ -18498,8 +18498,8 @@ export {
18498
18498
  Ll as NICE_DISPLAY_STYLES,
18499
18499
  Hl as NICE_DISPLAY_STYLE_INFO,
18500
18500
  K0 as NICE_ENGAGE_EVENT,
18501
- q0 as NICE_GAMEPAD_BUTTONS,
18502
- G0 as NICE_INPUT_DEFAULTS,
18501
+ G0 as NICE_GAMEPAD_BUTTONS,
18502
+ q0 as NICE_INPUT_DEFAULTS,
18503
18503
  J0 as NICE_INTENTS,
18504
18504
  Y0 as NICE_INTENT_EVENT,
18505
18505
  Q0 as NICE_KEYBOARD_LAYOUTS,
@@ -18522,7 +18522,7 @@ export {
18522
18522
  pc as NICE_THEME_GALLERY,
18523
18523
  Ia as NICE_THEME_PACKS,
18524
18524
  Ra as NICE_THEME_PACKS_EXTENDED,
18525
- Gf as NICE_THEME_PACK_FONT_LINKS,
18525
+ qf as NICE_THEME_PACK_FONT_LINKS,
18526
18526
  Qf as NICE_THEME_PACK_FONT_LINKS_EXTENDED,
18527
18527
  $a as NICE_THEME_PACK_LIST,
18528
18528
  za as NICE_THEME_PACK_LIST_EXTENDED,
@@ -18539,7 +18539,7 @@ export {
18539
18539
  up as NiceFocusScope,
18540
18540
  B0 as NiceFocusable,
18541
18541
  fp as NiceGamepadPoller,
18542
- qo as NiceHelpIcon,
18542
+ Go as NiceHelpIcon,
18543
18543
  Wo as NiceHelpProvider,
18544
18544
  $m as NiceI18nLazyProvider,
18545
18545
  Fm as NiceI18nProvider,
@@ -18605,7 +18605,7 @@ export {
18605
18605
  Lc as autumnFoliage,
18606
18606
  Mc as bankVault,
18607
18607
  Nc as bauhaus,
18608
- Gc as blackTieGala,
18608
+ qc as blackTieGala,
18609
18609
  zc as blueprint,
18610
18610
  bc as brutalistRaw,
18611
18611
  wn as buildAriaDescribedBy,
@@ -18661,7 +18661,7 @@ export {
18661
18661
  cf as createStorageAdapter,
18662
18662
  Mp as createTabEscape,
18663
18663
  Uf as createURLStateManager,
18664
- qf as createUserPreferencesStore,
18664
+ Gf as createUserPreferencesStore,
18665
18665
  b0 as createWeakCache,
18666
18666
  x0 as createWeakRefCache,
18667
18667
  Lf as createWebSocketDataSource,
@@ -18671,12 +18671,12 @@ export {
18671
18671
  Ap as deleteBeforeCaret,
18672
18672
  ml as deprecateProp,
18673
18673
  T0 as deprecateSymbol,
18674
- Gn as deriveColorSet,
18674
+ qn as deriveColorSet,
18675
18675
  Sa as deriveMode,
18676
18676
  au as deserializeTheme,
18677
18677
  Ec as desertDune,
18678
18678
  Ep as detectGamepadFamily,
18679
- qc as dieterRams,
18679
+ Gc as dieterRams,
18680
18680
  Bt as endMark,
18681
18681
  Tp as engageKindOf,
18682
18682
  i0 as evaluateCondition,
@@ -18720,7 +18720,7 @@ export {
18720
18720
  tu as getComputedTheme,
18721
18721
  un as getDisplayStyleDataAttrs,
18722
18722
  af as getGracefulDegradationInfo,
18723
- qt as getInputEngine,
18723
+ Gt as getInputEngine,
18724
18724
  ku as getLeakReports,
18725
18725
  Bo as getLeakSummary,
18726
18726
  Hm as getLoadedNiceDictionary,
@@ -18799,11 +18799,11 @@ export {
18799
18799
  Ml as normalizeSize,
18800
18800
  Al as normalizeVariant,
18801
18801
  gc as obsidianEditorial,
18802
- qp as parseKeyChord,
18802
+ Gp as parseKeyChord,
18803
18803
  of as parsePolicyFromHeader,
18804
18804
  J as parseThemeColor,
18805
- qn as parseThemeRef,
18806
- Gp as pickInDirection,
18805
+ Gn as parseThemeRef,
18806
+ qp as pickInDirection,
18807
18807
  zf as pivot,
18808
18808
  il as preloadImages,
18809
18809
  ma as printPerformanceReport,
@@ -18822,10 +18822,10 @@ export {
18822
18822
  Oa as resolveStatus,
18823
18823
  Jo as resolveStepsI18n,
18824
18824
  A0 as resolveTestId,
18825
- qe as resolveTheme,
18825
+ Ge as resolveTheme,
18826
18826
  Yd as resolveThemeValue,
18827
18827
  Zu as resolveTracelessPolicy,
18828
- Gu as resolveTutorial,
18828
+ qu as resolveTutorial,
18829
18829
  tm as restoresOnCancel,
18830
18830
  Bl as sanitizeHtml,
18831
18831
  zo as saveBaseline,
@@ -18869,7 +18869,7 @@ export {
18869
18869
  Wn as themeContrastText,
18870
18870
  Ci as themeCoolGray,
18871
18871
  Wi as themeCoral,
18872
- qi as themeCosmos,
18872
+ Gi as themeCosmos,
18873
18873
  zi as themeCyan,
18874
18874
  Hs as themeCyberpunk,
18875
18875
  ts as themeDesert,
@@ -18903,8 +18903,8 @@ export {
18903
18903
  cc as themeMinimalist,
18904
18904
  rc as themeMonochrome,
18905
18905
  Ts as themeMonokai,
18906
- qs as themeMoroccan,
18907
- Gi as themeNebula,
18906
+ Gs as themeMoroccan,
18907
+ qi as themeNebula,
18908
18908
  Ds as themeNeon,
18909
18909
  sc as themeNeumorphismDark,
18910
18910
  ic as themeNeumorphismLight,
@@ -18926,11 +18926,11 @@ export {
18926
18926
  Zd as themePreviewRoles,
18927
18927
  Cs as themeRealEstate,
18928
18928
  Rt as themeRefsIn,
18929
- qd as themeRefsOf,
18929
+ Gd as themeRefsOf,
18930
18930
  Ps as themeRetrowave,
18931
18931
  Ti as themeRose,
18932
18932
  _i as themeRuby,
18933
- Gs as themeScandinavian,
18933
+ qs as themeScandinavian,
18934
18934
  Rs as themeSepia,
18935
18935
  Yi as themeShadow,
18936
18936
  Mi as themeSilver,
@@ -19007,12 +19007,12 @@ export {
19007
19007
  hm as useGridPreferences,
19008
19008
  Nd as useHaptic,
19009
19009
  bm as useHintsVisible,
19010
- Gl as useHoldRepeat,
19010
+ ql as useHoldRepeat,
19011
19011
  tl as useImageFormats,
19012
19012
  sl as useImagePreload,
19013
19013
  vm as useInputEngine,
19014
19014
  xm as useInputHints,
19015
- Ga as useInputMethod,
19015
+ qa as useInputMethod,
19016
19016
  Kl as useInputMode,
19017
19017
  Sm as useInputPreferences,
19018
19018
  wm as useInputState,
@@ -19020,7 +19020,7 @@ export {
19020
19020
  Ul as useIsTouchDevice,
19021
19021
  C0 as useLazyImage,
19022
19022
  An as useLiveAnnouncement,
19023
- ql as useLongPress,
19023
+ Gl as useLongPress,
19024
19024
  vu as useMeasureEffect,
19025
19025
  bt as useMediaQuery,
19026
19026
  Hu as useMemoryMonitor,
@@ -19044,11 +19044,11 @@ export {
19044
19044
  ou as useNiceTheme,
19045
19045
  fd as useNiceTransition,
19046
19046
  Pm as useNiceTranslation,
19047
- Go as useNiceTutorials,
19048
- qu as useNiceTutorialsEnabled,
19047
+ qo as useNiceTutorials,
19048
+ Gu as useNiceTutorialsEnabled,
19049
19049
  p0 as useOptimistic,
19050
19050
  sd as useOrientation,
19051
- qa as useOverlayFocus,
19051
+ Ga as useOverlayFocus,
19052
19052
  wd as usePan,
19053
19053
  Sd as usePinch,
19054
19054
  ol as useProgressiveImage,
@@ -19106,7 +19106,7 @@ export {
19106
19106
  $f as withOptimisticUpdates,
19107
19107
  Ff as withPolling,
19108
19108
  gu as withWhyDidYouRender,
19109
- Gd as wouldCreateCycle,
19109
+ qd as wouldCreateCycle,
19110
19110
  _c as y2kAqua,
19111
19111
  kc as zenMinimal,
19112
19112
  Xc as zinePunk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui-core",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Nice2Dev UI Core — Types, hooks, i18n, a11y, datasource, theme, animations, icons and responsive utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -38,8 +38,8 @@
38
38
  "react-dom": ">=17.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@nice2dev/i18n": "^1.4.1",
42
- "@nice2dev/testing": "^1.4.1",
41
+ "@nice2dev/i18n": "^1.4.3",
42
+ "@nice2dev/testing": "^1.4.3",
43
43
  "@types/react": "^19.2.18",
44
44
  "@types/react-dom": "^19.2.7",
45
45
  "@vitejs/plugin-react": "^4.7.0",