mimir-ui-kit 1.42.2 → 1.43.1

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.
Files changed (87) hide show
  1. package/dist/ProgressBar-COdzy3fY.js +67 -0
  2. package/dist/assets/MultiSelectSearch.css +1 -1
  3. package/dist/assets/Pagination.css +1 -1
  4. package/dist/assets/SelectSearch.css +1 -1
  5. package/dist/assets/Switcher.css +1 -1
  6. package/dist/assets/TabTrail.css +1 -1
  7. package/dist/assets/hooks.css +1 -0
  8. package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
  9. package/dist/components/Accordion/Accordion.d.ts +6 -0
  10. package/dist/components/Accordion/Accordion.js +202 -182
  11. package/dist/components/AnchorLink/Link.d.ts +2 -0
  12. package/dist/components/AnchorLink/Link.js +54 -42
  13. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  14. package/dist/components/DatePicker/DatePicker.d.ts +32 -0
  15. package/dist/components/DatePicker/DatePicker.js +125 -111
  16. package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
  17. package/dist/components/DatePicker/DatePickerModal.js +97 -75
  18. package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
  19. package/dist/components/DatePicker/MonthPickerModal.js +96 -58
  20. package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
  21. package/dist/components/DatePicker/YearPickerModal.js +75 -57
  22. package/dist/components/Drawer/Drawer.d.ts +7 -1
  23. package/dist/components/Drawer/Drawer.js +122 -106
  24. package/dist/components/Drawer/hooks.d.ts +9 -0
  25. package/dist/components/Drawer/hooks.js +24 -0
  26. package/dist/components/Dropdown/Dropdown.d.ts +18 -1
  27. package/dist/components/Dropdown/Dropdown.js +361 -343
  28. package/dist/components/Dropdown/constants.d.ts +11 -0
  29. package/dist/components/Dropdown/constants.js +5 -0
  30. package/dist/components/Dropdown/hooks.d.ts +19 -0
  31. package/dist/components/Dropdown/hooks.js +11 -0
  32. package/dist/components/Dropdown/index.d.ts +1 -0
  33. package/dist/components/Dropdown/index.js +5 -2
  34. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
  35. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
  36. package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
  37. package/dist/components/MultiSelectSearch/constants.js +7 -5
  38. package/dist/components/MultiSelectSearch/index.d.ts +1 -1
  39. package/dist/components/MultiSelectSearch/index.js +5 -4
  40. package/dist/components/MultiSelectSearch/types.d.ts +33 -1
  41. package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
  42. package/dist/components/MultiSelectSearch/utils.js +31 -17
  43. package/dist/components/Pagination/Pagination.d.ts +23 -0
  44. package/dist/components/Pagination/Pagination.js +137 -99
  45. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  46. package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
  47. package/dist/components/SelectSearch/SelectSearch.js +381 -220
  48. package/dist/components/SelectSearch/constants.d.ts +6 -0
  49. package/dist/components/SelectSearch/constants.js +3 -2
  50. package/dist/components/SelectSearch/index.d.ts +1 -1
  51. package/dist/components/SelectSearch/index.js +5 -4
  52. package/dist/components/SelectSearch/types.d.ts +32 -1
  53. package/dist/components/SelectSearch/utils.d.ts +2 -0
  54. package/dist/components/SelectSearch/utils.js +28 -14
  55. package/dist/components/Slider/Slider.d.ts +6 -2
  56. package/dist/components/Slider/Slider.js +123 -109
  57. package/dist/components/Slider/utils.d.ts +1 -0
  58. package/dist/components/Slider/utils.js +4 -0
  59. package/dist/components/Switcher/Switcher.js +66 -59
  60. package/dist/components/Switcher/types.d.ts +1 -0
  61. package/dist/components/TabTrail/TabTrail.d.ts +9 -0
  62. package/dist/components/TabTrail/TabTrail.js +198 -190
  63. package/dist/components/Toasts/ProgressBar.d.ts +4 -2
  64. package/dist/components/Toasts/ProgressBar.js +1 -1
  65. package/dist/components/Toasts/Toast.d.ts +5 -1
  66. package/dist/components/Toasts/Toast.js +59 -44
  67. package/dist/components/Toasts/ToastList.js +1 -1
  68. package/dist/components/Toasts/ToastsProvider.js +1 -1
  69. package/dist/components/index.d.ts +3 -2
  70. package/dist/components/index.js +154 -149
  71. package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
  72. package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
  73. package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
  74. package/dist/hooks/useTimer/index.d.ts +2 -1
  75. package/dist/hooks/useTimer/index.js +55 -41
  76. package/dist/hooks-HgN6Yauq.js +117 -0
  77. package/dist/index.js +182 -177
  78. package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
  79. package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
  80. package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
  81. package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
  82. package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
  83. package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
  84. package/package.json +3 -1
  85. package/dist/ProgressBar-DEFs1tWq.js +0 -55
  86. package/dist/assets/Dropdown.css +0 -1
  87. package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,23 +1,24 @@
1
- import { jsxs as X, jsx as D } from "react/jsx-runtime";
2
- import { c as H } from "../../index-DIxK0V-G.js";
3
- import * as C from "react";
4
- import M, { useState as K, createContext as ie, useReducer as ke, useMemo as R, useId as ue, useRef as Y, useContext as ce, forwardRef as ye, useEffect as Z } from "react";
5
- import { ETabTrailSize as Se } from "./constants.js";
6
- import { TabButtons as Ae } from "./TabButtons/TabButtons.js";
1
+ import { jsxs as Z, jsx as k } from "react/jsx-runtime";
2
+ import { c as j } from "../../index-DIxK0V-G.js";
3
+ import * as M from "react";
4
+ import O, { useState as Y, createContext as ie, useReducer as ye, useMemo as R, useId as ue, useRef as Q, useContext as ce, forwardRef as Se, useEffect as ee } from "react";
5
+ import { ETabTrailSize as Ae } from "./constants.js";
6
+ import { TabButtons as ke } from "./TabButtons/TabButtons.js";
7
7
  import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
8
+ import { Icon as Ne } from "../../icons/Icon.js";
8
9
  import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
9
- import { M as oe, W as z, s as j, y as U, o as N, n as Q, H as V, $ as de, b as Ne, D as fe, a as G, u as Re, c as I, t as Le } from "../../keyboard-CUMsrFX1.js";
10
- import { w as Oe } from "../../use-active-press-BVQqDQ3V.js";
11
- import { e as Me } from "../../use-resolve-button-type-DhFdPxnv.js";
12
- import { f as Ce } from "../../use-is-mounted-D7cq4xsa.js";
13
- import { T as pe, s as Be } from "../../hidden-Dn4lM6EL.js";
14
- import { _ as W, T as J, P as O, F as P } from "../../focus-management-Dp2_vbQ3.js";
15
- import '../../assets/TabTrail.css';function We({ onFocus: e }) {
16
- let [t, n] = K(!0), r = Ce();
17
- return t ? M.createElement(pe, { as: "button", type: "button", features: Be.Focusable, onFocus: (s) => {
10
+ import { M as oe, W as U, s as J, y as V, o as D, n as X, H as q, $ as de, b as Re, D as fe, a as z, u as Le, c as $, e as Oe } from "../../keyboard-wis2TUql.js";
11
+ import { w as Me } from "../../use-active-press-CnDeVvQq.js";
12
+ import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
13
+ import { f as Be } from "../../use-is-mounted-MBU4fiLr.js";
14
+ import { T as pe, s as We } from "../../hidden-CkTYbiNM.js";
15
+ import { _ as G, T as K, P as L, F as _ } from "../../focus-management-BAl0GmRk.js";
16
+ import '../../assets/TabTrail.css';function Ge({ onFocus: e }) {
17
+ let [t, n] = Y(!0), r = Be();
18
+ return t ? O.createElement(pe, { as: "button", type: "button", features: We.Focusable, onFocus: (s) => {
18
19
  s.preventDefault();
19
20
  let l, o = 50;
20
- function b() {
21
+ function d() {
21
22
  if (o-- <= 0) {
22
23
  l && cancelAnimationFrame(l);
23
24
  return;
@@ -27,13 +28,13 @@ import '../../assets/TabTrail.css';function We({ onFocus: e }) {
27
28
  n(!1);
28
29
  return;
29
30
  }
30
- l = requestAnimationFrame(b);
31
+ l = requestAnimationFrame(d);
31
32
  }
32
- l = requestAnimationFrame(b);
33
+ l = requestAnimationFrame(d);
33
34
  } }) : null;
34
35
  }
35
- const be = C.createContext(null);
36
- function Ge() {
36
+ const be = M.createContext(null);
37
+ function ze() {
37
38
  return { groups: /* @__PURE__ */ new Map(), get(e, t) {
38
39
  var n;
39
40
  let r = this.groups.get(e);
@@ -42,259 +43,266 @@ function Ge() {
42
43
  r.set(t, s + 1);
43
44
  let l = Array.from(r.keys()).indexOf(t);
44
45
  function o() {
45
- let b = r.get(t);
46
- b > 1 ? r.set(t, b - 1) : r.delete(t);
46
+ let d = r.get(t);
47
+ d > 1 ? r.set(t, d - 1) : r.delete(t);
47
48
  }
48
49
  return [l, o];
49
50
  } };
50
51
  }
51
- function ze({ children: e }) {
52
- let t = C.useRef(Ge());
53
- return C.createElement(be.Provider, { value: t }, e);
52
+ function Ue({ children: e }) {
53
+ let t = M.useRef(ze());
54
+ return M.createElement(be.Provider, { value: t }, e);
54
55
  }
55
56
  function me(e) {
56
- let t = C.useContext(be);
57
+ let t = M.useContext(be);
57
58
  if (!t) throw new Error("You must wrap your component in a <StableCollection>");
58
- let n = C.useId(), [r, s] = t.current.get(e, n);
59
- return C.useEffect(() => s, []), r;
59
+ let n = M.useId(), [r, s] = t.current.get(e, n);
60
+ return M.useEffect(() => s, []), r;
60
61
  }
61
- var Ue = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ue || {}), Ve = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(Ve || {}), qe = ((e) => (e[e.SetSelectedIndex = 0] = "SetSelectedIndex", e[e.RegisterTab = 1] = "RegisterTab", e[e.UnregisterTab = 2] = "UnregisterTab", e[e.RegisterPanel = 3] = "RegisterPanel", e[e.UnregisterPanel = 4] = "UnregisterPanel", e))(qe || {});
62
- let He = { 0(e, t) {
62
+ var Ve = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ve || {}), qe = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(qe || {}), He = ((e) => (e[e.SetSelectedIndex = 0] = "SetSelectedIndex", e[e.RegisterTab = 1] = "RegisterTab", e[e.UnregisterTab = 2] = "UnregisterTab", e[e.RegisterPanel = 3] = "RegisterPanel", e[e.UnregisterPanel = 4] = "UnregisterPanel", e))(He || {});
63
+ let je = { 0(e, t) {
63
64
  var n;
64
- let r = W(e.tabs, (d) => d.current), s = W(e.panels, (d) => d.current), l = r.filter((d) => {
65
- var x;
66
- return !((x = d.current) != null && x.hasAttribute("disabled"));
65
+ let r = G(e.tabs, (u) => u.current), s = G(e.panels, (u) => u.current), l = r.filter((u) => {
66
+ var h;
67
+ return !((h = u.current) != null && h.hasAttribute("disabled"));
67
68
  }), o = { ...e, tabs: r, panels: s };
68
69
  if (t.index < 0 || t.index > r.length - 1) {
69
- let d = G(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => G(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
70
+ let u = z(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => z(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
70
71
  if (l.length === 0) return o;
71
- let x = G(d, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
72
- return { ...o, selectedIndex: x === -1 ? e.selectedIndex : x };
72
+ let h = z(u, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
73
+ return { ...o, selectedIndex: h === -1 ? e.selectedIndex : h };
73
74
  }
74
- let b = r.slice(0, t.index), T = [...r.slice(t.index), ...b].find((d) => l.includes(d));
75
- if (!T) return o;
76
- let v = (n = r.indexOf(T)) != null ? n : e.selectedIndex;
75
+ let d = r.slice(0, t.index), I = [...r.slice(t.index), ...d].find((u) => l.includes(u));
76
+ if (!I) return o;
77
+ let v = (n = r.indexOf(I)) != null ? n : e.selectedIndex;
77
78
  return v === -1 && (v = e.selectedIndex), { ...o, selectedIndex: v };
78
79
  }, 1(e, t) {
79
80
  if (e.tabs.includes(t.tab)) return e;
80
- let n = e.tabs[e.selectedIndex], r = W([...e.tabs, t.tab], (l) => l.current), s = e.selectedIndex;
81
+ let n = e.tabs[e.selectedIndex], r = G([...e.tabs, t.tab], (l) => l.current), s = e.selectedIndex;
81
82
  return e.info.current.isControlled || (s = r.indexOf(n), s === -1 && (s = e.selectedIndex)), { ...e, tabs: r, selectedIndex: s };
82
83
  }, 2(e, t) {
83
84
  return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
84
85
  }, 3(e, t) {
85
- return e.panels.includes(t.panel) ? e : { ...e, panels: W([...e.panels, t.panel], (n) => n.current) };
86
+ return e.panels.includes(t.panel) ? e : { ...e, panels: G([...e.panels, t.panel], (n) => n.current) };
86
87
  }, 4(e, t) {
87
88
  return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
88
- } }, ee = ie(null);
89
- ee.displayName = "TabsDataContext";
90
- function B(e) {
91
- let t = ce(ee);
89
+ } }, te = ie(null);
90
+ te.displayName = "TabsDataContext";
91
+ function C(e) {
92
+ let t = ce(te);
92
93
  if (t === null) {
93
94
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
94
- throw Error.captureStackTrace && Error.captureStackTrace(n, B), n;
95
+ throw Error.captureStackTrace && Error.captureStackTrace(n, C), n;
95
96
  }
96
97
  return t;
97
98
  }
98
- let te = ie(null);
99
- te.displayName = "TabsActionsContext";
100
- function re(e) {
101
- let t = ce(te);
99
+ let re = ie(null);
100
+ re.displayName = "TabsActionsContext";
101
+ function ne(e) {
102
+ let t = ce(re);
102
103
  if (t === null) {
103
104
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
104
- throw Error.captureStackTrace && Error.captureStackTrace(n, re), n;
105
+ throw Error.captureStackTrace && Error.captureStackTrace(n, ne), n;
105
106
  }
106
107
  return t;
107
108
  }
108
- function je(e, t) {
109
- return G(t.type, He, e, t);
109
+ function Je(e, t) {
110
+ return z(t.type, je, e, t);
110
111
  }
111
- let Je = "div";
112
- function Ke(e, t) {
113
- let { defaultIndex: n = 0, vertical: r = !1, manual: s = !1, onChange: l, selectedIndex: o = null, ...b } = e;
114
- const T = r ? "vertical" : "horizontal", v = s ? "manual" : "auto";
115
- let d = o !== null, x = j({ isControlled: d }), _ = U(t), [i, c] = ke(je, { info: x, selectedIndex: o ?? n, tabs: [], panels: [] }), S = R(() => ({ selectedIndex: i.selectedIndex }), [i.selectedIndex]), A = j(l || (() => {
116
- })), h = j(i.tabs), f = R(() => ({ orientation: T, activation: v, ...i }), [T, v, i]), E = N((p) => (c({ type: 1, tab: p }), () => c({ type: 2, tab: p }))), F = N((p) => (c({ type: 3, panel: p }), () => c({ type: 4, panel: p }))), g = N((p) => {
117
- a.current !== p && A.current(p), d || c({ type: 0, index: p });
118
- }), a = j(d ? e.selectedIndex : i.selectedIndex), m = R(() => ({ registerTab: E, registerPanel: F, change: g }), []);
119
- Q(() => {
112
+ let Ke = "div";
113
+ function Ye(e, t) {
114
+ let { defaultIndex: n = 0, vertical: r = !1, manual: s = !1, onChange: l, selectedIndex: o = null, ...d } = e;
115
+ const I = r ? "vertical" : "horizontal", v = s ? "manual" : "auto";
116
+ let u = o !== null, h = J({ isControlled: u }), y = V(t), [p, c] = ye(Je, { info: h, selectedIndex: o ?? n, tabs: [], panels: [] }), x = R(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), A = J(l || (() => {
117
+ })), w = J(p.tabs), b = R(() => ({ orientation: I, activation: v, ...p }), [I, v, p]), P = D((a) => (c({ type: 1, tab: a }), () => c({ type: 2, tab: a }))), F = D((a) => (c({ type: 3, panel: a }), () => c({ type: 4, panel: a }))), m = D((a) => {
118
+ g.current !== a && A.current(a), u || c({ type: 0, index: a });
119
+ }), g = J(u ? e.selectedIndex : p.selectedIndex), N = R(() => ({ registerTab: P, registerPanel: F, change: m }), []);
120
+ X(() => {
120
121
  c({ type: 0, index: o ?? n });
121
- }, [o]), Q(() => {
122
- if (a.current === void 0 || i.tabs.length <= 0) return;
123
- let p = W(i.tabs, (y) => y.current);
124
- p.some((y, L) => i.tabs[L] !== y) && g(p.indexOf(i.tabs[a.current]));
122
+ }, [o]), X(() => {
123
+ if (g.current === void 0 || p.tabs.length <= 0) return;
124
+ let a = G(p.tabs, (f) => f.current);
125
+ a.some((f, T) => p.tabs[T] !== f) && m(a.indexOf(p.tabs[g.current]));
125
126
  });
126
- let k = { ref: _ };
127
- return M.createElement(ze, null, M.createElement(te.Provider, { value: m }, M.createElement(ee.Provider, { value: f }, f.tabs.length <= 0 && M.createElement(We, { onFocus: () => {
128
- var p, y;
129
- for (let L of h.current) if (((p = L.current) == null ? void 0 : p.tabIndex) === 0) return (y = L.current) == null || y.focus(), !0;
127
+ let B = { ref: y };
128
+ return O.createElement(Ue, null, O.createElement(re.Provider, { value: N }, O.createElement(te.Provider, { value: b }, b.tabs.length <= 0 && O.createElement(Ge, { onFocus: () => {
129
+ var a, f;
130
+ for (let T of w.current) if (((a = T.current) == null ? void 0 : a.tabIndex) === 0) return (f = T.current) == null || f.focus(), !0;
130
131
  return !1;
131
- } }), V({ ourProps: k, theirProps: b, slot: S, defaultTag: Je, name: "Tabs" }))));
132
+ } }), q({ ourProps: B, theirProps: d, slot: x, defaultTag: Ke, name: "Tabs" }))));
132
133
  }
133
- let Ye = "div";
134
- function Qe(e, t) {
135
- let { orientation: n, selectedIndex: r } = B("Tab.List"), s = U(t), l = R(() => ({ selectedIndex: r }), [r]);
136
- return V({ ourProps: { ref: s, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: Ye, name: "Tabs.List" });
134
+ let Qe = "div";
135
+ function Xe(e, t) {
136
+ let { orientation: n, selectedIndex: r } = C("Tab.List"), s = V(t), l = R(() => ({ selectedIndex: r }), [r]);
137
+ return q({ ourProps: { ref: s, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: Qe, name: "Tabs.List" });
137
138
  }
138
- let Xe = "button";
139
- function Ze(e, t) {
139
+ let Ze = "button";
140
+ function et(e, t) {
140
141
  var n, r;
141
- let s = ue(), { id: l = `headlessui-tabs-tab-${s}`, disabled: o = !1, autoFocus: b = !1, ...T } = e, { orientation: v, activation: d, selectedIndex: x, tabs: _, panels: i } = B("Tab"), c = re("Tab"), S = B("Tab"), [A, h] = K(null), f = Y(null), E = U(f, t, h);
142
- Q(() => c.registerTab(f), [c, f]);
143
- let F = me("tabs"), g = _.indexOf(f);
144
- g === -1 && (g = F);
145
- let a = g === x, m = N((u) => {
146
- var $;
147
- let q = u();
148
- if (q === J.Success && d === "auto") {
149
- let _e = ($ = Re(f)) == null ? void 0 : $.activeElement, le = S.tabs.findIndex((Ee) => Ee.current === _e);
142
+ let s = ue(), { id: l = `headlessui-tabs-tab-${s}`, disabled: o = !1, autoFocus: d = !1, ...I } = e, { orientation: v, activation: u, selectedIndex: h, tabs: y, panels: p } = C("Tab"), c = ne("Tab"), x = C("Tab"), [A, w] = Y(null), b = Q(null), P = V(b, t, w);
143
+ X(() => c.registerTab(b), [c, b]);
144
+ let F = me("tabs"), m = y.indexOf(b);
145
+ m === -1 && (m = F);
146
+ let g = m === h, N = D((i) => {
147
+ var S;
148
+ let H = i();
149
+ if (H === K.Success && u === "auto") {
150
+ let _e = (S = Le(b)) == null ? void 0 : S.activeElement, le = x.tabs.findIndex((Ee) => Ee.current === _e);
150
151
  le !== -1 && c.change(le);
151
152
  }
152
- return q;
153
- }), k = N((u) => {
154
- let $ = _.map((q) => q.current).filter(Boolean);
155
- if (u.key === I.Space || u.key === I.Enter) {
156
- u.preventDefault(), u.stopPropagation(), c.change(g);
153
+ return H;
154
+ }), B = D((i) => {
155
+ let S = y.map((H) => H.current).filter(Boolean);
156
+ if (i.key === $.Space || i.key === $.Enter) {
157
+ i.preventDefault(), i.stopPropagation(), c.change(m);
157
158
  return;
158
159
  }
159
- switch (u.key) {
160
- case I.Home:
161
- case I.PageUp:
162
- return u.preventDefault(), u.stopPropagation(), m(() => O($, P.First));
163
- case I.End:
164
- case I.PageDown:
165
- return u.preventDefault(), u.stopPropagation(), m(() => O($, P.Last));
160
+ switch (i.key) {
161
+ case $.Home:
162
+ case $.PageUp:
163
+ return i.preventDefault(), i.stopPropagation(), N(() => L(S, _.First));
164
+ case $.End:
165
+ case $.PageDown:
166
+ return i.preventDefault(), i.stopPropagation(), N(() => L(S, _.Last));
166
167
  }
167
- if (m(() => G(v, { vertical() {
168
- return u.key === I.ArrowUp ? O($, P.Previous | P.WrapAround) : u.key === I.ArrowDown ? O($, P.Next | P.WrapAround) : J.Error;
168
+ if (N(() => z(v, { vertical() {
169
+ return i.key === $.ArrowUp ? L(S, _.Previous | _.WrapAround) : i.key === $.ArrowDown ? L(S, _.Next | _.WrapAround) : K.Error;
169
170
  }, horizontal() {
170
- return u.key === I.ArrowLeft ? O($, P.Previous | P.WrapAround) : u.key === I.ArrowRight ? O($, P.Next | P.WrapAround) : J.Error;
171
- } })) === J.Success) return u.preventDefault();
172
- }), p = Y(!1), y = N(() => {
173
- var u;
174
- p.current || (p.current = !0, (u = f.current) == null || u.focus({ preventScroll: !0 }), c.change(g), Le(() => {
175
- p.current = !1;
171
+ return i.key === $.ArrowLeft ? L(S, _.Previous | _.WrapAround) : i.key === $.ArrowRight ? L(S, _.Next | _.WrapAround) : K.Error;
172
+ } })) === K.Success) return i.preventDefault();
173
+ }), a = Q(!1), f = D(() => {
174
+ var i;
175
+ a.current || (a.current = !0, (i = b.current) == null || i.focus({ preventScroll: !0 }), c.change(m), Oe(() => {
176
+ a.current = !1;
176
177
  }));
177
- }), L = N((u) => {
178
- u.preventDefault();
179
- }), { isFocusVisible: ne, focusProps: Te } = de({ autoFocus: b }), { isHovered: ae, hoverProps: Ie } = Ne({ isDisabled: o }), { pressed: se, pressProps: Pe } = Oe({ disabled: o }), we = R(() => ({ selected: a, hover: ae, active: se, focus: ne, autofocus: b, disabled: o }), [a, ae, ne, se, b, o]), $e = fe({ ref: E, onKeyDown: k, onMouseDown: L, onClick: y, id: l, role: "tab", type: Me(e, A), "aria-controls": (r = (n = i[g]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": a, tabIndex: a ? 0 : -1, disabled: o || void 0, autoFocus: b }, Te, Ie, Pe);
180
- return V({ ourProps: $e, theirProps: T, slot: we, defaultTag: Xe, name: "Tabs.Tab" });
178
+ }), T = D((i) => {
179
+ i.preventDefault();
180
+ }), { isFocusVisible: W, focusProps: Te } = de({ autoFocus: d }), { isHovered: ae, hoverProps: Ie } = Re({ isDisabled: o }), { pressed: se, pressProps: Pe } = Me({ disabled: o }), we = R(() => ({ selected: g, hover: ae, active: se, focus: W, autofocus: d, disabled: o }), [g, ae, W, se, d, o]), $e = fe({ ref: P, onKeyDown: B, onMouseDown: T, onClick: f, id: l, role: "tab", type: Ce(e, A), "aria-controls": (r = (n = p[m]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": g, tabIndex: g ? 0 : -1, disabled: o || void 0, autoFocus: d }, Te, Ie, Pe);
181
+ return q({ ourProps: $e, theirProps: I, slot: we, defaultTag: Ze, name: "Tabs.Tab" });
181
182
  }
182
- let et = "div";
183
- function tt(e, t) {
184
- let { selectedIndex: n } = B("Tab.Panels"), r = U(t), s = R(() => ({ selectedIndex: n }), [n]);
185
- return V({ ourProps: { ref: r }, theirProps: e, slot: s, defaultTag: et, name: "Tabs.Panels" });
183
+ let tt = "div";
184
+ function rt(e, t) {
185
+ let { selectedIndex: n } = C("Tab.Panels"), r = V(t), s = R(() => ({ selectedIndex: n }), [n]);
186
+ return q({ ourProps: { ref: r }, theirProps: e, slot: s, defaultTag: tt, name: "Tabs.Panels" });
186
187
  }
187
- let rt = "div", nt = oe.RenderStrategy | oe.Static;
188
- function at(e, t) {
188
+ let nt = "div", at = oe.RenderStrategy | oe.Static;
189
+ function st(e, t) {
189
190
  var n, r, s, l;
190
- let o = ue(), { id: b = `headlessui-tabs-panel-${o}`, tabIndex: T = 0, ...v } = e, { selectedIndex: d, tabs: x, panels: _ } = B("Tab.Panel"), i = re("Tab.Panel"), c = Y(null), S = U(c, t);
191
- Q(() => i.registerPanel(c), [i, c]);
192
- let A = me("panels"), h = _.indexOf(c);
193
- h === -1 && (h = A);
194
- let f = h === d, { isFocusVisible: E, focusProps: F } = de(), g = R(() => ({ selected: f, focus: E }), [f, E]), a = fe({ ref: S, id: b, role: "tabpanel", "aria-labelledby": (r = (n = x[h]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: f ? T : -1 }, F);
195
- return !f && ((s = v.unmount) == null || s) && !((l = v.static) != null && l) ? M.createElement(pe, { "aria-hidden": "true", ...a }) : V({ ourProps: a, theirProps: v, slot: g, defaultTag: rt, features: nt, visible: f, name: "Tabs.Panel" });
191
+ let o = ue(), { id: d = `headlessui-tabs-panel-${o}`, tabIndex: I = 0, ...v } = e, { selectedIndex: u, tabs: h, panels: y } = C("Tab.Panel"), p = ne("Tab.Panel"), c = Q(null), x = V(c, t);
192
+ X(() => p.registerPanel(c), [p, c]);
193
+ let A = me("panels"), w = y.indexOf(c);
194
+ w === -1 && (w = A);
195
+ let b = w === u, { isFocusVisible: P, focusProps: F } = de(), m = R(() => ({ selected: b, focus: P }), [b, P]), g = fe({ ref: x, id: d, role: "tabpanel", "aria-labelledby": (r = (n = h[w]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? I : -1 }, F);
196
+ return !b && ((s = v.unmount) == null || s) && !((l = v.static) != null && l) ? O.createElement(pe, { "aria-hidden": "true", ...g }) : q({ ourProps: g, theirProps: v, slot: m, defaultTag: nt, features: at, visible: b, name: "Tabs.Panel" });
196
197
  }
197
- let st = z(Ze), ve = z(Ke), xe = z(Qe), he = z(tt), ge = z(at), lt = Object.assign(st, { Group: ve, List: xe, Panels: he, Panel: ge });
198
- const ot = "_container_rlke5_2", it = "_group_rlke5_6", ut = "_tab_rlke5_16", ct = "_list_rlke5_51", dt = "_tabs_rlke5_62", ft = "_buttons_rlke5_68", pt = "_m_rlke5_75", bt = "_s_rlke5_83", w = {
199
- container: ot,
200
- group: it,
201
- "group-inner": "_group-inner_rlke5_9",
202
- tab: ut,
203
- list: ct,
204
- tabs: dt,
205
- buttons: ft,
206
- m: pt,
207
- s: bt
208
- }, yt = ye(
198
+ let lt = U(et), ve = U(Ye), xe = U(Xe), he = U(rt), ge = U(st), ot = Object.assign(lt, { Group: ve, List: xe, Panels: he, Panel: ge });
199
+ const it = "_container_109vo_2", ut = "_group_109vo_6", ct = "_tab_109vo_17", dt = "_list_109vo_55", ft = "_tabs_109vo_66", pt = "_buttons_109vo_72", bt = "_m_109vo_79", mt = "_s_109vo_87", E = {
200
+ container: it,
201
+ group: ut,
202
+ "group-inner": "_group-inner_109vo_10",
203
+ tab: ct,
204
+ list: dt,
205
+ tabs: ft,
206
+ buttons: pt,
207
+ m: bt,
208
+ s: mt
209
+ }, kt = Se(
209
210
  ({
210
211
  categories: e,
211
- size: t = Se.M,
212
+ size: t = Ae.M,
212
213
  showButtons: n = !0,
213
214
  className: r,
214
215
  selectedTabIndex: s,
215
216
  onTabChange: l,
216
217
  buttonsVariant: o = Fe.WHITE,
217
- autoShowButtons: b = !1,
218
- tabClassName: T,
218
+ autoShowButtons: d = !1,
219
+ tabClassName: I,
219
220
  listClassName: v,
220
- panelClassName: d,
221
- buttonsClassName: x
222
- }, _) => {
223
- const [i, c] = K(s || 0), [S, A] = K(!1), h = Y(null);
224
- Z(() => {
225
- s !== void 0 && s !== i && c(s);
226
- }, [i, s]);
227
- const f = (a) => {
228
- c(a), l == null || l(a);
229
- }, E = () => {
230
- const a = (i + 1) % e.length;
231
- f(a);
232
- }, F = () => {
233
- const a = (i - 1 + e.length) % e.length;
234
- f(a);
221
+ panelClassName: u,
222
+ buttonsClassName: h,
223
+ indicatorColor: y,
224
+ tabIcons: p = {}
225
+ }, c) => {
226
+ const [x, A] = Y(s || 0), [w, b] = Y(!1), P = Q(null), F = y ? { "--tab-indicator-color": y } : void 0;
227
+ ee(() => {
228
+ s !== void 0 && s !== x && A(s);
229
+ }, [x, s]);
230
+ const m = (a) => {
231
+ A(a), l == null || l(a);
232
+ }, g = () => {
233
+ const a = (x + 1) % e.length;
234
+ m(a);
235
+ }, N = () => {
236
+ const a = (x - 1 + e.length) % e.length;
237
+ m(a);
235
238
  };
236
- Z(() => {
237
- var m;
238
- const a = (m = h.current) == null ? void 0 : m.querySelector(
239
- `.${w.tab}[data-active="true"]`
239
+ ee(() => {
240
+ var f;
241
+ const a = (f = P.current) == null ? void 0 : f.querySelector(
242
+ `.${E.tab}[data-active="true"]`
240
243
  );
241
244
  a && typeof a.scrollIntoView == "function" && a.scrollIntoView({
242
245
  behavior: "smooth",
243
246
  block: "nearest",
244
247
  inline: "center"
245
248
  });
246
- }, [i]), Z(() => {
249
+ }, [x]), ee(() => {
247
250
  const a = () => {
248
- if (h.current) {
249
- const { scrollWidth: m, clientWidth: k } = h.current;
250
- A(m > k);
251
+ if (P.current) {
252
+ const { scrollWidth: f, clientWidth: T } = P.current;
253
+ b(f > T);
251
254
  }
252
255
  };
253
256
  return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
254
257
  }, [e]);
255
- const g = b ? S : n;
256
- return /* @__PURE__ */ X(
258
+ const B = d ? w : n;
259
+ return /* @__PURE__ */ Z(
257
260
  ve,
258
261
  {
259
- ref: _,
260
- className: H(w.group, w[t], r),
261
- selectedIndex: i,
262
- onChange: f,
262
+ ref: c,
263
+ className: j(E.group, E[t], r),
264
+ selectedIndex: x,
265
+ onChange: m,
266
+ style: F,
263
267
  children: [
264
- /* @__PURE__ */ X("div", { className: w["group-inner"], children: [
265
- /* @__PURE__ */ D(
268
+ /* @__PURE__ */ Z("div", { className: E["group-inner"], children: [
269
+ /* @__PURE__ */ k(
266
270
  xe,
267
271
  {
268
- ref: h,
269
- className: H(w.list, v),
270
- children: /* @__PURE__ */ D("div", { className: w.tabs, children: e.map(({ name: a, notificationCount: m }, k) => /* @__PURE__ */ X(
271
- lt,
272
- {
273
- className: `${w.tab} ${i === k ? 'data-active="true"' : ""} ${T || ""}`,
274
- "data-active": i === k,
275
- children: [
276
- a,
277
- m && /* @__PURE__ */ D(De, { count: m, size: "m" })
278
- ]
279
- },
280
- a
281
- )) })
272
+ ref: P,
273
+ className: j(E.list, v),
274
+ children: /* @__PURE__ */ k("div", { className: E.tabs, children: e.map(({ name: a, notificationCount: f }, T) => {
275
+ const W = p[T];
276
+ return /* @__PURE__ */ Z(
277
+ ot,
278
+ {
279
+ className: `${E.tab} ${x === T ? 'data-active="true"' : ""} ${I || ""}`,
280
+ "data-active": x === T,
281
+ children: [
282
+ W && /* @__PURE__ */ k(Ne, { iconName: W }),
283
+ a,
284
+ f && /* @__PURE__ */ k(De, { count: f, size: "m" })
285
+ ]
286
+ },
287
+ a
288
+ );
289
+ }) })
282
290
  }
283
291
  ),
284
- g && /* @__PURE__ */ D("div", { className: H(w.buttons, x), children: /* @__PURE__ */ D(
285
- Ae,
292
+ B && /* @__PURE__ */ k("div", { className: j(E.buttons, h), children: /* @__PURE__ */ k(
293
+ ke,
286
294
  {
287
- handlePrevTab: F,
288
- handleNextTab: E,
295
+ handlePrevTab: N,
296
+ handleNextTab: g,
289
297
  buttonsVariant: o
290
298
  }
291
299
  ) })
292
300
  ] }),
293
- /* @__PURE__ */ D(he, { className: w.panels, children: e.map(({ name: a, content: m }) => /* @__PURE__ */ D(
301
+ /* @__PURE__ */ k(he, { className: E.panels, children: e.map(({ name: a, content: f }) => /* @__PURE__ */ k(
294
302
  ge,
295
303
  {
296
- className: H(w.panel, d),
297
- children: m
304
+ className: j(E.panel, u),
305
+ children: f
298
306
  },
299
307
  a
300
308
  )) })
@@ -304,5 +312,5 @@ const ot = "_container_rlke5_2", it = "_group_rlke5_6", ut = "_tab_rlke5_16", ct
304
312
  }
305
313
  );
306
314
  export {
307
- yt as TabTrail
315
+ kt as TabTrail
308
316
  };
@@ -1,5 +1,7 @@
1
1
  import { TProps as TToastProps } from './Toast';
2
2
 
3
- type TProps = Pick<TToastProps, 'duration' | 'variant'>;
4
- export declare const ProgressBar: import('react').MemoExoticComponent<({ duration, variant }: TProps) => import("react/jsx-runtime").JSX.Element>;
3
+ type TProps = Pick<TToastProps, 'duration' | 'variant'> & {
4
+ isPaused?: boolean;
5
+ };
6
+ export declare const ProgressBar: import('react').MemoExoticComponent<({ duration, variant, isPaused }: TProps) => import("react/jsx-runtime").JSX.Element>;
5
7
  export {};
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-DIxK0V-G.js";
3
3
  import "react";
4
4
  import "./constants.js";
5
- import { P as s } from "../../ProgressBar-DEFs1tWq.js";
5
+ import { P as s } from "../../ProgressBar-COdzy3fY.js";
6
6
  export {
7
7
  s as ProgressBar
8
8
  };
@@ -50,5 +50,9 @@ export type TProps = {
50
50
  * Слот уведомления.
51
51
  */
52
52
  slot?: ReactNode;
53
+ /**
54
+ * Флаг, указывающий на приостановку таймера при наведении курсора.
55
+ */
56
+ pauseOnHover?: boolean;
53
57
  };
54
- export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, slot }: TProps) => import("react/jsx-runtime").JSX.Element>;
58
+ export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, slot, pauseOnHover }: TProps) => import("react/jsx-runtime").JSX.Element>;