@namuna-nur/ui-kit 1.3.1 → 1.3.2

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.
@@ -1,6 +1,6 @@
1
1
  import { u as Hn, p as a, y as Gr, x as Yt, U as Dn, P as Ze, z as Ln, v as Gn, J as Wr, q as Nr, _ as kr, a1 as Mr, C as St, e as w, L as ae, a2 as Ee, a3 as Re, a4 as Ce, B as z, a5 as pt, a6 as ht, a7 as vt, A as Wn, k as Qe, a8 as Jt, f as Nn, R as kn, S as ct, h as Kr, H as ft, a as Yr, a9 as Mn, I as Kn, M as Jr, aa as Zr, T as _r } from "./Avatar.tokens.js";
2
2
  import * as p from "react";
3
- import $, { useRef as ve, forwardRef as qe, useState as W, useImperativeHandle as $r, useEffect as qt, Fragment as eo, useMemo as Yn } from "react";
3
+ import $, { useRef as ve, forwardRef as qe, useState as N, useImperativeHandle as $r, useEffect as qt, Fragment as eo, useMemo as Yn } from "react";
4
4
  import { a as f, f as Jn } from "./twMerge.js";
5
5
  import { Link as Zn, useSearchParams as Zt, NavLink as xt, useNavigate as to } from "react-router-dom";
6
6
  import { u as _t } from "./useOption.js";
@@ -2522,7 +2522,7 @@ const ua = ({
2522
2522
  setSelectedItems: d,
2523
2523
  classNames: l
2524
2524
  }, u) => {
2525
- const [s, c] = W(""), [h, A] = W(!1), g = ve(null);
2525
+ const [s, c] = N(""), [h, A] = N(!1), g = ve(null);
2526
2526
  $r(u, () => ({
2527
2527
  open: () => A(!0),
2528
2528
  close: () => A(!1),
@@ -2767,11 +2767,11 @@ const ua = ({
2767
2767
  classNames: A,
2768
2768
  ...g
2769
2769
  }, q) => {
2770
- const [v, x] = W(o ?? []), [m, E] = W(i ?? []), [V, C] = W(!1), [I, j] = W(!1), P = no(e, l);
2770
+ const [v, x] = N(o ?? []), [m, E] = N(i ?? []), [V, C] = N(!1), [I, j] = N(!1), P = no(e, l);
2771
2771
  qt(() => {
2772
2772
  C(!!P), u == null || u(P);
2773
2773
  }, [P, u]);
2774
- const y = de.base, T = de.hover, F = de.focus, { focusWithin: B } = de, M = de.disabled, b = de.input, R = de.button, Q = de.filterIcon, S = de.dropdown, k = de.popover, N = de.emptyPopover, K = (te, ge, Ae) => {
2774
+ const y = de.base, T = de.hover, F = de.focus, { focusWithin: B } = de, M = de.disabled, b = de.input, R = de.button, Q = de.filterIcon, S = de.dropdown, k = de.popover, W = de.emptyPopover, K = (te, ge, Ae) => {
2775
2775
  const le = (et = []) => et.map(
2776
2776
  (Ie) => Ie.id === ge.id && ge.label === ge.label ? { ...Ie, checked: Ae } : Ie
2777
2777
  ), se = te === "status" ? le(v) : v, me = te === "module" ? le(m) : m;
@@ -2928,7 +2928,7 @@ const ua = ({
2928
2928
  ))
2929
2929
  }
2930
2930
  )
2931
- ] }) : /* @__PURE__ */ a.jsx("div", { className: N.wrapper, children: /* @__PURE__ */ a.jsx(w, { className: N.text, children: "Нет результатов поиска" }) })
2931
+ ] }) : /* @__PURE__ */ a.jsx("div", { className: W.wrapper, children: /* @__PURE__ */ a.jsx(w, { className: W.text, children: "Нет результатов поиска" }) })
2932
2932
  }
2933
2933
  )
2934
2934
  ] })
@@ -3465,7 +3465,7 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3465
3465
  const d = (b) => {
3466
3466
  const R = b.getDate().toString().padStart(2, "0"), Q = (b.getMonth() + 1).toString().padStart(2, "0"), S = b.getFullYear();
3467
3467
  return `${R}/${Q}/${S}`;
3468
- }, [l, u] = W(!1), [s, c] = W(e || /* @__PURE__ */ new Date()), [h, A] = W(d(e || /* @__PURE__ */ new Date())), g = ve(null), q = ve(null), v = [
3468
+ }, [l, u] = N(!1), [s, c] = N(e || /* @__PURE__ */ new Date()), [h, A] = N(d(e || /* @__PURE__ */ new Date())), g = ve(null), q = ve(null), v = [
3469
3469
  "Январь",
3470
3470
  "Февраль",
3471
3471
  "Март",
@@ -3479,7 +3479,7 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3479
3479
  "Ноябрь",
3480
3480
  "Декабрь"
3481
3481
  ], x = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], m = (b) => {
3482
- const R = b.getFullYear(), Q = b.getMonth(), S = new Date(R, Q, 1), N = new Date(R, Q + 1, 0).getDate();
3482
+ const R = b.getFullYear(), Q = b.getMonth(), S = new Date(R, Q, 1), W = new Date(R, Q + 1, 0).getDate();
3483
3483
  let K = S.getDay();
3484
3484
  K = K === 0 ? 6 : K - 1;
3485
3485
  const oe = [];
@@ -3487,7 +3487,7 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3487
3487
  const te = new Date(R, Q, 1 - (K - Y));
3488
3488
  oe.push({ date: te, isCurrentMonth: !1 });
3489
3489
  }
3490
- for (let Y = 1; Y <= N; Y++)
3490
+ for (let Y = 1; Y <= W; Y++)
3491
3491
  oe.push({ date: new Date(R, Q, Y), isCurrentMonth: !0 });
3492
3492
  const ee = 42 - oe.length;
3493
3493
  for (let Y = 1; Y <= ee; Y++)
@@ -3500,10 +3500,10 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3500
3500
  R.length >= 3 && R.length <= 4 ? R = `${R.slice(0, 2)}/${R.slice(2)}` : R.length > 4 && (R = `${R.slice(0, 2)}/${R.slice(2, 4)}/${R.slice(4, 8)}`), R.length > 10 && (R = R.slice(0, 10)), A(R);
3501
3501
  const Q = R.split("/");
3502
3502
  if (Q.length === 3) {
3503
- const S = parseInt(Q[0]), k = parseInt(Q[1]) - 1, N = parseInt(Q[2]);
3504
- if (S > 0 && S <= 31 && k >= 0 && k <= 11 && N > 1900) {
3505
- const K = new Date(N, k, S);
3506
- K.getDate() === S && K.getMonth() === k && K.getFullYear() === N && (r(K), c(new Date(N, k, 1)));
3503
+ const S = parseInt(Q[0]), k = parseInt(Q[1]) - 1, W = parseInt(Q[2]);
3504
+ if (S > 0 && S <= 31 && k >= 0 && k <= 11 && W > 1900) {
3505
+ const K = new Date(W, k, S);
3506
+ K.getDate() === S && K.getMonth() === k && K.getFullYear() === W && (r(K), c(new Date(W, k, 1)));
3507
3507
  }
3508
3508
  }
3509
3509
  }, C = (b) => {
@@ -3684,12 +3684,12 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3684
3684
  /* @__PURE__ */ a.jsx("div", { className: X.weekHeader, children: x.map((b) => /* @__PURE__ */ a.jsx("div", { className: X.weekDay, children: b }, b)) }),
3685
3685
  /* @__PURE__ */ a.jsx("div", { className: X.calendar, children: m(s).map((b, R) => {
3686
3686
  const { date: Q, isCurrentMonth: S } = b, k = Q.getDate();
3687
- let N = X.dayButton;
3688
- return S ? P(Q) ? N += ` ${X.daySelected}` : j(Q) ? N += ` ${X.dayToday}` : y(Q) ? N += ` ${X.dayWeekend}` : N += ` ${X.dayNormal}` : N += ` ${X.dayOutside}`, /* @__PURE__ */ a.jsx(
3687
+ let W = X.dayButton;
3688
+ return S ? P(Q) ? W += ` ${X.daySelected}` : j(Q) ? W += ` ${X.dayToday}` : y(Q) ? W += ` ${X.dayWeekend}` : W += ` ${X.dayNormal}` : W += ` ${X.dayOutside}`, /* @__PURE__ */ a.jsx(
3689
3689
  "button",
3690
3690
  {
3691
3691
  onClick: () => E(Q),
3692
- className: N,
3692
+ className: W,
3693
3693
  children: k
3694
3694
  },
3695
3695
  R
@@ -3957,7 +3957,7 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3957
3957
  icon: d,
3958
3958
  iconSizes: l
3959
3959
  }) => {
3960
- const [u, s] = W(!1), h = _t(n)(i), A = Qt.base, g = Qt.disabled.trigger, q = Qt.disabled.triggerText, v = ({
3960
+ const [u, s] = N(!1), h = _t(n)(i), A = Qt.base, g = Qt.disabled.trigger, q = Qt.disabled.triggerText, v = ({
3961
3961
  className: x,
3962
3962
  text: m = ""
3963
3963
  }) => /* @__PURE__ */ a.jsx(
@@ -4415,7 +4415,7 @@ const Ba = ({
4415
4415
  onChange: t,
4416
4416
  classNames: n
4417
4417
  }) => {
4418
- const [o, i] = W(!1), d = ve(null), l = (u) => {
4418
+ const [o, i] = N(!1), d = ve(null), l = (u) => {
4419
4419
  t(u), i(!1);
4420
4420
  };
4421
4421
  return /* @__PURE__ */ a.jsx(
@@ -5017,7 +5017,7 @@ var Ke = function(e) {
5017
5017
  Q = F, S = F + k;
5018
5018
  }
5019
5019
  v.value !== b ? v.options = v.fallbackOptions : v.fallbackOptions = v.options;
5020
- var N = v.options, K = n({ inputType: M, previousValue: b, previousOptions: N, value: T, addedValue: R, changeStart: Q, changeEnd: S, selectionStart: F, selectionEnd: B }), oe = K.options, ee = Ja(K, Za);
5020
+ var W = v.options, K = n({ inputType: M, previousValue: b, previousOptions: W, value: T, addedValue: R, changeStart: Q, changeEnd: S, selectionStart: F, selectionEnd: B }), oe = K.options, ee = Ja(K, Za);
5021
5021
  i.value = ee.value, i.setSelectionRange(ee.selectionStart, ee.selectionEnd), v.value = ee.value, v.options = oe, m.selectionStart = ee.selectionStart, m.selectionEnd = ee.selectionEnd, (P = i._valueTracker) === null || P === void 0 || (y = P.setValue) === null || y === void 0 || y.call(P, b);
5022
5022
  } catch (Y) {
5023
5023
  if (i.value = m.value, i.setSelectionRange(m.selectionStart, m.selectionEnd), j.preventDefault(), j.stopPropagation(), Y.name !== "SyntheticChangeError") throw Y;
@@ -5079,20 +5079,20 @@ var Hr = function(e) {
5079
5079
  }
5080
5080
  P && (P = ke(P, { replacementChars: T, replacement: x, separate: E }));
5081
5081
  var M = yr(j + u + P, { mask: v, replacement: x, separate: E, showMask: m }), b = function(R) {
5082
- var Q, S, k, N = R.inputType, K = R.value, oe = R.addedValue, ee = R.beforeChangeValue, Y = R.mask, te = R.replacement, ge = R.separate, Ae = Tr(K, { mask: Y, replacement: te }).filter(function(Ie) {
5082
+ var Q, S, k, W = R.inputType, K = R.value, oe = R.addedValue, ee = R.beforeChangeValue, Y = R.mask, te = R.replacement, ge = R.separate, Ae = Tr(K, { mask: Y, replacement: te }).filter(function(Ie) {
5083
5083
  var Vn = Ie.type;
5084
5084
  return Vn === "input" || ge && Vn === "replacement";
5085
5085
  }), le = (Q = Ae[ee.length + oe.length - 1]) === null || Q === void 0 ? void 0 : Q.index, se = (S = Ae[ee.length - 1]) === null || S === void 0 ? void 0 : S.index, me = (k = Ae[ee.length + oe.length]) === null || k === void 0 ? void 0 : k.index;
5086
- if (N === "insert") {
5086
+ if (W === "insert") {
5087
5087
  if (le !== void 0) return le + 1;
5088
5088
  if (me !== void 0) return me;
5089
5089
  if (se !== void 0) return se + 1;
5090
5090
  }
5091
- if (N === "deleteForward") {
5091
+ if (W === "deleteForward") {
5092
5092
  if (me !== void 0) return me;
5093
5093
  if (se !== void 0) return se + 1;
5094
5094
  }
5095
- if (N === "deleteBackward") {
5095
+ if (W === "deleteBackward") {
5096
5096
  if (se !== void 0) return se + 1;
5097
5097
  if (me !== void 0) return me;
5098
5098
  }
@@ -5136,7 +5136,7 @@ const lt = {
5136
5136
  classNames: u,
5137
5137
  ...s
5138
5138
  }) => {
5139
- const c = $a(lt), [h, A] = W(
5139
+ const c = $a(lt), [h, A] = N(
5140
5140
  () => Me(String(e), lt)
5141
5141
  );
5142
5142
  qt(() => {
@@ -5196,60 +5196,61 @@ const lt = {
5196
5196
  ({
5197
5197
  title: e,
5198
5198
  data: r,
5199
- statusValue: t,
5200
- flatType: n,
5201
- statusOptions: o,
5202
- actions: i = null,
5203
- className: d,
5204
- ...l
5205
- }, u) => {
5206
- const [s, c] = W(t || ""), h = l.disabled || !1, A = De.base, g = De.pressed, q = De.hover, v = De.disabled, x = De.content;
5199
+ statusValue: t = "",
5200
+ onStatusChange: n = () => "",
5201
+ flatType: o,
5202
+ statusOptions: i,
5203
+ actions: d = null,
5204
+ className: l,
5205
+ ...u
5206
+ }, s) => {
5207
+ const c = u.disabled || !1, h = De.base, A = De.pressed, g = De.hover, q = De.disabled, v = De.content;
5207
5208
  return /* @__PURE__ */ a.jsxs(
5208
5209
  el,
5209
5210
  {
5210
- ref: u,
5211
+ ref: s,
5211
5212
  className: f(
5213
+ h,
5212
5214
  A,
5213
- g,
5214
- !h && q,
5215
- h && v,
5216
- d
5215
+ !c && g,
5216
+ c && q,
5217
+ l
5217
5218
  ),
5218
- ...l,
5219
+ ...u,
5219
5220
  children: [
5220
- /* @__PURE__ */ a.jsxs("div", { className: x.header, "data-testid": "plate", children: [
5221
+ /* @__PURE__ */ a.jsxs("div", { className: v.header, "data-testid": "plate", children: [
5221
5222
  /* @__PURE__ */ a.jsx(
5222
5223
  w,
5223
5224
  {
5224
5225
  className: f(
5225
- x.title,
5226
- h && x.disabled
5226
+ v.title,
5227
+ c && v.disabled
5227
5228
  ),
5228
5229
  children: e
5229
5230
  }
5230
5231
  ),
5231
- /* @__PURE__ */ a.jsxs("div", { className: x.actions, children: [
5232
- !!o && /* @__PURE__ */ a.jsx(
5232
+ /* @__PURE__ */ a.jsxs("div", { className: v.actions, children: [
5233
+ !!i && /* @__PURE__ */ a.jsx(
5233
5234
  Lr,
5234
5235
  {
5235
- options: o,
5236
- value: s,
5237
- onChange: c,
5238
- disabled: h
5236
+ options: i,
5237
+ value: t,
5238
+ onChange: n,
5239
+ disabled: c
5239
5240
  }
5240
5241
  ),
5241
- !!i && /* @__PURE__ */ a.jsxs(Ee, { children: [
5242
- /* @__PURE__ */ a.jsx(Re, { onClick: (m) => m.stopPropagation(), asChild: !0, children: /* @__PURE__ */ a.jsx(
5242
+ !!d && /* @__PURE__ */ a.jsxs(Ee, { children: [
5243
+ /* @__PURE__ */ a.jsx(Re, { onClick: (x) => x.stopPropagation(), asChild: !0, children: /* @__PURE__ */ a.jsx(
5243
5244
  z,
5244
5245
  {
5245
5246
  variant: "text",
5246
5247
  classNames: {
5247
- base: x.button
5248
+ base: v.button
5248
5249
  },
5249
5250
  children: /* @__PURE__ */ a.jsx(
5250
5251
  bo,
5251
5252
  {
5252
- className: x.icon,
5253
+ className: v.icon,
5253
5254
  width: 15,
5254
5255
  height: 15,
5255
5256
  viewBox: "0 0 6 24"
@@ -5257,34 +5258,34 @@ const lt = {
5257
5258
  )
5258
5259
  }
5259
5260
  ) }),
5260
- /* @__PURE__ */ a.jsx(Ce, { className: x.popup, children: i })
5261
+ /* @__PURE__ */ a.jsx(Ce, { className: v.popup, children: d })
5261
5262
  ] })
5262
5263
  ] })
5263
5264
  ] }),
5264
- /* @__PURE__ */ a.jsx("div", { className: x.flatType, children: !!n && /* @__PURE__ */ a.jsx(ct, { text: n, variant: "warning" }) }),
5265
- /* @__PURE__ */ a.jsx("div", { className: x.flexWrapper, children: r.map((m) => /* @__PURE__ */ a.jsxs(w, { className: x.typography, children: [
5266
- m.label,
5265
+ /* @__PURE__ */ a.jsx("div", { className: v.flatType, children: !!o && /* @__PURE__ */ a.jsx(ct, { text: o, variant: "warning" }) }),
5266
+ /* @__PURE__ */ a.jsx("div", { className: v.flexWrapper, children: r.map((x) => /* @__PURE__ */ a.jsxs(w, { className: v.typography, children: [
5267
+ x.label,
5267
5268
  ":",
5268
- m.href ? /* @__PURE__ */ a.jsx(
5269
+ x.href ? /* @__PURE__ */ a.jsx(
5269
5270
  Rt,
5270
5271
  {
5271
5272
  weight: "font-semibold",
5272
5273
  isIconVisible: !1,
5273
- href: m.href,
5274
- className: x.link,
5275
- children: m.value
5274
+ href: x.href,
5275
+ className: v.link,
5276
+ children: x.value
5276
5277
  }
5277
5278
  ) : /* @__PURE__ */ a.jsx(
5278
5279
  "span",
5279
5280
  {
5280
5281
  className: f(
5281
- x.amount,
5282
- h && x.disabled
5282
+ v.amount,
5283
+ c && v.disabled
5283
5284
  ),
5284
- children: m.value
5285
+ children: x.value
5285
5286
  }
5286
5287
  )
5287
- ] }, m.value)) })
5288
+ ] }, x.value)) })
5288
5289
  ]
5289
5290
  }
5290
5291
  );
@@ -5301,7 +5302,7 @@ const lt = {
5301
5302
  flatType: "flex flex-s mb-2.5",
5302
5303
  link: "inline bg-gray-40 rounded-xl pb-1.5 pt-1 px-3 text-dark-10",
5303
5304
  flexWrapper: "flex flex-col gap-1",
5304
- typography: "text-sm text-dark-10/[.40] text-start font-medium",
5305
+ typography: "text-sm text-dark-10/[.40] text-start font-medium flex gap-1",
5305
5306
  button: "p-0 flex items-center justify-center",
5306
5307
  icon: "fill-secondary-10/[.40]",
5307
5308
  popup: "flex flex-col px-3 py-2 w-auto items-start gap-2.5",
@@ -5573,7 +5574,7 @@ const lt = {
5573
5574
  label: n,
5574
5575
  classNames: o
5575
5576
  }) => {
5576
- const [i, d] = W(e || /* @__PURE__ */ new Date()), l = ve(null), u = [
5577
+ const [i, d] = N(e || /* @__PURE__ */ new Date()), l = ve(null), u = [
5577
5578
  "Январь",
5578
5579
  "Февраль",
5579
5580
  "Март",
@@ -6096,7 +6097,7 @@ const lt = {
6096
6097
  value: i
6097
6098
  }, d) => {
6098
6099
  var E;
6099
- const [l, u] = W(!1), c = _t(n)(i), h = ve(null), A = Le.base, g = Le.options, q = Le.disabled.trigger, v = Le.disabled.triggerText, x = (E = n.find((V) => V.value === i)) == null ? void 0 : E.status, m = ({
6100
+ const [l, u] = N(!1), c = _t(n)(i), h = ve(null), A = Le.base, g = Le.options, q = Le.disabled.trigger, v = Le.disabled.triggerText, x = (E = n.find((V) => V.value === i)) == null ? void 0 : E.status, m = ({
6100
6101
  className: V,
6101
6102
  text: C = ""
6102
6103
  }) => /* @__PURE__ */ a.jsx(
@@ -6591,7 +6592,7 @@ const al = {
6591
6592
  value: "text-sm text-dark-30 font-semibold"
6592
6593
  }, ll = qe(
6593
6594
  ({ classNames: e, disabled: r, onChange: t, placeholder: n = "Choose", value: o, label: i }, d) => {
6594
- const [l, u] = W(!1), [s, c] = W([]), [h, A] = W(""), [g, q] = W(""), [v, x] = W(null), E = _t(s)(o), V = Ge.base, C = Ge.options, I = Ge.disabled.trigger, j = Ge.disabled.triggerText, P = ({
6595
+ const [l, u] = N(!1), [s, c] = N([]), [h, A] = N(""), [g, q] = N(""), [v, x] = N(null), E = _t(s)(o), V = Ge.base, C = Ge.options, I = Ge.disabled.trigger, j = Ge.disabled.triggerText, P = ({
6595
6596
  className: b,
6596
6597
  text: R = ""
6597
6598
  }) => /* @__PURE__ */ a.jsx(
@@ -7004,7 +7005,7 @@ const Ge = {
7004
7005
  onSelectChat: r,
7005
7006
  classNames: t
7006
7007
  }) => {
7007
- const [n, o] = W(null), [i, d] = W(""), l = (u) => {
7008
+ const [n, o] = N(null), [i, d] = N(""), l = (u) => {
7008
7009
  o(u), r == null || r(u);
7009
7010
  };
7010
7011
  return /* @__PURE__ */ a.jsxs("div", { className: f(Sn.wrapper, t == null ? void 0 : t.wrapper), children: [
@@ -7241,7 +7242,7 @@ const Ge = {
7241
7242
  text: "Удалить"
7242
7243
  }
7243
7244
  ], _l = ({ trigger: e, onClick: r }) => {
7244
- const [t, n] = W(!1), o = (c) => {
7245
+ const [t, n] = N(!1), o = (c) => {
7245
7246
  c.preventDefault(), n(!0);
7246
7247
  }, i = (c) => {
7247
7248
  r(c), n(!1);
@@ -29,6 +29,7 @@ export type PlateProps = {
29
29
  className?: string;
30
30
  data: PlateDataTypes[];
31
31
  statusValue?: string;
32
+ onStatusChange?: (status: string) => void;
32
33
  actions?: React.ReactNode;
33
34
  flatType?: string;
34
35
  statusOptions?: StatusSelectOptionsType[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namuna-nur/ui-kit",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "UI Kit for Namuna NUR",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",