mimir-ui-kit 1.35.4 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/dist/{Input-B-gKQ9FT.js → Input-DlGNMuUD.js} +67 -64
  2. package/dist/assets/Input.css +1 -1
  3. package/dist/assets/ListPhotos.css +1 -1
  4. package/dist/assets/MultiSelectSearch.css +1 -0
  5. package/dist/assets/SelectSearch.css +1 -1
  6. package/dist/combobox-CDU06zJj.js +2855 -0
  7. package/dist/components/Accordion/Accordion.js +168 -166
  8. package/dist/components/Button/Button.d.ts +36 -0
  9. package/dist/components/Button/Button.js +44 -43
  10. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
  11. package/dist/components/CheckboxMimir/CheckboxMimir.js +37 -30
  12. package/dist/components/Chip/Chip.d.ts +5 -1
  13. package/dist/components/Chip/Chip.js +23 -22
  14. package/dist/components/DatePicker/DatePicker.js +1 -1
  15. package/dist/components/Input/Input.js +1 -1
  16. package/dist/components/Input/index.js +1 -1
  17. package/dist/components/InputPassword/InputPassword.js +1 -1
  18. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  19. package/dist/components/ListPhotos/ListPhotos.js +4 -4
  20. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +22 -0
  21. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +318 -0
  22. package/dist/components/MultiSelectSearch/constants.d.ts +4 -0
  23. package/dist/components/MultiSelectSearch/constants.js +4 -0
  24. package/dist/components/MultiSelectSearch/index.d.ts +3 -0
  25. package/dist/components/MultiSelectSearch/index.js +6 -0
  26. package/dist/components/MultiSelectSearch/types.d.ts +60 -0
  27. package/dist/components/MultiSelectSearch/utils.d.ts +8 -0
  28. package/dist/components/MultiSelectSearch/utils.js +19 -0
  29. package/dist/components/OtpInput/OtpInput.js +1 -1
  30. package/dist/components/SelectSearch/SelectSearch.js +172 -3017
  31. package/dist/components/SelectSearch/utils.d.ts +5 -0
  32. package/dist/components/SelectSearch/utils.js +17 -0
  33. package/dist/components/Switcher/Switcher.js +48 -48
  34. package/dist/components/TabTrail/TabTrail.js +171 -171
  35. package/dist/components/TextArea/TextArea.js +1 -1
  36. package/dist/components/index.js +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/open-closed-CdldUPoq.js +86 -0
  39. package/dist/use-resolve-button-type-DhFdPxnv.js +12 -0
  40. package/package.json +3 -2
  41. package/dist/open-closed-Cy6VDfYc.js +0 -93
  42. package/dist/use-resolve-button-type-BAxjHhds.js +0 -19
@@ -1,239 +1,239 @@
1
- import { jsxs as K, jsx as A } from "react/jsx-runtime";
2
- import { c as _e } from "../../index-DIxK0V-G.js";
3
- import * as C from "react";
4
- import M, { useRef as G, useState as se, createContext as le, useReducer as we, useMemo as N, useId as oe, useContext as ie, forwardRef as ke, useEffect as ne } from "react";
5
- import { ETabTrailSize as Ee } from "./constants.js";
6
- import { TabButtons as ye } from "./TabButtons/TabButtons.js";
1
+ import { jsxs as Y, jsx as k } from "react/jsx-runtime";
2
+ import { c as ye } from "../../index-DIxK0V-G.js";
3
+ import * as R from "react";
4
+ import N, { useRef as U, useState as Q, createContext as oe, useReducer as ke, useMemo as A, useId as ue, useContext as ie, forwardRef as Ee, useEffect as le } from "react";
5
+ import { ETabTrailSize as Ae } from "./constants.js";
6
+ import { TabButtons as Se } from "./TabButtons/TabButtons.js";
7
7
  import { NotificationBadge as Fe } from "../NotificationBadge/NotificationBadge.js";
8
- import { n as q, M as ae, W as z, s as j, y as V, o as S, H as W, $ as ue, b as Ae, D as ce, a as U, u as Se, c as h, t as Ne } from "../../keyboard-B0lm_zyn.js";
9
- import { w as Re } from "../../use-active-press-86hajhdd.js";
10
- import { T as De } from "../../use-resolve-button-type-BAxjHhds.js";
11
- import { T as de, s as Me } from "../../hidden-DbgtYPOH.js";
12
- import { _ as B, T as J, P as D, F as T } from "../../focus-management-XwV-9qkO.js";
13
- import '../../assets/TabTrail.css';function Ce() {
14
- let e = G(!1);
15
- return q(() => (e.current = !0, () => {
8
+ import { n as W, M as se, W as q, s as H, y as z, o as E, H as V, $ as ce, b as De, D as de, a as B, u as Ne, c as h, t as Re } from "../../keyboard-B0lm_zyn.js";
9
+ import { w as Me } from "../../use-active-press-86hajhdd.js";
10
+ import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
11
+ import { T as pe, s as Le } from "../../hidden-DbgtYPOH.js";
12
+ import { _ as G, T as J, P as D, F as T } from "../../focus-management-XwV-9qkO.js";
13
+ import '../../assets/TabTrail.css';function Oe() {
14
+ let e = U(!1);
15
+ return W(() => (e.current = !0, () => {
16
16
  e.current = !1;
17
17
  }), []), e;
18
18
  }
19
- function Le({ onFocus: e }) {
20
- let [t, n] = se(!0), r = Ce();
21
- return t ? M.createElement(de, { as: "button", type: "button", features: Me.Focusable, onFocus: (s) => {
22
- s.preventDefault();
23
- let l, o = 50;
24
- function i() {
19
+ function Ge({ onFocus: e }) {
20
+ let [t, n] = Q(!0), r = Oe();
21
+ return t ? N.createElement(pe, { as: "button", type: "button", features: Le.Focusable, onFocus: (l) => {
22
+ l.preventDefault();
23
+ let s, o = 50;
24
+ function u() {
25
25
  if (o-- <= 0) {
26
- l && cancelAnimationFrame(l);
26
+ s && cancelAnimationFrame(s);
27
27
  return;
28
28
  }
29
29
  if (e()) {
30
- if (cancelAnimationFrame(l), !r.current) return;
30
+ if (cancelAnimationFrame(s), !r.current) return;
31
31
  n(!1);
32
32
  return;
33
33
  }
34
- l = requestAnimationFrame(i);
34
+ s = requestAnimationFrame(u);
35
35
  }
36
- l = requestAnimationFrame(i);
36
+ s = requestAnimationFrame(u);
37
37
  } }) : null;
38
38
  }
39
- const fe = C.createContext(null);
40
- function Oe() {
39
+ const fe = R.createContext(null);
40
+ function Be() {
41
41
  return { groups: /* @__PURE__ */ new Map(), get(e, t) {
42
42
  var n;
43
43
  let r = this.groups.get(e);
44
44
  r || (r = /* @__PURE__ */ new Map(), this.groups.set(e, r));
45
- let s = (n = r.get(t)) != null ? n : 0;
46
- r.set(t, s + 1);
47
- let l = Array.from(r.keys()).indexOf(t);
45
+ let l = (n = r.get(t)) != null ? n : 0;
46
+ r.set(t, l + 1);
47
+ let s = Array.from(r.keys()).indexOf(t);
48
48
  function o() {
49
- let i = r.get(t);
50
- i > 1 ? r.set(t, i - 1) : r.delete(t);
49
+ let u = r.get(t);
50
+ u > 1 ? r.set(t, u - 1) : r.delete(t);
51
51
  }
52
- return [l, o];
52
+ return [s, o];
53
53
  } };
54
54
  }
55
- function Be({ children: e }) {
56
- let t = C.useRef(Oe());
57
- return C.createElement(fe.Provider, { value: t }, e);
55
+ function Ue({ children: e }) {
56
+ let t = R.useRef(Be());
57
+ return R.createElement(fe.Provider, { value: t }, e);
58
58
  }
59
- function pe(e) {
60
- let t = C.useContext(fe);
59
+ function be(e) {
60
+ let t = R.useContext(fe);
61
61
  if (!t) throw new Error("You must wrap your component in a <StableCollection>");
62
- let n = C.useId(), [r, s] = t.current.get(e, n);
63
- return C.useEffect(() => s, []), r;
62
+ let n = R.useId(), [r, l] = t.current.get(e, n);
63
+ return R.useEffect(() => l, []), r;
64
64
  }
65
- var Ue = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ue || {}), Ge = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(Ge || {}), 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 || {});
66
- let ze = { 0(e, t) {
65
+ var We = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(We || {}), qe = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(qe || {}), ze = ((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))(ze || {});
66
+ let Ve = { 0(e, t) {
67
67
  var n;
68
- let r = B(e.tabs, (c) => c.current), s = B(e.panels, (c) => c.current), l = r.filter((c) => {
69
- var b;
70
- return !((b = c.current) != null && b.hasAttribute("disabled"));
71
- }), o = { ...e, tabs: r, panels: s };
68
+ let r = G(e.tabs, (c) => c.current), l = G(e.panels, (c) => c.current), s = r.filter((c) => {
69
+ var m;
70
+ return !((m = c.current) != null && m.hasAttribute("disabled"));
71
+ }), o = { ...e, tabs: r, panels: l };
72
72
  if (t.index < 0 || t.index > r.length - 1) {
73
- let c = U(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => U(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
74
- if (l.length === 0) return o;
75
- let b = U(c, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
76
- return { ...o, selectedIndex: b === -1 ? e.selectedIndex : b };
73
+ let c = B(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => B(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
74
+ if (s.length === 0) return o;
75
+ let m = B(c, { 0: () => r.indexOf(s[0]), 1: () => r.indexOf(s[s.length - 1]) });
76
+ return { ...o, selectedIndex: m === -1 ? e.selectedIndex : m };
77
77
  }
78
- let i = r.slice(0, t.index), m = [...r.slice(t.index), ...i].find((c) => l.includes(c));
79
- if (!m) return o;
80
- let p = (n = r.indexOf(m)) != null ? n : e.selectedIndex;
81
- return p === -1 && (p = e.selectedIndex), { ...o, selectedIndex: p };
78
+ let u = r.slice(0, t.index), x = [...r.slice(t.index), ...u].find((c) => s.includes(c));
79
+ if (!x) return o;
80
+ let f = (n = r.indexOf(x)) != null ? n : e.selectedIndex;
81
+ return f === -1 && (f = e.selectedIndex), { ...o, selectedIndex: f };
82
82
  }, 1(e, t) {
83
83
  if (e.tabs.includes(t.tab)) return e;
84
- let n = e.tabs[e.selectedIndex], r = B([...e.tabs, t.tab], (l) => l.current), s = e.selectedIndex;
85
- return e.info.current.isControlled || (s = r.indexOf(n), s === -1 && (s = e.selectedIndex)), { ...e, tabs: r, selectedIndex: s };
84
+ let n = e.tabs[e.selectedIndex], r = G([...e.tabs, t.tab], (s) => s.current), l = e.selectedIndex;
85
+ return e.info.current.isControlled || (l = r.indexOf(n), l === -1 && (l = e.selectedIndex)), { ...e, tabs: r, selectedIndex: l };
86
86
  }, 2(e, t) {
87
87
  return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
88
88
  }, 3(e, t) {
89
- return e.panels.includes(t.panel) ? e : { ...e, panels: B([...e.panels, t.panel], (n) => n.current) };
89
+ return e.panels.includes(t.panel) ? e : { ...e, panels: G([...e.panels, t.panel], (n) => n.current) };
90
90
  }, 4(e, t) {
91
91
  return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
92
- } }, Q = le(null);
93
- Q.displayName = "TabsDataContext";
94
- function L(e) {
95
- let t = ie(Q);
92
+ } }, X = oe(null);
93
+ X.displayName = "TabsDataContext";
94
+ function M(e) {
95
+ let t = ie(X);
96
96
  if (t === null) {
97
97
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
98
- throw Error.captureStackTrace && Error.captureStackTrace(n, L), n;
98
+ throw Error.captureStackTrace && Error.captureStackTrace(n, M), n;
99
99
  }
100
100
  return t;
101
101
  }
102
- let X = le(null);
103
- X.displayName = "TabsActionsContext";
104
- function Z(e) {
105
- let t = ie(X);
102
+ let Z = oe(null);
103
+ Z.displayName = "TabsActionsContext";
104
+ function ee(e) {
105
+ let t = ie(Z);
106
106
  if (t === null) {
107
107
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
108
- throw Error.captureStackTrace && Error.captureStackTrace(n, Z), n;
108
+ throw Error.captureStackTrace && Error.captureStackTrace(n, ee), n;
109
109
  }
110
110
  return t;
111
111
  }
112
- function Ve(e, t) {
113
- return U(t.type, ze, e, t);
112
+ function je(e, t) {
113
+ return B(t.type, Ve, e, t);
114
114
  }
115
- let We = "div";
116
- function He(e, t) {
117
- let { defaultIndex: n = 0, vertical: r = !1, manual: s = !1, onChange: l, selectedIndex: o = null, ...i } = e;
118
- const m = r ? "vertical" : "horizontal", p = s ? "manual" : "auto";
119
- let c = o !== null, b = j({ isControlled: c }), _ = V(t), [a, u] = we(Ve, { info: b, selectedIndex: o ?? n, tabs: [], panels: [] }), w = N(() => ({ selectedIndex: a.selectedIndex }), [a.selectedIndex]), x = j(l || (() => {
120
- })), k = j(a.tabs), g = N(() => ({ orientation: m, activation: p, ...a }), [m, p, a]), v = S((f) => (u({ type: 1, tab: f }), () => u({ type: 2, tab: f }))), E = S((f) => (u({ type: 3, panel: f }), () => u({ type: 4, panel: f }))), y = S((f) => {
121
- F.current !== f && x.current(f), c || u({ type: 0, index: f });
122
- }), F = j(c ? e.selectedIndex : a.selectedIndex), O = N(() => ({ registerTab: v, registerPanel: E, change: y }), []);
123
- q(() => {
124
- u({ type: 0, index: o ?? n });
125
- }, [o]), q(() => {
126
- if (F.current === void 0 || a.tabs.length <= 0) return;
127
- let f = B(a.tabs, (P) => P.current);
128
- f.some((P, R) => a.tabs[R] !== P) && y(f.indexOf(a.tabs[F.current]));
115
+ let He = "div";
116
+ function Je(e, t) {
117
+ let { defaultIndex: n = 0, vertical: r = !1, manual: l = !1, onChange: s, selectedIndex: o = null, ...u } = e;
118
+ const x = r ? "vertical" : "horizontal", f = l ? "manual" : "auto";
119
+ let c = o !== null, m = H({ isControlled: c }), _ = z(t), [a, i] = ke(je, { info: m, selectedIndex: o ?? n, tabs: [], panels: [] }), $ = A(() => ({ selectedIndex: a.selectedIndex }), [a.selectedIndex]), C = H(s || (() => {
120
+ })), w = H(a.tabs), b = A(() => ({ orientation: x, activation: f, ...a }), [x, f, a]), S = E((p) => (i({ type: 1, tab: p }), () => i({ type: 2, tab: p }))), L = E((p) => (i({ type: 3, panel: p }), () => i({ type: 4, panel: p }))), v = E((p) => {
121
+ g.current !== p && C.current(p), c || i({ type: 0, index: p });
122
+ }), g = H(c ? e.selectedIndex : a.selectedIndex), O = A(() => ({ registerTab: S, registerPanel: L, change: v }), []);
123
+ W(() => {
124
+ i({ type: 0, index: o ?? n });
125
+ }, [o]), W(() => {
126
+ if (g.current === void 0 || a.tabs.length <= 0) return;
127
+ let p = G(a.tabs, (y) => y.current);
128
+ p.some((y, F) => a.tabs[F] !== y) && v(p.indexOf(a.tabs[g.current]));
129
129
  });
130
- let Y = { ref: _ };
131
- return M.createElement(Be, null, M.createElement(X.Provider, { value: O }, M.createElement(Q.Provider, { value: g }, g.tabs.length <= 0 && M.createElement(Le, { onFocus: () => {
132
- var f, P;
133
- for (let R of k.current) if (((f = R.current) == null ? void 0 : f.tabIndex) === 0) return (P = R.current) == null || P.focus(), !0;
130
+ let K = { ref: _ };
131
+ return N.createElement(Ue, null, N.createElement(Z.Provider, { value: O }, N.createElement(X.Provider, { value: b }, b.tabs.length <= 0 && N.createElement(Ge, { onFocus: () => {
132
+ var p, y;
133
+ for (let F of w.current) if (((p = F.current) == null ? void 0 : p.tabIndex) === 0) return (y = F.current) == null || y.focus(), !0;
134
134
  return !1;
135
- } }), W({ ourProps: Y, theirProps: i, slot: w, defaultTag: We, name: "Tabs" }))));
135
+ } }), V({ ourProps: K, theirProps: u, slot: $, defaultTag: He, name: "Tabs" }))));
136
136
  }
137
- let je = "div";
138
- function Je(e, t) {
139
- let { orientation: n, selectedIndex: r } = L("Tab.List"), s = V(t), l = N(() => ({ selectedIndex: r }), [r]);
140
- return W({ ourProps: { ref: s, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: je, name: "Tabs.List" });
137
+ let Ke = "div";
138
+ function Ye(e, t) {
139
+ let { orientation: n, selectedIndex: r } = M("Tab.List"), l = z(t), s = A(() => ({ selectedIndex: r }), [r]);
140
+ return V({ ourProps: { ref: l, role: "tablist", "aria-orientation": n }, theirProps: e, slot: s, defaultTag: Ke, name: "Tabs.List" });
141
141
  }
142
- let Ye = "button";
143
- function Ke(e, t) {
142
+ let Qe = "button";
143
+ function Xe(e, t) {
144
144
  var n, r;
145
- let s = oe(), { id: l = `headlessui-tabs-tab-${s}`, disabled: o = !1, autoFocus: i = !1, ...m } = e, { orientation: p, activation: c, selectedIndex: b, tabs: _, panels: a } = L("Tab"), u = Z("Tab"), w = L("Tab"), x = G(null), k = V(x, t);
146
- q(() => u.registerTab(x), [u, x]);
147
- let g = pe("tabs"), v = _.indexOf(x);
148
- v === -1 && (v = g);
149
- let E = v === b, y = S((d) => {
150
- var $;
151
- let H = d();
152
- if (H === J.Success && c === "auto") {
153
- let Pe = ($ = Se(x)) == null ? void 0 : $.activeElement, re = w.tabs.findIndex(($e) => $e.current === Pe);
154
- re !== -1 && u.change(re);
145
+ let l = ue(), { id: s = `headlessui-tabs-tab-${l}`, disabled: o = !1, autoFocus: u = !1, ...x } = e, { orientation: f, activation: c, selectedIndex: m, tabs: _, panels: a } = M("Tab"), i = ee("Tab"), $ = M("Tab"), [C, w] = Q(null), b = U(null), S = z(b, t, w);
146
+ W(() => i.registerTab(b), [i, b]);
147
+ let L = be("tabs"), v = _.indexOf(b);
148
+ v === -1 && (v = L);
149
+ let g = v === m, O = E((d) => {
150
+ var P;
151
+ let j = d();
152
+ if (j === J.Success && c === "auto") {
153
+ let $e = (P = Ne(b)) == null ? void 0 : P.activeElement, ae = $.tabs.findIndex((we) => we.current === $e);
154
+ ae !== -1 && i.change(ae);
155
155
  }
156
- return H;
157
- }), F = S((d) => {
158
- let $ = _.map((H) => H.current).filter(Boolean);
156
+ return j;
157
+ }), K = E((d) => {
158
+ let P = _.map((j) => j.current).filter(Boolean);
159
159
  if (d.key === h.Space || d.key === h.Enter) {
160
- d.preventDefault(), d.stopPropagation(), u.change(v);
160
+ d.preventDefault(), d.stopPropagation(), i.change(v);
161
161
  return;
162
162
  }
163
163
  switch (d.key) {
164
164
  case h.Home:
165
165
  case h.PageUp:
166
- return d.preventDefault(), d.stopPropagation(), y(() => D($, T.First));
166
+ return d.preventDefault(), d.stopPropagation(), O(() => D(P, T.First));
167
167
  case h.End:
168
168
  case h.PageDown:
169
- return d.preventDefault(), d.stopPropagation(), y(() => D($, T.Last));
169
+ return d.preventDefault(), d.stopPropagation(), O(() => D(P, T.Last));
170
170
  }
171
- if (y(() => U(p, { vertical() {
172
- return d.key === h.ArrowUp ? D($, T.Previous | T.WrapAround) : d.key === h.ArrowDown ? D($, T.Next | T.WrapAround) : J.Error;
171
+ if (O(() => B(f, { vertical() {
172
+ return d.key === h.ArrowUp ? D(P, T.Previous | T.WrapAround) : d.key === h.ArrowDown ? D(P, T.Next | T.WrapAround) : J.Error;
173
173
  }, horizontal() {
174
- return d.key === h.ArrowLeft ? D($, T.Previous | T.WrapAround) : d.key === h.ArrowRight ? D($, T.Next | T.WrapAround) : J.Error;
174
+ return d.key === h.ArrowLeft ? D(P, T.Previous | T.WrapAround) : d.key === h.ArrowRight ? D(P, T.Next | T.WrapAround) : J.Error;
175
175
  } })) === J.Success) return d.preventDefault();
176
- }), O = G(!1), Y = S(() => {
176
+ }), p = U(!1), y = E(() => {
177
177
  var d;
178
- O.current || (O.current = !0, (d = x.current) == null || d.focus({ preventScroll: !0 }), u.change(v), Ne(() => {
179
- O.current = !1;
178
+ p.current || (p.current = !0, (d = b.current) == null || d.focus({ preventScroll: !0 }), i.change(v), Re(() => {
179
+ p.current = !1;
180
180
  }));
181
- }), f = S((d) => {
181
+ }), F = E((d) => {
182
182
  d.preventDefault();
183
- }), { isFocusVisible: P, focusProps: R } = ue({ autoFocus: i }), { isHovered: ee, hoverProps: ge } = Ae({ isDisabled: o }), { pressed: te, pressProps: he } = Re({ disabled: o }), Te = N(() => ({ selected: E, hover: ee, active: te, focus: P, autofocus: i, disabled: o }), [E, ee, P, te, i, o]), Ie = ce({ ref: k, onKeyDown: F, onMouseDown: f, onClick: Y, id: l, role: "tab", type: De(e, x), "aria-controls": (r = (n = a[v]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": E, tabIndex: E ? 0 : -1, disabled: o || void 0, autoFocus: i }, R, ge, he);
184
- return W({ ourProps: Ie, theirProps: m, slot: Te, defaultTag: Ye, name: "Tabs.Tab" });
183
+ }), { isFocusVisible: te, focusProps: he } = ce({ autoFocus: u }), { isHovered: re, hoverProps: Te } = De({ isDisabled: o }), { pressed: ne, pressProps: Ie } = Me({ disabled: o }), Pe = A(() => ({ selected: g, hover: re, active: ne, focus: te, autofocus: u, disabled: o }), [g, re, te, ne, u, o]), _e = de({ ref: S, onKeyDown: K, onMouseDown: F, onClick: y, id: s, role: "tab", type: Ce(e, C), "aria-controls": (r = (n = a[v]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": g, tabIndex: g ? 0 : -1, disabled: o || void 0, autoFocus: u }, he, Te, Ie);
184
+ return V({ ourProps: _e, theirProps: x, slot: Pe, defaultTag: Qe, name: "Tabs.Tab" });
185
185
  }
186
- let Qe = "div";
187
- function Xe(e, t) {
188
- let { selectedIndex: n } = L("Tab.Panels"), r = V(t), s = N(() => ({ selectedIndex: n }), [n]);
189
- return W({ ourProps: { ref: r }, theirProps: e, slot: s, defaultTag: Qe, name: "Tabs.Panels" });
186
+ let Ze = "div";
187
+ function et(e, t) {
188
+ let { selectedIndex: n } = M("Tab.Panels"), r = z(t), l = A(() => ({ selectedIndex: n }), [n]);
189
+ return V({ ourProps: { ref: r }, theirProps: e, slot: l, defaultTag: Ze, name: "Tabs.Panels" });
190
190
  }
191
- let Ze = "div", et = ae.RenderStrategy | ae.Static;
192
- function tt(e, t) {
193
- var n, r, s, l;
194
- let o = oe(), { id: i = `headlessui-tabs-panel-${o}`, tabIndex: m = 0, ...p } = e, { selectedIndex: c, tabs: b, panels: _ } = L("Tab.Panel"), a = Z("Tab.Panel"), u = G(null), w = V(u, t);
195
- q(() => a.registerPanel(u), [a, u]);
196
- let x = pe("panels"), k = _.indexOf(u);
197
- k === -1 && (k = x);
198
- let g = k === c, { isFocusVisible: v, focusProps: E } = ue(), y = N(() => ({ selected: g, focus: v }), [g, v]), F = ce({ ref: w, id: i, role: "tabpanel", "aria-labelledby": (r = (n = b[k]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: g ? m : -1 }, E);
199
- return !g && ((s = p.unmount) == null || s) && !((l = p.static) != null && l) ? M.createElement(de, { "aria-hidden": "true", ...F }) : W({ ourProps: F, theirProps: p, slot: y, defaultTag: Ze, features: et, visible: g, name: "Tabs.Panel" });
191
+ let tt = "div", rt = se.RenderStrategy | se.Static;
192
+ function nt(e, t) {
193
+ var n, r, l, s;
194
+ let o = ue(), { id: u = `headlessui-tabs-panel-${o}`, tabIndex: x = 0, ...f } = e, { selectedIndex: c, tabs: m, panels: _ } = M("Tab.Panel"), a = ee("Tab.Panel"), i = U(null), $ = z(i, t);
195
+ W(() => a.registerPanel(i), [a, i]);
196
+ let C = be("panels"), w = _.indexOf(i);
197
+ w === -1 && (w = C);
198
+ let b = w === c, { isFocusVisible: S, focusProps: L } = ce(), v = A(() => ({ selected: b, focus: S }), [b, S]), g = de({ ref: $, id: u, role: "tabpanel", "aria-labelledby": (r = (n = m[w]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? x : -1 }, L);
199
+ return !b && ((l = f.unmount) == null || l) && !((s = f.static) != null && s) ? N.createElement(pe, { "aria-hidden": "true", ...g }) : V({ ourProps: g, theirProps: f, slot: v, defaultTag: tt, features: rt, visible: b, name: "Tabs.Panel" });
200
200
  }
201
- let rt = z(Ke), be = z(He), me = z(Je), xe = z(Xe), ve = z(tt), nt = Object.assign(rt, { Group: be, List: me, Panels: xe, Panel: ve });
202
- const at = "_container_rlke5_2", st = "_group_rlke5_6", lt = "_tab_rlke5_16", ot = "_list_rlke5_51", it = "_tabs_rlke5_62", ut = "_buttons_rlke5_68", ct = "_m_rlke5_75", dt = "_s_rlke5_83", I = {
203
- container: at,
204
- group: st,
201
+ let at = q(Xe), me = q(Je), xe = q(Ye), ve = q(et), ge = q(nt), lt = Object.assign(at, { Group: me, List: xe, Panels: ve, Panel: ge });
202
+ const st = "_container_rlke5_2", ot = "_group_rlke5_6", ut = "_tab_rlke5_16", it = "_list_rlke5_51", ct = "_tabs_rlke5_62", dt = "_buttons_rlke5_68", pt = "_m_rlke5_75", ft = "_s_rlke5_83", I = {
203
+ container: st,
204
+ group: ot,
205
205
  "group-inner": "_group-inner_rlke5_9",
206
- tab: lt,
207
- list: ot,
208
- tabs: it,
209
- buttons: ut,
210
- m: ct,
211
- s: dt
212
- }, $t = ke(
206
+ tab: ut,
207
+ list: it,
208
+ tabs: ct,
209
+ buttons: dt,
210
+ m: pt,
211
+ s: ft
212
+ }, wt = Ee(
213
213
  ({
214
214
  categories: e,
215
- size: t = Ee.M,
215
+ size: t = Ae.M,
216
216
  showButtons: n = !0,
217
217
  className: r,
218
- selectedTabIndex: s,
219
- onTabChange: l
218
+ selectedTabIndex: l,
219
+ onTabChange: s
220
220
  }, o) => {
221
- const [i, m] = se(s || 0), p = G(null);
222
- ne(() => {
223
- s !== void 0 && s !== i && m(s);
224
- }, [i, s]);
221
+ const [u, x] = Q(l || 0), f = U(null);
222
+ le(() => {
223
+ l !== void 0 && l !== u && x(l);
224
+ }, [u, l]);
225
225
  const c = (a) => {
226
- m(a), l == null || l(a);
227
- }, b = () => {
228
- const a = (i + 1) % e.length;
226
+ x(a), s == null || s(a);
227
+ }, m = () => {
228
+ const a = (u + 1) % e.length;
229
229
  c(a);
230
230
  }, _ = () => {
231
- const a = (i - 1 + e.length) % e.length;
231
+ const a = (u - 1 + e.length) % e.length;
232
232
  c(a);
233
233
  };
234
- return ne(() => {
235
- var u;
236
- const a = (u = p.current) == null ? void 0 : u.querySelector(
234
+ return le(() => {
235
+ var i;
236
+ const a = (i = f.current) == null ? void 0 : i.querySelector(
237
237
  `.${I.tab}[data-active="true"]`
238
238
  );
239
239
  a && typeof a.scrollIntoView == "function" && a.scrollIntoView({
@@ -241,41 +241,41 @@ const at = "_container_rlke5_2", st = "_group_rlke5_6", lt = "_tab_rlke5_16", ot
241
241
  block: "nearest",
242
242
  inline: "center"
243
243
  });
244
- }, [i]), /* @__PURE__ */ K(
245
- be,
244
+ }, [u]), /* @__PURE__ */ Y(
245
+ me,
246
246
  {
247
247
  ref: o,
248
- className: _e(I.group, I[t], r),
249
- selectedIndex: i,
248
+ className: ye(I.group, I[t], r),
249
+ selectedIndex: u,
250
250
  onChange: c,
251
251
  children: [
252
- /* @__PURE__ */ K("div", { className: I["group-inner"], children: [
253
- /* @__PURE__ */ A(me, { ref: p, className: I.list, children: /* @__PURE__ */ A("div", { className: I.tabs, children: e.map(({ name: a, notificationCount: u }, w) => /* @__PURE__ */ K(
254
- nt,
252
+ /* @__PURE__ */ Y("div", { className: I["group-inner"], children: [
253
+ /* @__PURE__ */ k(xe, { ref: f, className: I.list, children: /* @__PURE__ */ k("div", { className: I.tabs, children: e.map(({ name: a, notificationCount: i }, $) => /* @__PURE__ */ Y(
254
+ lt,
255
255
  {
256
- className: `${I.tab} ${i === w ? 'data-active="true"' : ""}`,
257
- "data-active": i === w,
256
+ className: `${I.tab} ${u === $ ? 'data-active="true"' : ""}`,
257
+ "data-active": u === $,
258
258
  children: [
259
259
  a,
260
- u && /* @__PURE__ */ A(Fe, { count: u, size: "m" })
260
+ i && /* @__PURE__ */ k(Fe, { count: i, size: "m" })
261
261
  ]
262
262
  },
263
263
  a
264
264
  )) }) }),
265
- n && /* @__PURE__ */ A("div", { className: I.buttons, children: /* @__PURE__ */ A(
266
- ye,
265
+ n && /* @__PURE__ */ k("div", { className: I.buttons, children: /* @__PURE__ */ k(
266
+ Se,
267
267
  {
268
268
  handlePrevTab: _,
269
- handleNextTab: b
269
+ handleNextTab: m
270
270
  }
271
271
  ) })
272
272
  ] }),
273
- /* @__PURE__ */ A(xe, { className: I.panels, children: e.map(({ name: a, content: u }) => /* @__PURE__ */ A(ve, { className: I.panel, children: u }, a)) })
273
+ /* @__PURE__ */ k(ve, { className: I.panels, children: e.map(({ name: a, content: i }) => /* @__PURE__ */ k(ge, { className: I.panel, children: i }, a)) })
274
274
  ]
275
275
  }
276
276
  );
277
277
  }
278
278
  );
279
279
  export {
280
- $t as TabTrail
280
+ wt as TabTrail
281
281
  };
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea as Y } from "./hooks.js";
5
5
  import { useMergeRefs as Z } from "../../hooks/useMergeRefs/useMergeRefs.js";
6
6
  import { Icon as $ } from "../../icons/Icon.js";
7
7
  import { Button as ee } from "../Button/Button.js";
8
- import { c as e } from "../../Input-B-gKQ9FT.js";
8
+ import { c as e } from "../../Input-DlGNMuUD.js";
9
9
  import { EInputVariant as ae } from "../Input/constants.js";
10
10
  import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_1n8kz_22", re = "_s_1n8kz_54", le = "_m_1n8kz_62", ne = "_l_1n8kz_22", a = {
11
11
  "textarea-wrapper": "_textarea-wrapper_1n8kz_2",
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "./Button/Button.js";
2
2
  import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as m, EButtonVariantDefault as i, EButtonVariantOutline as f, EButtonVariantRound as x } from "./Button/constants.js";
3
- import { I as E } from "../Input-B-gKQ9FT.js";
3
+ import { I as E } from "../Input-DlGNMuUD.js";
4
4
  import { EInputSize as u, EInputStatus as s, EInputVariant as l } from "./Input/constants.js";
5
5
  import { TextArea as c } from "./TextArea/TextArea.js";
6
6
  import { InputPassword as I } from "./InputPassword/InputPassword.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "./components/Button/Button.js";
2
2
  import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as m, EButtonVariantDefault as f, EButtonVariantOutline as i, EButtonVariantRound as x } from "./components/Button/constants.js";
3
- import { I as u } from "./Input-B-gKQ9FT.js";
3
+ import { I as u } from "./Input-DlGNMuUD.js";
4
4
  import { EInputSize as E, EInputStatus as S, EInputVariant as d } from "./components/Input/constants.js";
5
5
  import { TextArea as c } from "./components/TextArea/TextArea.js";
6
6
  import { InputPassword as I } from "./components/InputPassword/InputPassword.js";
@@ -0,0 +1,86 @@
1
+ import h, { useState as F, useCallback as c, useRef as m, createContext as A, useContext as E } from "react";
2
+ import { p as x, n as O, d as y } from "./keyboard-B0lm_zyn.js";
3
+ function k(e = 0) {
4
+ let [t, n] = F(e), l = c((o) => n(o), [t]), s = c((o) => n((u) => u | o), [t]), r = c((o) => (t & o) === o, [t]), a = c((o) => n((u) => u & ~o), [n]), i = c((o) => n((u) => u ^ o), [n]);
5
+ return { flags: t, setFlag: l, addFlag: s, hasFlag: r, removeFlag: a, toggleFlag: i };
6
+ }
7
+ var v;
8
+ typeof process < "u" && typeof globalThis < "u" && ((v = process == null ? void 0 : process.env) == null ? void 0 : v.NODE_ENV) === "test" && typeof Element.prototype.getAnimations > "u" && (Element.prototype.getAnimations = function() {
9
+ return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
10
+ `)), [];
11
+ });
12
+ var N = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(N || {});
13
+ function L(e) {
14
+ let t = {};
15
+ for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
16
+ return t;
17
+ }
18
+ function R(e, t, n, l) {
19
+ let [s, r] = F(n), { hasFlag: a, addFlag: i, removeFlag: o } = k(e && s ? 3 : 0), u = m(!1), d = m(!1), C = x();
20
+ return O(() => {
21
+ var f;
22
+ if (e) {
23
+ if (n && r(!0), !t) {
24
+ n && i(3);
25
+ return;
26
+ }
27
+ return (f = void 0) == null || f.call(l, n), $(t, { inFlight: u, prepare() {
28
+ d.current ? d.current = !1 : d.current = u.current, u.current = !0, !d.current && (n ? (i(3), o(4)) : (i(4), o(2)));
29
+ }, run() {
30
+ d.current ? n ? (o(3), i(4)) : (o(4), i(3)) : n ? o(1) : i(1);
31
+ }, done() {
32
+ var g;
33
+ d.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), n || r(!1), (g = void 0) == null || g.call(l, n));
34
+ } });
35
+ }
36
+ }, [e, n, t, C]), e ? [s, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
37
+ }
38
+ function $(e, { prepare: t, run: n, done: l, inFlight: s }) {
39
+ let r = y();
40
+ return P(e, { prepare: t, inFlight: s }), r.nextFrame(() => {
41
+ n(), r.requestAnimationFrame(() => {
42
+ r.add(j(e, l));
43
+ });
44
+ }), r.dispose;
45
+ }
46
+ function j(e, t) {
47
+ var n, l;
48
+ let s = y();
49
+ if (!e) return s.dispose;
50
+ let r = !1;
51
+ s.add(() => {
52
+ r = !0;
53
+ });
54
+ let a = (l = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((i) => i instanceof CSSTransition)) != null ? l : [];
55
+ return a.length === 0 ? (t(), s.dispose) : (Promise.allSettled(a.map((i) => i.finished)).then(() => {
56
+ r || t();
57
+ }), s.dispose);
58
+ }
59
+ function P(e, { inFlight: t, prepare: n }) {
60
+ if (t != null && t.current) {
61
+ n();
62
+ return;
63
+ }
64
+ let l = e.style.transition;
65
+ e.style.transition = "none", n(), e.offsetHeight, e.style.transition = l;
66
+ }
67
+ let p = A(null);
68
+ p.displayName = "OpenClosedContext";
69
+ var S = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(S || {});
70
+ function T() {
71
+ return E(p);
72
+ }
73
+ function _({ value: e, children: t }) {
74
+ return h.createElement(p.Provider, { value: e }, t);
75
+ }
76
+ function w({ children: e }) {
77
+ return h.createElement(p.Provider, { value: null }, e);
78
+ }
79
+ export {
80
+ L as H,
81
+ R,
82
+ _ as c,
83
+ S as i,
84
+ w as s,
85
+ T as u
86
+ };
@@ -0,0 +1,12 @@
1
+ import { useMemo as o } from "react";
2
+ function a(t, e) {
3
+ return o(() => {
4
+ var r;
5
+ if (t.type) return t.type;
6
+ let n = (r = t.as) != null ? r : "button";
7
+ if (typeof n == "string" && n.toLowerCase() === "button" || (e == null ? void 0 : e.tagName) === "BUTTON" && !e.hasAttribute("type")) return "button";
8
+ }, [t.type, t.as, e]);
9
+ }
10
+ export {
11
+ a as e
12
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.35.4",
4
+ "version": "1.36.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -51,7 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@chromatic-com/storybook": "^1.6.1",
54
- "@headlessui/react": "^2.1.2",
54
+ "@headlessui/react": "^2.1.8",
55
+ "@laynezh/vite-plugin-lib-assets": "^0.5.23",
55
56
  "@loadable/component": "^5.15.2",
56
57
  "@storybook/addon-essentials": "^8.2.2",
57
58
  "@storybook/addon-interactions": "^8.2.2",