@wmoney/ui-kit 1.0.19 → 1.0.21

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
@@ -13704,21 +13704,62 @@ function iS({ className: e, orientation: t = "horizontal", ...n }) {
13704
13704
  });
13705
13705
  }
13706
13706
  //#endregion
13707
+ //#region src/components/Timer.tsx
13708
+ function aS({ remainingTime: e, onTimeUp: t }) {
13709
+ let [n, r] = p(e ?? 0), i = f(null), o = f(t), c = f(!1), l = f(e);
13710
+ s(() => {
13711
+ o.current = t;
13712
+ }, [t]), s(() => {
13713
+ if (e !== null && l.current !== e) {
13714
+ l.current = e;
13715
+ let t = setTimeout(() => {
13716
+ r(e), c.current = !1;
13717
+ }, 0);
13718
+ return () => clearTimeout(t);
13719
+ }
13720
+ }, [e]);
13721
+ let u = a((e) => {
13722
+ let t = Math.floor(e / 60), n = e % 60;
13723
+ return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
13724
+ }, []);
13725
+ return s(() => {
13726
+ if (i.current &&= (clearInterval(i.current), null), n <= 0 || e === null) {
13727
+ n === 0 && !c.current && o.current && (c.current = !0, setTimeout(() => {
13728
+ o.current?.();
13729
+ }, 0));
13730
+ return;
13731
+ }
13732
+ return i.current = setInterval(() => {
13733
+ r((e) => {
13734
+ let t = e > 0 ? e - 1 : 0;
13735
+ return t === 0 && !c.current && o.current && (c.current = !0, setTimeout(() => {
13736
+ o.current?.();
13737
+ }, 0)), t;
13738
+ });
13739
+ }, 1e3), () => {
13740
+ i.current &&= (clearInterval(i.current), null);
13741
+ };
13742
+ }, [n, e]), /* @__PURE__ */ h("span", {
13743
+ className: "animate-slide-up",
13744
+ children: u(n)
13745
+ });
13746
+ }
13747
+ //#endregion
13707
13748
  //#region node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.mjs
13708
- var aS = Symbol("radix.slottable");
13749
+ var oS = Symbol("radix.slottable");
13709
13750
  /* @__NO_SIDE_EFFECTS__ */
13710
- function oS(e) {
13751
+ function sS(e) {
13711
13752
  let t = ({ children: e }) => /* @__PURE__ */ h(m, { children: e });
13712
- return t.displayName = `${e}.Slottable`, t.__radixId = aS, t;
13753
+ return t.displayName = `${e}.Slottable`, t.__radixId = oS, t;
13713
13754
  }
13714
13755
  //#endregion
13715
13756
  //#region node_modules/@radix-ui/react-tooltip/dist/index.mjs
13716
- var [sS, cS] = Eo("Tooltip", [kp]), lS = kp(), uS = "TooltipProvider", dS = 700, fS = "tooltip.open", [pS, mS] = sS(uS), hS = (t) => {
13717
- let { __scopeTooltip: n, delayDuration: r = dS, skipDelayDuration: i = 300, disableHoverableContent: a = !1, children: o } = t, s = e.useRef(!0), c = e.useRef(!1), l = e.useRef(0);
13757
+ var [cS, lS] = Eo("Tooltip", [kp]), uS = kp(), dS = "TooltipProvider", fS = 700, pS = "tooltip.open", [mS, hS] = cS(dS), gS = (t) => {
13758
+ let { __scopeTooltip: n, delayDuration: r = fS, skipDelayDuration: i = 300, disableHoverableContent: a = !1, children: o } = t, s = e.useRef(!0), c = e.useRef(!1), l = e.useRef(0);
13718
13759
  return e.useEffect(() => {
13719
13760
  let e = l.current;
13720
13761
  return () => window.clearTimeout(e);
13721
- }, []), /* @__PURE__ */ h(pS, {
13762
+ }, []), /* @__PURE__ */ h(mS, {
13722
13763
  scope: n,
13723
13764
  isOpenDelayedRef: s,
13724
13765
  delayDuration: r,
@@ -13736,15 +13777,15 @@ var [sS, cS] = Eo("Tooltip", [kp]), lS = kp(), uS = "TooltipProvider", dS = 700,
13736
13777
  children: o
13737
13778
  });
13738
13779
  };
13739
- hS.displayName = uS;
13740
- var gS = "Tooltip", [_S, vS] = sS(gS), yS = (t) => {
13741
- let { __scopeTooltip: n, children: r, open: i, defaultOpen: a, onOpenChange: o, disableHoverableContent: s, delayDuration: c } = t, l = mS(gS, t.__scopeTooltip), u = lS(n), [d, f] = e.useState(null), p = Ds(), m = e.useRef(0), g = s ?? l.disableHoverableContent, _ = c ?? l.delayDuration, v = e.useRef(!1), [y, b] = Ao({
13780
+ gS.displayName = dS;
13781
+ var _S = "Tooltip", [vS, yS] = cS(_S), bS = (t) => {
13782
+ let { __scopeTooltip: n, children: r, open: i, defaultOpen: a, onOpenChange: o, disableHoverableContent: s, delayDuration: c } = t, l = hS(_S, t.__scopeTooltip), u = uS(n), [d, f] = e.useState(null), p = Ds(), m = e.useRef(0), g = s ?? l.disableHoverableContent, _ = c ?? l.delayDuration, v = e.useRef(!1), [y, b] = Ao({
13742
13783
  prop: i,
13743
13784
  defaultProp: a ?? !1,
13744
13785
  onChange: (e) => {
13745
- e ? (l.onOpen(), document.dispatchEvent(new CustomEvent(fS))) : l.onClose(), o?.(e);
13786
+ e ? (l.onOpen(), document.dispatchEvent(new CustomEvent(pS))) : l.onClose(), o?.(e);
13746
13787
  },
13747
- caller: gS
13788
+ caller: _S
13748
13789
  }), x = e.useMemo(() => y ? v.current ? "delayed-open" : "instant-open" : "closed", [y]), S = e.useCallback(() => {
13749
13790
  window.clearTimeout(m.current), m.current = 0, v.current = !1, b(!0);
13750
13791
  }, [b]), C = e.useCallback(() => {
@@ -13758,7 +13799,7 @@ var gS = "Tooltip", [_S, vS] = sS(gS), yS = (t) => {
13758
13799
  m.current &&= (window.clearTimeout(m.current), 0);
13759
13800
  }, []), /* @__PURE__ */ h(Gp, {
13760
13801
  ...u,
13761
- children: /* @__PURE__ */ h(_S, {
13802
+ children: /* @__PURE__ */ h(vS, {
13762
13803
  scope: n,
13763
13804
  contentId: p,
13764
13805
  open: y,
@@ -13782,9 +13823,9 @@ var gS = "Tooltip", [_S, vS] = sS(gS), yS = (t) => {
13782
13823
  })
13783
13824
  });
13784
13825
  };
13785
- yS.displayName = gS;
13786
- var bS = "TooltipTrigger", xS = e.forwardRef((t, n) => {
13787
- let { __scopeTooltip: r, ...i } = t, a = vS(bS, r), o = mS(bS, r), s = lS(r), c = O(n, e.useRef(null), a.onTriggerChange), l = e.useRef(!1), u = e.useRef(!1), d = e.useCallback(() => l.current = !1, []);
13826
+ bS.displayName = _S;
13827
+ var xS = "TooltipTrigger", SS = e.forwardRef((t, n) => {
13828
+ let { __scopeTooltip: r, ...i } = t, a = yS(xS, r), o = hS(xS, r), s = uS(r), c = O(n, e.useRef(null), a.onTriggerChange), l = e.useRef(!1), u = e.useRef(!1), d = e.useCallback(() => l.current = !1, []);
13788
13829
  return e.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ h(Kp, {
13789
13830
  asChild: !0,
13790
13831
  ...s,
@@ -13810,10 +13851,10 @@ var bS = "TooltipTrigger", xS = e.forwardRef((t, n) => {
13810
13851
  })
13811
13852
  });
13812
13853
  });
13813
- xS.displayName = bS;
13814
- var SS = "TooltipPortal", [CS, wS] = sS(SS, { forceMount: void 0 }), TS = (e) => {
13815
- let { __scopeTooltip: t, forceMount: n, children: r, container: i } = e, a = vS(SS, t);
13816
- return /* @__PURE__ */ h(CS, {
13854
+ SS.displayName = xS;
13855
+ var CS = "TooltipPortal", [wS, TS] = cS(CS, { forceMount: void 0 }), ES = (e) => {
13856
+ let { __scopeTooltip: t, forceMount: n, children: r, container: i } = e, a = yS(CS, t);
13857
+ return /* @__PURE__ */ h(wS, {
13817
13858
  scope: t,
13818
13859
  forceMount: n,
13819
13860
  children: /* @__PURE__ */ h(Io, {
@@ -13826,30 +13867,30 @@ var SS = "TooltipPortal", [CS, wS] = sS(SS, { forceMount: void 0 }), TS = (e) =>
13826
13867
  })
13827
13868
  });
13828
13869
  };
13829
- TS.displayName = SS;
13830
- var ES = "TooltipContent", DS = e.forwardRef((e, t) => {
13831
- let n = wS(ES, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...a } = e, o = vS(ES, e.__scopeTooltip);
13870
+ ES.displayName = CS;
13871
+ var DS = "TooltipContent", OS = e.forwardRef((e, t) => {
13872
+ let n = TS(DS, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...a } = e, o = yS(DS, e.__scopeTooltip);
13832
13873
  return /* @__PURE__ */ h(Io, {
13833
13874
  present: r || o.open,
13834
- children: o.disableHoverableContent ? /* @__PURE__ */ h(MS, {
13875
+ children: o.disableHoverableContent ? /* @__PURE__ */ h(NS, {
13835
13876
  side: i,
13836
13877
  ...a,
13837
13878
  ref: t
13838
- }) : /* @__PURE__ */ h(OS, {
13879
+ }) : /* @__PURE__ */ h(kS, {
13839
13880
  side: i,
13840
13881
  ...a,
13841
13882
  ref: t
13842
13883
  })
13843
13884
  });
13844
- }), OS = e.forwardRef((t, n) => {
13845
- let r = vS(ES, t.__scopeTooltip), i = mS(ES, t.__scopeTooltip), a = e.useRef(null), o = O(n, a), [s, c] = e.useState(null), { trigger: l, onClose: u } = r, d = a.current, { onPointerInTransitChange: f } = i, p = e.useCallback(() => {
13885
+ }), kS = e.forwardRef((t, n) => {
13886
+ let r = yS(DS, t.__scopeTooltip), i = hS(DS, t.__scopeTooltip), a = e.useRef(null), o = O(n, a), [s, c] = e.useState(null), { trigger: l, onClose: u } = r, d = a.current, { onPointerInTransitChange: f } = i, p = e.useCallback(() => {
13846
13887
  c(null), f(!1);
13847
13888
  }, [f]), m = e.useCallback((e, t) => {
13848
13889
  let n = e.currentTarget, r = {
13849
13890
  x: e.clientX,
13850
13891
  y: e.clientY
13851
- }, i = IS(r, FS(r, n.getBoundingClientRect())), a = LS(t.getBoundingClientRect());
13852
- c(zS([...i, ...a])), f(!0);
13892
+ }, i = LS(r, IS(r, n.getBoundingClientRect())), a = RS(t.getBoundingClientRect());
13893
+ c(BS([...i, ...a])), f(!0);
13853
13894
  }, [f]);
13854
13895
  return e.useEffect(() => () => p(), [p]), e.useEffect(() => {
13855
13896
  if (l && d) {
@@ -13869,7 +13910,7 @@ var ES = "TooltipContent", DS = e.forwardRef((e, t) => {
13869
13910
  let t = e.target, n = {
13870
13911
  x: e.clientX,
13871
13912
  y: e.clientY
13872
- }, r = l?.contains(t) || d?.contains(t), i = !RS(n, s);
13913
+ }, r = l?.contains(t) || d?.contains(t), i = !zS(n, s);
13873
13914
  r ? p() : i && (p(), u());
13874
13915
  };
13875
13916
  return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
@@ -13880,13 +13921,13 @@ var ES = "TooltipContent", DS = e.forwardRef((e, t) => {
13880
13921
  s,
13881
13922
  u,
13882
13923
  p
13883
- ]), /* @__PURE__ */ h(MS, {
13924
+ ]), /* @__PURE__ */ h(NS, {
13884
13925
  ...t,
13885
13926
  ref: o
13886
13927
  });
13887
- }), [kS, AS] = sS(gS, { isInside: !1 }), jS = /* @__PURE__ */ oS("TooltipContent"), MS = e.forwardRef((t, n) => {
13888
- let { __scopeTooltip: r, children: i, "aria-label": a, onEscapeKeyDown: o, onPointerDownOutside: s, ...c } = t, l = vS(ES, r), u = lS(r), { onClose: d } = l;
13889
- return e.useEffect(() => (document.addEventListener(fS, d), () => document.removeEventListener(fS, d)), [d]), e.useEffect(() => {
13928
+ }), [AS, jS] = cS(_S, { isInside: !1 }), MS = /* @__PURE__ */ sS("TooltipContent"), NS = e.forwardRef((t, n) => {
13929
+ let { __scopeTooltip: r, children: i, "aria-label": a, onEscapeKeyDown: o, onPointerDownOutside: s, ...c } = t, l = yS(DS, r), u = uS(r), { onClose: d } = l;
13930
+ return e.useEffect(() => (document.addEventListener(pS, d), () => document.removeEventListener(pS, d)), [d]), e.useEffect(() => {
13890
13931
  if (l.trigger) {
13891
13932
  let e = (e) => {
13892
13933
  e.target?.contains(l.trigger) && d();
@@ -13913,7 +13954,7 @@ var ES = "TooltipContent", DS = e.forwardRef((e, t) => {
13913
13954
  "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
13914
13955
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
13915
13956
  },
13916
- children: [/* @__PURE__ */ h(jS, { children: i }), /* @__PURE__ */ h(kS, {
13957
+ children: [/* @__PURE__ */ h(MS, { children: i }), /* @__PURE__ */ h(AS, {
13917
13958
  scope: r,
13918
13959
  isInside: !0,
13919
13960
  children: /* @__PURE__ */ h(Fv, {
@@ -13925,17 +13966,17 @@ var ES = "TooltipContent", DS = e.forwardRef((e, t) => {
13925
13966
  })
13926
13967
  });
13927
13968
  });
13928
- DS.displayName = ES;
13929
- var NS = "TooltipArrow", PS = e.forwardRef((e, t) => {
13930
- let { __scopeTooltip: n, ...r } = e, i = lS(n);
13931
- return AS(NS, n).isInside ? null : /* @__PURE__ */ h(Jp, {
13969
+ OS.displayName = DS;
13970
+ var PS = "TooltipArrow", FS = e.forwardRef((e, t) => {
13971
+ let { __scopeTooltip: n, ...r } = e, i = uS(n);
13972
+ return jS(PS, n).isInside ? null : /* @__PURE__ */ h(Jp, {
13932
13973
  ...i,
13933
13974
  ...r,
13934
13975
  ref: t
13935
13976
  });
13936
13977
  });
13937
- PS.displayName = NS;
13938
- function FS(e, t) {
13978
+ FS.displayName = PS;
13979
+ function IS(e, t) {
13939
13980
  let n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), i = Math.abs(t.right - e.x), a = Math.abs(t.left - e.x);
13940
13981
  switch (Math.min(n, r, i, a)) {
13941
13982
  case a: return "left";
@@ -13945,7 +13986,7 @@ function FS(e, t) {
13945
13986
  default: throw Error("unreachable");
13946
13987
  }
13947
13988
  }
13948
- function IS(e, t, n = 5) {
13989
+ function LS(e, t, n = 5) {
13949
13990
  let r = [];
13950
13991
  switch (t) {
13951
13992
  case "top":
@@ -13987,7 +14028,7 @@ function IS(e, t, n = 5) {
13987
14028
  }
13988
14029
  return r;
13989
14030
  }
13990
- function LS(e) {
14031
+ function RS(e) {
13991
14032
  let { top: t, right: n, bottom: r, left: i } = e;
13992
14033
  return [
13993
14034
  {
@@ -14008,7 +14049,7 @@ function LS(e) {
14008
14049
  }
14009
14050
  ];
14010
14051
  }
14011
- function RS(e, t) {
14052
+ function zS(e, t) {
14012
14053
  let { x: n, y: r } = e, i = !1;
14013
14054
  for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
14014
14055
  let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y;
@@ -14016,11 +14057,11 @@ function RS(e, t) {
14016
14057
  }
14017
14058
  return i;
14018
14059
  }
14019
- function zS(e) {
14060
+ function BS(e) {
14020
14061
  let t = e.slice();
14021
- return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : e.y > t.y ? 1 : 0), BS(t);
14062
+ return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : e.y > t.y ? 1 : 0), VS(t);
14022
14063
  }
14023
- function BS(e) {
14064
+ function VS(e) {
14024
14065
  if (e.length <= 1) return e.slice();
14025
14066
  let t = [];
14026
14067
  for (let n = 0; n < e.length; n++) {
@@ -14045,25 +14086,25 @@ function BS(e) {
14045
14086
  }
14046
14087
  return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
14047
14088
  }
14048
- var VS = hS, HS = yS;
14089
+ var HS = gS, US = bS;
14049
14090
  //#endregion
14050
14091
  //#region src/components/Tooltip.tsx
14051
- function US({ delayDuration: e = 0, ...t }) {
14052
- return /* @__PURE__ */ h(VS, {
14092
+ function WS({ delayDuration: e = 0, ...t }) {
14093
+ return /* @__PURE__ */ h(HS, {
14053
14094
  "data-slot": "tooltip-provider",
14054
14095
  delayDuration: e,
14055
14096
  ...t
14056
14097
  });
14057
14098
  }
14058
- function WS({ ...e }) {
14059
- return /* @__PURE__ */ h(US, { children: /* @__PURE__ */ h(HS, {
14099
+ function GS({ ...e }) {
14100
+ return /* @__PURE__ */ h(WS, { children: /* @__PURE__ */ h(US, {
14060
14101
  "data-slot": "tooltip",
14061
14102
  ...e
14062
14103
  }) });
14063
14104
  }
14064
14105
  //#endregion
14065
14106
  //#region src/components/ValidatePassword.tsx
14066
- function GS({ password: e }) {
14107
+ function KS({ password: e }) {
14067
14108
  function t(e) {
14068
14109
  return e.length >= 8;
14069
14110
  }
@@ -14113,7 +14154,7 @@ function GS({ password: e }) {
14113
14154
  }
14114
14155
  //#endregion
14115
14156
  //#region src/lib/ThemeTokensProvider.tsx
14116
- var KS = n(void 0), qS = () => o(KS), JS = ({ children: e, tokens: n }) => (t.useEffect(() => {
14157
+ var qS = n(void 0), JS = () => o(qS), YS = ({ children: e, tokens: n }) => (t.useEffect(() => {
14117
14158
  if (!n) return;
14118
14159
  let e = "wmoney-theme-tokens", t = document.getElementById(e);
14119
14160
  t || (t = document.createElement("style"), t.id = e, document.head.appendChild(t));
@@ -14124,11 +14165,11 @@ var KS = n(void 0), qS = () => o(KS), JS = ({ children: e, tokens: n }) => (t.us
14124
14165
  return t.textContent = i, () => {
14125
14166
  t?.remove();
14126
14167
  };
14127
- }, [n]), /* @__PURE__ */ h(KS.Provider, {
14168
+ }, [n]), /* @__PURE__ */ h(qS.Provider, {
14128
14169
  value: n,
14129
14170
  children: e
14130
14171
  }));
14131
14172
  //#endregion
14132
- export { yt as Badge, tn as Button, _o as Calendar, yo as Card, ls as Checkbox, $u as Command, Pm as DatePicker, Qu as Dialog, P_ as DropdownMenu, F_ as FileDropzone, W_ as FormSection, G_ as Input, q_ as InputGroup, hv as InputOtp, ud as Label, _v as MultiSelect, vv as Pagination, _b as Paginator, vb as PasswordToggle, jm as Popover, Wb as RadioGroup, Gb as RoundedButton, cb as Select, U_ as Separator, Kb as Skeleton, Zt as Spinner, Bx as Switch, Vx as Table, iS as Tabs, K_ as Textarea, JS as ThemeTokensProvider, Ex as Toaster, WS as Tooltip, US as TooltipProvider, GS as ValidatePassword, Qt as buttonVariants, J as cn, qS as useThemeTokens };
14173
+ export { yt as Badge, tn as Button, _o as Calendar, yo as Card, ls as Checkbox, $u as Command, Pm as DatePicker, Qu as Dialog, P_ as DropdownMenu, F_ as FileDropzone, W_ as FormSection, G_ as Input, q_ as InputGroup, hv as InputOtp, ud as Label, _v as MultiSelect, vv as Pagination, _b as Paginator, vb as PasswordToggle, jm as Popover, Wb as RadioGroup, Gb as RoundedButton, cb as Select, U_ as Separator, Kb as Skeleton, Zt as Spinner, Bx as Switch, Vx as Table, iS as Tabs, K_ as Textarea, YS as ThemeTokensProvider, aS as Timer, Ex as Toaster, GS as Tooltip, WS as TooltipProvider, KS as ValidatePassword, Qt as buttonVariants, J as cn, JS as useThemeTokens };
14133
14174
 
14134
14175
  //# sourceMappingURL=index.js.map