mimir-ui-kit 1.43.28 → 1.44.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 (80) hide show
  1. package/dist/Input-IzZ6B9kw.js +232 -0
  2. package/dist/assets/Avatar.css +1 -1
  3. package/dist/assets/Chip.css +1 -1
  4. package/dist/assets/CopyText.css +1 -0
  5. package/dist/assets/Counter.css +1 -0
  6. package/dist/assets/DropdownSelect.css +1 -0
  7. package/dist/assets/Input.css +1 -1
  8. package/dist/assets/Pagination.css +1 -1
  9. package/dist/assets/SelectSearch.css +1 -1
  10. package/dist/assets/TabTrail.css +1 -1
  11. package/dist/assets/index.css +1 -1
  12. package/dist/assets/styles.css +1 -1
  13. package/dist/components/Avatar/Avatar.d.ts +1 -1
  14. package/dist/components/Avatar/Avatar.js +41 -37
  15. package/dist/components/Avatar/constants.d.ts +5 -0
  16. package/dist/components/Avatar/constants.js +3 -2
  17. package/dist/components/Avatar/index.d.ts +1 -0
  18. package/dist/components/Avatar/index.js +5 -4
  19. package/dist/components/Avatar/types.d.ts +3 -1
  20. package/dist/components/Chip/Chip.d.ts +5 -1
  21. package/dist/components/Chip/Chip.js +45 -36
  22. package/dist/components/Chip/constants.d.ts +5 -1
  23. package/dist/components/Chip/constants.js +3 -3
  24. package/dist/components/CopyText/CopyText.d.ts +3 -0
  25. package/dist/components/CopyText/CopyText.js +96 -0
  26. package/dist/components/CopyText/index.d.ts +2 -0
  27. package/dist/components/CopyText/index.js +4 -0
  28. package/dist/components/CopyText/types.d.ts +32 -0
  29. package/dist/components/DatePicker/DatePicker.d.ts +19 -0
  30. package/dist/components/DatePicker/DatePicker.js +149 -134
  31. package/dist/components/DatePicker/DatePickerModal.js +1 -1
  32. package/dist/components/DatePicker/MonthPickerModal.js +1 -1
  33. package/dist/components/DatePicker/YearPickerModal.js +1 -1
  34. package/dist/components/DatePicker/constants.d.ts +6 -0
  35. package/dist/components/DatePicker/constants.js +13 -12
  36. package/dist/components/DatePicker/index.d.ts +1 -0
  37. package/dist/components/DatePicker/index.js +3 -1
  38. package/dist/components/DropdownSelect/DropdownSelect.d.ts +3 -0
  39. package/dist/components/DropdownSelect/DropdownSelect.js +115 -0
  40. package/dist/components/DropdownSelect/constants.d.ts +5 -0
  41. package/dist/components/DropdownSelect/constants.js +4 -0
  42. package/dist/components/DropdownSelect/index.d.ts +3 -0
  43. package/dist/components/DropdownSelect/index.js +6 -0
  44. package/dist/components/DropdownSelect/types.d.ts +56 -0
  45. package/dist/components/Input/Input.d.ts +5 -0
  46. package/dist/components/Input/Input.js +1 -1
  47. package/dist/components/Input/constants.d.ts +6 -0
  48. package/dist/components/Input/constants.js +4 -3
  49. package/dist/components/Input/index.js +1 -1
  50. package/dist/components/InputPassword/InputPassword.js +1 -1
  51. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  52. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
  53. package/dist/components/MultiSelectSearch/utils.js +1 -1
  54. package/dist/components/OtpInput/OtpInput.js +1 -1
  55. package/dist/components/Pagination/Counter/Counter.d.ts +9 -0
  56. package/dist/components/Pagination/Counter/Counter.js +28 -0
  57. package/dist/components/Pagination/Pagination.d.ts +17 -0
  58. package/dist/components/Pagination/Pagination.js +167 -126
  59. package/dist/components/Pagination/constants.d.ts +6 -0
  60. package/dist/components/Pagination/constants.js +5 -3
  61. package/dist/components/Pagination/index.d.ts +1 -0
  62. package/dist/components/Pagination/index.js +4 -2
  63. package/dist/components/SelectSearch/SelectSearch.d.ts +2 -1
  64. package/dist/components/SelectSearch/SelectSearch.js +193 -187
  65. package/dist/components/SelectSearch/constants.d.ts +6 -0
  66. package/dist/components/SelectSearch/constants.js +7 -5
  67. package/dist/components/SelectSearch/index.d.ts +1 -1
  68. package/dist/components/SelectSearch/index.js +5 -4
  69. package/dist/components/SelectSearch/types.d.ts +6 -1
  70. package/dist/components/SelectSearch/utils.js +1 -1
  71. package/dist/components/TabTrail/TabTrail.d.ts +16 -0
  72. package/dist/components/TabTrail/TabTrail.js +257 -220
  73. package/dist/components/TextArea/TextArea.js +1 -1
  74. package/dist/components/index.d.ts +8 -4
  75. package/dist/components/index.js +178 -166
  76. package/dist/index.js +203 -191
  77. package/dist/styles.module-B3lX7mJq.js +31 -0
  78. package/package.json +1 -1
  79. package/dist/Input-BU_6U1CW.js +0 -227
  80. package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,25 +1,25 @@
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";
1
+ import { jsxs as V, jsx as _, Fragment as Ne } from "react/jsx-runtime";
2
+ import { c as X } from "../../index-DIxK0V-G.js";
3
+ import * as B from "react";
4
+ import M, { useState as te, createContext as fe, useReducer as Se, useMemo as R, useId as pe, useRef as re, useContext as be, forwardRef as Ae, useEffect as se } from "react";
5
+ import { ETabTrailSize as Fe } from "./constants.js";
6
6
  import { TabButtons as ke } from "./TabButtons/TabButtons.js";
7
- import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
8
- import { Icon as Ne } from "../../icons/Icon.js";
9
- import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
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) => {
19
- s.preventDefault();
20
- let l, o = 50;
21
- function d() {
22
- if (o-- <= 0) {
7
+ import { ETabTrailButtonVariant as De } from "./TabButtons/constants.js";
8
+ import { Icon as ue } from "../../icons/Icon.js";
9
+ import { NotificationBadge as Re } from "../NotificationBadge/NotificationBadge.js";
10
+ import { M as de, W as j, s as Z, y as J, o as D, n as ne, H as K, $ as me, b as Le, D as ve, a as H, u as Oe, c as y, e as Me } from "../../keyboard-wis2TUql.js";
11
+ import { w as Be } from "../../use-active-press-CnDeVvQq.js";
12
+ import { e as We } from "../../use-resolve-button-type-DhFdPxnv.js";
13
+ import { f as Ce } from "../../use-is-mounted-MBU4fiLr.js";
14
+ import { T as he, s as Ge } from "../../hidden-CkTYbiNM.js";
15
+ import { _ as q, T as ee, P as O, F as E } from "../../focus-management-BAl0GmRk.js";
16
+ import '../../assets/TabTrail.css';function Ue({ onFocus: e }) {
17
+ let [t, n] = te(!0), r = Ce();
18
+ return t ? M.createElement(he, { as: "button", type: "button", features: Ge.Focusable, onFocus: (a) => {
19
+ a.preventDefault();
20
+ let l, i = 50;
21
+ function f() {
22
+ if (i-- <= 0) {
23
23
  l && cancelAnimationFrame(l);
24
24
  return;
25
25
  }
@@ -28,283 +28,320 @@ import '../../assets/TabTrail.css';function Ge({ onFocus: e }) {
28
28
  n(!1);
29
29
  return;
30
30
  }
31
- l = requestAnimationFrame(d);
31
+ l = requestAnimationFrame(f);
32
32
  }
33
- l = requestAnimationFrame(d);
33
+ l = requestAnimationFrame(f);
34
34
  } }) : null;
35
35
  }
36
- const be = M.createContext(null);
36
+ const xe = B.createContext(null);
37
37
  function ze() {
38
38
  return { groups: /* @__PURE__ */ new Map(), get(e, t) {
39
39
  var n;
40
40
  let r = this.groups.get(e);
41
41
  r || (r = /* @__PURE__ */ new Map(), this.groups.set(e, r));
42
- let s = (n = r.get(t)) != null ? n : 0;
43
- r.set(t, s + 1);
42
+ let a = (n = r.get(t)) != null ? n : 0;
43
+ r.set(t, a + 1);
44
44
  let l = Array.from(r.keys()).indexOf(t);
45
- function o() {
46
- let d = r.get(t);
47
- d > 1 ? r.set(t, d - 1) : r.delete(t);
45
+ function i() {
46
+ let f = r.get(t);
47
+ f > 1 ? r.set(t, f - 1) : r.delete(t);
48
48
  }
49
- return [l, o];
49
+ return [l, i];
50
50
  } };
51
51
  }
52
- function Ue({ children: e }) {
53
- let t = M.useRef(ze());
54
- return M.createElement(be.Provider, { value: t }, e);
52
+ function Ve({ children: e }) {
53
+ let t = B.useRef(ze());
54
+ return B.createElement(xe.Provider, { value: t }, e);
55
55
  }
56
- function me(e) {
57
- let t = M.useContext(be);
56
+ function ge(e) {
57
+ let t = B.useContext(xe);
58
58
  if (!t) throw new Error("You must wrap your component in a <StableCollection>");
59
- let n = M.useId(), [r, s] = t.current.get(e, n);
60
- return M.useEffect(() => s, []), r;
59
+ let n = B.useId(), [r, a] = t.current.get(e, n);
60
+ return B.useEffect(() => a, []), r;
61
61
  }
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) {
62
+ var qe = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(qe || {}), He = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(He || {}), je = ((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))(je || {});
63
+ let Je = { 0(e, t) {
64
64
  var n;
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"));
68
- }), o = { ...e, tabs: r, panels: s };
65
+ let r = q(e.tabs, (d) => d.current), a = q(e.panels, (d) => d.current), l = r.filter((d) => {
66
+ var T;
67
+ return !((T = d.current) != null && T.hasAttribute("disabled"));
68
+ }), i = { ...e, tabs: r, panels: a };
69
69
  if (t.index < 0 || t.index > r.length - 1) {
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 });
71
- if (l.length === 0) return o;
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 };
70
+ let d = H(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => H(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
71
+ if (l.length === 0) return i;
72
+ let T = H(d, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
73
+ return { ...i, selectedIndex: T === -1 ? e.selectedIndex : T };
74
74
  }
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;
78
- return v === -1 && (v = e.selectedIndex), { ...o, selectedIndex: v };
75
+ let f = r.slice(0, t.index), P = [...r.slice(t.index), ...f].find((d) => l.includes(d));
76
+ if (!P) return i;
77
+ let x = (n = r.indexOf(P)) != null ? n : e.selectedIndex;
78
+ return x === -1 && (x = e.selectedIndex), { ...i, selectedIndex: x };
79
79
  }, 1(e, t) {
80
80
  if (e.tabs.includes(t.tab)) return e;
81
- let n = e.tabs[e.selectedIndex], r = G([...e.tabs, t.tab], (l) => l.current), s = e.selectedIndex;
82
- return e.info.current.isControlled || (s = r.indexOf(n), s === -1 && (s = e.selectedIndex)), { ...e, tabs: r, selectedIndex: s };
81
+ let n = e.tabs[e.selectedIndex], r = q([...e.tabs, t.tab], (l) => l.current), a = e.selectedIndex;
82
+ return e.info.current.isControlled || (a = r.indexOf(n), a === -1 && (a = e.selectedIndex)), { ...e, tabs: r, selectedIndex: a };
83
83
  }, 2(e, t) {
84
84
  return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
85
85
  }, 3(e, t) {
86
- return e.panels.includes(t.panel) ? e : { ...e, panels: G([...e.panels, t.panel], (n) => n.current) };
86
+ return e.panels.includes(t.panel) ? e : { ...e, panels: q([...e.panels, t.panel], (n) => n.current) };
87
87
  }, 4(e, t) {
88
88
  return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
89
- } }, te = ie(null);
90
- te.displayName = "TabsDataContext";
91
- function C(e) {
92
- let t = ce(te);
89
+ } }, le = fe(null);
90
+ le.displayName = "TabsDataContext";
91
+ function W(e) {
92
+ let t = be(le);
93
93
  if (t === null) {
94
94
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
95
- throw Error.captureStackTrace && Error.captureStackTrace(n, C), n;
95
+ throw Error.captureStackTrace && Error.captureStackTrace(n, W), n;
96
96
  }
97
97
  return t;
98
98
  }
99
- let re = ie(null);
100
- re.displayName = "TabsActionsContext";
101
- function ne(e) {
102
- let t = ce(re);
99
+ let ie = fe(null);
100
+ ie.displayName = "TabsActionsContext";
101
+ function oe(e) {
102
+ let t = be(ie);
103
103
  if (t === null) {
104
104
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
105
- throw Error.captureStackTrace && Error.captureStackTrace(n, ne), n;
105
+ throw Error.captureStackTrace && Error.captureStackTrace(n, oe), n;
106
106
  }
107
107
  return t;
108
108
  }
109
- function Je(e, t) {
110
- return z(t.type, je, e, t);
109
+ function Ke(e, t) {
110
+ return H(t.type, Je, e, t);
111
111
  }
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(() => {
121
- c({ type: 0, index: o ?? n });
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]));
112
+ let Ye = "div";
113
+ function Qe(e, t) {
114
+ let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: l, selectedIndex: i = null, ...f } = e;
115
+ const P = r ? "vertical" : "horizontal", x = a ? "manual" : "auto";
116
+ let d = i !== null, T = Z({ isControlled: d }), N = J(t), [p, o] = Se(Ke, { info: T, selectedIndex: i ?? n, tabs: [], panels: [] }), F = R(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), g = Z(l || (() => {
117
+ })), w = Z(p.tabs), b = R(() => ({ orientation: P, activation: x, ...p }), [P, x, p]), A = D((c) => (o({ type: 1, tab: c }), () => o({ type: 2, tab: c }))), $ = D((c) => (o({ type: 3, panel: c }), () => o({ type: 4, panel: c }))), I = D((c) => {
118
+ h.current !== c && g.current(c), d || o({ type: 0, index: c });
119
+ }), h = Z(d ? e.selectedIndex : p.selectedIndex), k = R(() => ({ registerTab: A, registerPanel: $, change: I }), []);
120
+ ne(() => {
121
+ o({ type: 0, index: i ?? n });
122
+ }, [i]), ne(() => {
123
+ if (h.current === void 0 || p.tabs.length <= 0) return;
124
+ let c = q(p.tabs, (s) => s.current);
125
+ c.some((s, v) => p.tabs[v] !== s) && I(c.indexOf(p.tabs[h.current]));
126
126
  });
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;
127
+ let C = { ref: N };
128
+ return M.createElement(Ve, null, M.createElement(ie.Provider, { value: k }, M.createElement(le.Provider, { value: b }, b.tabs.length <= 0 && M.createElement(Ue, { onFocus: () => {
129
+ var c, s;
130
+ for (let v of w.current) if (((c = v.current) == null ? void 0 : c.tabIndex) === 0) return (s = v.current) == null || s.focus(), !0;
131
131
  return !1;
132
- } }), q({ ourProps: B, theirProps: d, slot: x, defaultTag: Ke, name: "Tabs" }))));
132
+ } }), K({ ourProps: C, theirProps: f, slot: F, defaultTag: Ye, name: "Tabs" }))));
133
133
  }
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" });
134
+ let Xe = "div";
135
+ function Ze(e, t) {
136
+ let { orientation: n, selectedIndex: r } = W("Tab.List"), a = J(t), l = R(() => ({ selectedIndex: r }), [r]);
137
+ return K({ ourProps: { ref: a, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: Xe, name: "Tabs.List" });
138
138
  }
139
- let Ze = "button";
140
- function et(e, t) {
139
+ let et = "button";
140
+ function tt(e, t) {
141
141
  var n, r;
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) => {
142
+ let a = pe(), { id: l = `headlessui-tabs-tab-${a}`, disabled: i = !1, autoFocus: f = !1, ...P } = e, { orientation: x, activation: d, selectedIndex: T, tabs: N, panels: p } = W("Tab"), o = oe("Tab"), F = W("Tab"), [g, w] = te(null), b = re(null), A = J(b, t, w);
143
+ ne(() => o.registerTab(b), [o, b]);
144
+ let $ = ge("tabs"), I = N.indexOf(b);
145
+ I === -1 && (I = $);
146
+ let h = I === T, k = D((u) => {
147
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);
151
- le !== -1 && c.change(le);
148
+ let Q = u();
149
+ if (Q === ee.Success && d === "auto") {
150
+ let ye = (S = Oe(b)) == null ? void 0 : S.activeElement, ce = F.tabs.findIndex((Ee) => Ee.current === ye);
151
+ ce !== -1 && o.change(ce);
152
152
  }
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);
153
+ return Q;
154
+ }), C = D((u) => {
155
+ let S = N.map((Q) => Q.current).filter(Boolean);
156
+ if (u.key === y.Space || u.key === y.Enter) {
157
+ u.preventDefault(), u.stopPropagation(), o.change(I);
158
158
  return;
159
159
  }
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));
160
+ switch (u.key) {
161
+ case y.Home:
162
+ case y.PageUp:
163
+ return u.preventDefault(), u.stopPropagation(), k(() => O(S, E.First));
164
+ case y.End:
165
+ case y.PageDown:
166
+ return u.preventDefault(), u.stopPropagation(), k(() => O(S, E.Last));
167
167
  }
168
- if (N(() => z(v, { vertical() {
169
- return i.key === $.ArrowUp ? L(S, _.Previous | _.WrapAround) : i.key === $.ArrowDown ? L(S, _.Next | _.WrapAround) : K.Error;
168
+ if (k(() => H(x, { vertical() {
169
+ return u.key === y.ArrowUp ? O(S, E.Previous | E.WrapAround) : u.key === y.ArrowDown ? O(S, E.Next | E.WrapAround) : ee.Error;
170
170
  }, horizontal() {
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;
171
+ return u.key === y.ArrowLeft ? O(S, E.Previous | E.WrapAround) : u.key === y.ArrowRight ? O(S, E.Next | E.WrapAround) : ee.Error;
172
+ } })) === ee.Success) return u.preventDefault();
173
+ }), c = re(!1), s = D(() => {
174
+ var u;
175
+ c.current || (c.current = !0, (u = b.current) == null || u.focus({ preventScroll: !0 }), o.change(I), Me(() => {
176
+ c.current = !1;
177
177
  }));
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" });
178
+ }), v = D((u) => {
179
+ u.preventDefault();
180
+ }), { isFocusVisible: L, focusProps: Y } = me({ autoFocus: f }), { isHovered: G, hoverProps: U } = Le({ isDisabled: i }), { pressed: z, pressProps: ae } = Be({ disabled: i }), we = R(() => ({ selected: h, hover: G, active: z, focus: L, autofocus: f, disabled: i }), [h, G, L, z, f, i]), $e = ve({ ref: A, onKeyDown: C, onMouseDown: v, onClick: s, id: l, role: "tab", type: We(e, g), "aria-controls": (r = (n = p[I]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": h, tabIndex: h ? 0 : -1, disabled: i || void 0, autoFocus: f }, Y, U, ae);
181
+ return K({ ourProps: $e, theirProps: P, slot: we, defaultTag: et, name: "Tabs.Tab" });
182
182
  }
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" });
183
+ let rt = "div";
184
+ function nt(e, t) {
185
+ let { selectedIndex: n } = W("Tab.Panels"), r = J(t), a = R(() => ({ selectedIndex: n }), [n]);
186
+ return K({ ourProps: { ref: r }, theirProps: e, slot: a, defaultTag: rt, name: "Tabs.Panels" });
187
187
  }
188
- let nt = "div", at = oe.RenderStrategy | oe.Static;
189
- function st(e, t) {
190
- var n, r, s, l;
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" });
188
+ let at = "div", st = de.RenderStrategy | de.Static;
189
+ function lt(e, t) {
190
+ var n, r, a, l;
191
+ let i = pe(), { id: f = `headlessui-tabs-panel-${i}`, tabIndex: P = 0, ...x } = e, { selectedIndex: d, tabs: T, panels: N } = W("Tab.Panel"), p = oe("Tab.Panel"), o = re(null), F = J(o, t);
192
+ ne(() => p.registerPanel(o), [p, o]);
193
+ let g = ge("panels"), w = N.indexOf(o);
194
+ w === -1 && (w = g);
195
+ let b = w === d, { isFocusVisible: A, focusProps: $ } = me(), I = R(() => ({ selected: b, focus: A }), [b, A]), h = ve({ ref: F, id: f, role: "tabpanel", "aria-labelledby": (r = (n = T[w]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? P : -1 }, $);
196
+ return !b && ((a = x.unmount) == null || a) && !((l = x.static) != null && l) ? M.createElement(he, { "aria-hidden": "true", ...h }) : K({ ourProps: h, theirProps: x, slot: I, defaultTag: at, features: st, visible: b, name: "Tabs.Panel" });
197
197
  }
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,
198
+ let it = j(tt), _e = j(Qe), Te = j(Ze), Ie = j(nt), Pe = j(lt), ot = Object.assign(it, { Group: _e, List: Te, Panels: Ie, Panel: Pe });
199
+ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft = "_list_14t2i_55", pt = "_tabs_14t2i_66", bt = "_buttons_14t2i_72", mt = "_m_14t2i_79", vt = "_s_14t2i_87", ht = "_detailed_14t2i_95", m = {
200
+ container: ct,
201
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(
202
+ "group-inner": "_group-inner_14t2i_10",
203
+ tab: dt,
204
+ list: ft,
205
+ tabs: pt,
206
+ buttons: bt,
207
+ m: mt,
208
+ s: vt,
209
+ detailed: ht,
210
+ "tab-content": "_tab-content_14t2i_123",
211
+ "tab-value": "_tab-value_14t2i_131",
212
+ "tab-name": "_tab-name_14t2i_140",
213
+ "tab-header": "_tab-header_14t2i_149",
214
+ "tab-text": "_tab-text_14t2i_155",
215
+ "tab-icon": "_tab-icon_14t2i_162"
216
+ }, kt = Ae(
210
217
  ({
211
218
  categories: e,
212
- size: t = Ae.M,
219
+ size: t = Fe.M,
213
220
  showButtons: n = !0,
214
221
  className: r,
215
- selectedTabIndex: s,
222
+ selectedTabIndex: a,
216
223
  onTabChange: l,
217
- buttonsVariant: o = Fe.WHITE,
218
- autoShowButtons: d = !1,
219
- tabClassName: I,
220
- listClassName: v,
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);
224
+ buttonsVariant: i = De.WHITE,
225
+ autoShowButtons: f = !1,
226
+ tabClassName: P,
227
+ listClassName: x,
228
+ panelClassName: d,
229
+ buttonsClassName: T,
230
+ indicatorColor: N,
231
+ tabIcons: p = {},
232
+ variant: o = "default"
233
+ }, F) => {
234
+ const [g, w] = te(a || 0), [b, A] = te(!1), $ = re(null), I = {
235
+ ...N && { "--tab-indicator-color": N }
238
236
  };
239
- ee(() => {
240
- var f;
241
- const a = (f = P.current) == null ? void 0 : f.querySelector(
242
- `.${E.tab}[data-active="true"]`
237
+ se(() => {
238
+ a !== void 0 && a !== g && w(a);
239
+ }, [g, a]);
240
+ const h = (s) => {
241
+ w(s), l == null || l(s);
242
+ }, k = () => {
243
+ const s = (g + 1) % e.length;
244
+ h(s);
245
+ }, C = () => {
246
+ const s = (g - 1 + e.length) % e.length;
247
+ h(s);
248
+ };
249
+ se(() => {
250
+ var v;
251
+ const s = (v = $.current) == null ? void 0 : v.querySelector(
252
+ `.${m.tab}[data-active="true"]`
243
253
  );
244
- a && typeof a.scrollIntoView == "function" && a.scrollIntoView({
254
+ s && typeof s.scrollIntoView == "function" && s.scrollIntoView({
245
255
  behavior: "smooth",
246
256
  block: "nearest",
247
257
  inline: "center"
248
258
  });
249
- }, [x]), ee(() => {
250
- const a = () => {
251
- if (P.current) {
252
- const { scrollWidth: f, clientWidth: T } = P.current;
253
- b(f > T);
259
+ }, [g]), se(() => {
260
+ const s = () => {
261
+ if ($.current) {
262
+ const { scrollWidth: v, clientWidth: L } = $.current;
263
+ A(v > L);
254
264
  }
255
265
  };
256
- return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
266
+ return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
257
267
  }, [e]);
258
- const B = d ? w : n;
259
- return /* @__PURE__ */ Z(
260
- ve,
268
+ const c = f ? b : n;
269
+ return /* @__PURE__ */ V(
270
+ _e,
261
271
  {
262
- ref: c,
263
- className: j(E.group, E[t], r),
264
- selectedIndex: x,
265
- onChange: m,
266
- style: F,
272
+ ref: F,
273
+ className: X(
274
+ m.group,
275
+ m[t],
276
+ o === "detailed" && m.detailed,
277
+ r
278
+ ),
279
+ selectedIndex: g,
280
+ onChange: h,
281
+ style: I,
267
282
  children: [
268
- /* @__PURE__ */ Z("div", { className: E["group-inner"], children: [
269
- /* @__PURE__ */ k(
270
- xe,
283
+ /* @__PURE__ */ V("div", { className: m["group-inner"], children: [
284
+ /* @__PURE__ */ _(
285
+ Te,
271
286
  {
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
- }) })
287
+ ref: $,
288
+ className: X(m.list, x),
289
+ children: /* @__PURE__ */ _("div", { className: m.tabs, children: e.map(
290
+ ({ name: s, notificationCount: v, value: L, valueColor: Y, borderColor: G }, U) => {
291
+ const z = p[U], ae = o === "detailed" ? {
292
+ ...Y && {
293
+ "--detailed-value-color": Y
294
+ },
295
+ ...G && {
296
+ "--detailed-border-color": G
297
+ }
298
+ } : void 0;
299
+ return /* @__PURE__ */ _(
300
+ ot,
301
+ {
302
+ className: `${m.tab} ${g === U ? 'data-active="true"' : ""} ${P || ""}`,
303
+ "data-active": g === U,
304
+ style: ae,
305
+ children: o === "detailed" ? /* @__PURE__ */ _("div", { className: m["tab-content"], children: /* @__PURE__ */ V("div", { className: m["tab-header"], children: [
306
+ /* @__PURE__ */ V("div", { className: m["tab-text"], children: [
307
+ /* @__PURE__ */ _("div", { className: m["tab-value"], children: L }),
308
+ /* @__PURE__ */ _("div", { className: m["tab-name"], children: s })
309
+ ] }),
310
+ /* @__PURE__ */ _("div", { className: m["tab-icon"], children: /* @__PURE__ */ _(ue, { iconName: "ArrowUpRight24px" }) })
311
+ ] }) }) : /* @__PURE__ */ V(Ne, { children: [
312
+ z && /* @__PURE__ */ _(ue, { iconName: z }),
313
+ s,
314
+ v && /* @__PURE__ */ _(
315
+ Re,
316
+ {
317
+ count: v,
318
+ size: "m"
319
+ }
320
+ )
321
+ ] })
322
+ },
323
+ s
324
+ );
325
+ }
326
+ ) })
290
327
  }
291
328
  ),
292
- B && /* @__PURE__ */ k("div", { className: j(E.buttons, h), children: /* @__PURE__ */ k(
329
+ c && /* @__PURE__ */ _("div", { className: X(m.buttons, T), children: /* @__PURE__ */ _(
293
330
  ke,
294
331
  {
295
- handlePrevTab: N,
296
- handleNextTab: g,
297
- buttonsVariant: o
332
+ handlePrevTab: C,
333
+ handleNextTab: k,
334
+ buttonsVariant: i
298
335
  }
299
336
  ) })
300
337
  ] }),
301
- /* @__PURE__ */ k(he, { className: E.panels, children: e.map(({ name: a, content: f }) => /* @__PURE__ */ k(
302
- ge,
338
+ /* @__PURE__ */ _(Ie, { className: m.panels, children: e.map(({ name: s, content: v }) => /* @__PURE__ */ _(
339
+ Pe,
303
340
  {
304
- className: j(E.panel, u),
305
- children: f
341
+ className: X(m.panel, d),
342
+ children: v
306
343
  },
307
- a
344
+ s
308
345
  )) })
309
346
  ]
310
347
  }
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea as Z } from "./hooks.js";
5
5
  import { useMergeRefs as $ } from "../../hooks/useMergeRefs/useMergeRefs.js";
6
6
  import { Icon as ee } from "../../icons/Icon.js";
7
7
  import { Button as te } from "../Button/Button.js";
8
- import { c as e } from "../../Input-BU_6U1CW.js";
8
+ import { c as e } from "../../Input-IzZ6B9kw.js";
9
9
  import { EInputVariant as ae } from "../Input/constants.js";
10
10
  import '../../assets/TextArea.css';const re = "_textarea_rk5xe_2", se = "_clear_rk5xe_11", le = "_label_rk5xe_26", ne = "_s_rk5xe_71", oe = "_m_rk5xe_84", ce = "_l_rk5xe_26", t = {
11
11
  "textarea-wrapper": "_textarea-wrapper_rk5xe_2",