mimir-ui-kit 1.42.1 → 1.43.0

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 (89) hide show
  1. package/dist/ProgressBar-COdzy3fY.js +67 -0
  2. package/dist/assets/CardTrail.css +1 -1
  3. package/dist/assets/MultiSelectSearch.css +1 -1
  4. package/dist/assets/Pagination.css +1 -1
  5. package/dist/assets/SelectSearch.css +1 -1
  6. package/dist/assets/Switcher.css +1 -1
  7. package/dist/assets/TabTrail.css +1 -1
  8. package/dist/assets/hooks.css +1 -0
  9. package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
  10. package/dist/components/Accordion/Accordion.d.ts +6 -0
  11. package/dist/components/Accordion/Accordion.js +202 -182
  12. package/dist/components/AnchorLink/Link.d.ts +2 -0
  13. package/dist/components/AnchorLink/Link.js +54 -42
  14. package/dist/components/CardTrail/CardTrail.js +47 -46
  15. package/dist/components/CardTrail/utils.d.ts +0 -1
  16. package/dist/components/CardTrail/utils.js +7 -8
  17. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  18. package/dist/components/DatePicker/DatePicker.d.ts +32 -0
  19. package/dist/components/DatePicker/DatePicker.js +125 -111
  20. package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
  21. package/dist/components/DatePicker/DatePickerModal.js +97 -75
  22. package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
  23. package/dist/components/DatePicker/MonthPickerModal.js +96 -58
  24. package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
  25. package/dist/components/DatePicker/YearPickerModal.js +75 -57
  26. package/dist/components/Drawer/Drawer.d.ts +7 -1
  27. package/dist/components/Drawer/Drawer.js +122 -106
  28. package/dist/components/Drawer/hooks.d.ts +9 -0
  29. package/dist/components/Drawer/hooks.js +24 -0
  30. package/dist/components/Dropdown/Dropdown.d.ts +18 -1
  31. package/dist/components/Dropdown/Dropdown.js +361 -343
  32. package/dist/components/Dropdown/constants.d.ts +11 -0
  33. package/dist/components/Dropdown/constants.js +5 -0
  34. package/dist/components/Dropdown/hooks.d.ts +19 -0
  35. package/dist/components/Dropdown/hooks.js +11 -0
  36. package/dist/components/Dropdown/index.d.ts +1 -0
  37. package/dist/components/Dropdown/index.js +5 -2
  38. package/dist/components/Image/Image.d.ts +16 -0
  39. package/dist/components/Image/Image.js +65 -37
  40. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
  41. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
  42. package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
  43. package/dist/components/MultiSelectSearch/constants.js +7 -5
  44. package/dist/components/MultiSelectSearch/index.d.ts +1 -1
  45. package/dist/components/MultiSelectSearch/index.js +5 -4
  46. package/dist/components/MultiSelectSearch/types.d.ts +33 -1
  47. package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
  48. package/dist/components/MultiSelectSearch/utils.js +31 -17
  49. package/dist/components/Pagination/Pagination.d.ts +23 -0
  50. package/dist/components/Pagination/Pagination.js +137 -99
  51. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  52. package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
  53. package/dist/components/SelectSearch/SelectSearch.js +381 -220
  54. package/dist/components/SelectSearch/constants.d.ts +6 -0
  55. package/dist/components/SelectSearch/constants.js +3 -2
  56. package/dist/components/SelectSearch/index.d.ts +1 -1
  57. package/dist/components/SelectSearch/index.js +5 -4
  58. package/dist/components/SelectSearch/types.d.ts +32 -1
  59. package/dist/components/SelectSearch/utils.d.ts +2 -0
  60. package/dist/components/SelectSearch/utils.js +28 -14
  61. package/dist/components/Switcher/Switcher.js +66 -59
  62. package/dist/components/Switcher/types.d.ts +1 -0
  63. package/dist/components/TabTrail/TabTrail.d.ts +9 -0
  64. package/dist/components/TabTrail/TabTrail.js +198 -190
  65. package/dist/components/Toasts/ProgressBar.d.ts +4 -2
  66. package/dist/components/Toasts/ProgressBar.js +1 -1
  67. package/dist/components/Toasts/Toast.d.ts +5 -1
  68. package/dist/components/Toasts/Toast.js +59 -44
  69. package/dist/components/Toasts/ToastList.js +1 -1
  70. package/dist/components/Toasts/ToastsProvider.js +1 -1
  71. package/dist/components/index.d.ts +3 -2
  72. package/dist/components/index.js +154 -149
  73. package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
  74. package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
  75. package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
  76. package/dist/hooks/useTimer/index.d.ts +2 -1
  77. package/dist/hooks/useTimer/index.js +55 -41
  78. package/dist/hooks-HgN6Yauq.js +117 -0
  79. package/dist/index.js +182 -177
  80. package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
  81. package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
  82. package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
  83. package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
  84. package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
  85. package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
  86. package/package.json +3 -1
  87. package/dist/ProgressBar-DEFs1tWq.js +0 -55
  88. package/dist/assets/Dropdown.css +0 -1
  89. package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,24 +1,24 @@
1
- import { jsxs as A, Fragment as H, jsx as I } from "react/jsx-runtime";
2
- import { c as v } from "../../index-DIxK0V-G.js";
3
- import x, { createContext as K, useRef as oe, Fragment as re, useReducer as pe, useMemo as O, useId as se, useEffect as le, useState as ae, useContext as U, forwardRef as me } from "react";
4
- import { AccordionItem as fe } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionButtonType as P, EAccordionSize as B, EAccordionLinkIconSize as J, EAccordionButtonStyle as _e, EAccordionIconType as Y, EAccordionButtonIconSize as Z } from "./constants.js";
6
- import { useMediaQuery as ye } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
- import { EMediaQuery as Ee } from "../../hooks/useMediaQuery/constants.js";
8
- import { Icon as Se } from "../../icons/Icon.js";
9
- import { Link as ke } from "../AnchorLink/Link.js";
10
- import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-CUMsrFX1.js";
11
- import { w as he } from "../../use-active-press-BVQqDQ3V.js";
12
- import { e as ve } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { c as $e, i as R, u as ge, R as Pe, H as Te, s as we } from "../../open-closed-CkTbpRyi.js";
14
- import { C as Ne } from "../../close-provider-CEutdhG8.js";
15
- import { r as Ce } from "../../bugs-diTMAGNw.js";
16
- import '../../assets/Accordion.css';var ne;
17
- let Ae = (ne = x.startTransition) != null ? ne : function(e) {
1
+ import { jsxs as C, Fragment as U, jsx as b } from "react/jsx-runtime";
2
+ import { c as T } from "../../index-DIxK0V-G.js";
3
+ import v, { createContext as q, useRef as le, Fragment as se, useReducer as ye, useMemo as M, useId as ae, useEffect as j, useState as ce, useContext as W, forwardRef as Se } from "react";
4
+ import { AccordionItem as Ie } from "./AccordionItem/AccordionItem.js";
5
+ import { EAccordionButtonType as w, EAccordionSize as R, EAccordionLinkIconSize as Z, EAccordionButtonStyle as ke, EAccordionIconType as ee, EAccordionButtonIconSize as te } from "./constants.js";
6
+ import { useMediaQuery as be } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
+ import { EMediaQuery as xe } from "../../hooks/useMediaQuery/constants.js";
8
+ import { Icon as De } from "../../icons/Icon.js";
9
+ import { Link as $e } from "../AnchorLink/Link.js";
10
+ import { M as ne, W as Q, y as V, T as ve, o as g, a as z, H as K, I as ie, $ as Pe, b as he, D as oe, u as Te, c as B } from "../../keyboard-wis2TUql.js";
11
+ import { w as ge } from "../../use-active-press-CnDeVvQq.js";
12
+ import { e as we } from "../../use-resolve-button-type-DhFdPxnv.js";
13
+ import { c as Be, i as L, u as Ne, R as Oe, H as Ae, s as Ce } from "../../open-closed-CJijMeI2.js";
14
+ import { C as Re } from "../../close-provider-CEutdhG8.js";
15
+ import { r as Me } from "../../bugs-diTMAGNw.js";
16
+ import '../../assets/Accordion.css';var re;
17
+ let Le = (re = v.startTransition) != null ? re : function(e) {
18
18
  e();
19
19
  };
20
- var Be = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Be || {}), Oe = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.SetButtonElement = 4] = "SetButtonElement", e[e.SetPanelElement = 5] = "SetPanelElement", e))(Oe || {});
21
- let Re = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
20
+ var Fe = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Fe || {}), He = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.SetButtonElement = 4] = "SetButtonElement", e[e.SetPanelElement = 5] = "SetPanelElement", e))(He || {});
21
+ let Ue = { 0: (e) => ({ ...e, disclosureState: z(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
22
22
  return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
23
23
  }, 3(e, t) {
24
24
  return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
@@ -26,181 +26,193 @@ let Re = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0
26
26
  return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
27
27
  }, 5(e, t) {
28
28
  return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
29
- } }, V = K(null);
30
- V.displayName = "DisclosureContext";
31
- function z(e) {
32
- let t = U(V);
29
+ } }, X = q(null);
30
+ X.displayName = "DisclosureContext";
31
+ function G(e) {
32
+ let t = W(X);
33
33
  if (t === null) {
34
- let u = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
35
- throw Error.captureStackTrace && Error.captureStackTrace(u, z), u;
34
+ let i = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
35
+ throw Error.captureStackTrace && Error.captureStackTrace(i, G), i;
36
36
  }
37
37
  return t;
38
38
  }
39
- let X = K(null);
40
- X.displayName = "DisclosureAPIContext";
41
- function ie(e) {
42
- let t = U(X);
39
+ let J = q(null);
40
+ J.displayName = "DisclosureAPIContext";
41
+ function ue(e) {
42
+ let t = W(J);
43
43
  if (t === null) {
44
- let u = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
45
- throw Error.captureStackTrace && Error.captureStackTrace(u, ie), u;
44
+ let i = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
45
+ throw Error.captureStackTrace && Error.captureStackTrace(i, ue), i;
46
46
  }
47
47
  return t;
48
48
  }
49
- let G = K(null);
50
- G.displayName = "DisclosurePanelContext";
51
- function Me() {
52
- return U(G);
49
+ let Y = q(null);
50
+ Y.displayName = "DisclosurePanelContext";
51
+ function qe() {
52
+ return W(Y);
53
53
  }
54
- function Fe(e, t) {
55
- return W(t.type, Re, e, t);
54
+ function je(e, t) {
55
+ return z(t.type, Ue, e, t);
56
56
  }
57
- let Le = re;
58
- function He(e, t) {
59
- let { defaultOpen: u = !1, ...p } = e, l = oe(null), m = j(t, Ie((c) => {
60
- l.current = c;
61
- }, e.as === void 0 || e.as === re)), a = pe(Fe, { disclosureState: u ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: r }, y] = a, s = $((c) => {
57
+ let We = se;
58
+ function Qe(e, t) {
59
+ let { defaultOpen: i = !1, ...d } = e, s = le(null), m = V(t, ve((c) => {
60
+ s.current = c;
61
+ }, e.as === void 0 || e.as === se)), a = ye(je, { disclosureState: i ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: r }, y] = a, l = g((c) => {
62
62
  y({ type: 1 });
63
- let f = De(l);
63
+ let f = Te(s);
64
64
  if (!f || !r) return;
65
- let _ = c ? c instanceof HTMLElement ? c : c.current instanceof HTMLElement ? c.current : f.getElementById(r) : f.getElementById(r);
66
- _ == null || _.focus();
67
- }), b = O(() => ({ close: s }), [s]), E = O(() => ({ open: n === 0, close: s }), [n, s]), S = { ref: m };
68
- return x.createElement(V.Provider, { value: a }, x.createElement(X.Provider, { value: b }, x.createElement(Ne, { value: s }, x.createElement($e, { value: W(n, { 0: R.Open, 1: R.Closed }) }, Q({ ourProps: S, theirProps: p, slot: E, defaultTag: Le, name: "Disclosure" })))));
65
+ let E = c ? c instanceof HTMLElement ? c : c.current instanceof HTMLElement ? c.current : f.getElementById(r) : f.getElementById(r);
66
+ E == null || E.focus();
67
+ }), x = M(() => ({ close: l }), [l]), S = M(() => ({ open: n === 0, close: l }), [n, l]), I = { ref: m };
68
+ return v.createElement(X.Provider, { value: a }, v.createElement(J.Provider, { value: x }, v.createElement(Re, { value: l }, v.createElement(Be, { value: z(n, { 0: L.Open, 1: L.Closed }) }, K({ ourProps: I, theirProps: d, slot: S, defaultTag: We, name: "Disclosure" })))));
69
69
  }
70
- let Ke = "button";
71
- function Ue(e, t) {
72
- let u = se(), { id: p = `headlessui-disclosure-button-${u}`, disabled: l = !1, autoFocus: m = !1, ...a } = e, [n, r] = z("Disclosure.Button"), y = Me(), s = y === null ? !1 : y === n.panelId, b = oe(null), E = j(b, t, $((i) => {
73
- if (!s) return r({ type: 4, element: i });
74
- })), S = ce();
75
- le(() => {
76
- if (!s) return r({ type: 2, buttonId: p }), () => {
70
+ let Ve = "button";
71
+ function ze(e, t) {
72
+ let i = ae(), { id: d = `headlessui-disclosure-button-${i}`, disabled: s = !1, autoFocus: m = !1, ...a } = e, [n, r] = G("Disclosure.Button"), y = qe(), l = y === null ? !1 : y === n.panelId, x = le(null), S = V(x, t, g((o) => {
73
+ if (!l) return r({ type: 4, element: o });
74
+ })), I = ie();
75
+ j(() => {
76
+ if (!l) return r({ type: 2, buttonId: d }), () => {
77
77
  r({ type: 2, buttonId: null });
78
78
  };
79
- }, [p, r, s]);
80
- let c = $((i) => {
81
- var o;
82
- if (s) {
79
+ }, [d, r, l]);
80
+ let c = g((o) => {
81
+ var k;
82
+ if (l) {
83
83
  if (n.disclosureState === 1) return;
84
- switch (i.key) {
85
- case T.Space:
86
- case T.Enter:
87
- i.preventDefault(), i.stopPropagation(), r({ type: 0 }), (o = n.buttonElement) == null || o.focus();
84
+ switch (o.key) {
85
+ case B.Space:
86
+ case B.Enter:
87
+ o.preventDefault(), o.stopPropagation(), r({ type: 0 }), (k = n.buttonElement) == null || k.focus();
88
88
  break;
89
89
  }
90
- } else switch (i.key) {
91
- case T.Space:
92
- case T.Enter:
93
- i.preventDefault(), i.stopPropagation(), r({ type: 0 });
90
+ } else switch (o.key) {
91
+ case B.Space:
92
+ case B.Enter:
93
+ o.preventDefault(), o.stopPropagation(), r({ type: 0 });
94
94
  break;
95
95
  }
96
- }), f = $((i) => {
97
- switch (i.key) {
98
- case T.Space:
99
- i.preventDefault();
96
+ }), f = g((o) => {
97
+ switch (o.key) {
98
+ case B.Space:
99
+ o.preventDefault();
100
100
  break;
101
101
  }
102
- }), _ = $((i) => {
103
- var o;
104
- Ce(i.currentTarget) || l || (s ? (r({ type: 0 }), (o = n.buttonElement) == null || o.focus()) : r({ type: 0 }));
105
- }), { isFocusVisible: D, focusProps: h } = be({ autoFocus: m }), { isHovered: w, hoverProps: N } = xe({ isDisabled: l }), { pressed: k, pressProps: g } = he({ disabled: l }), M = O(() => ({ open: n.disclosureState === 0, hover: w, active: k, disabled: l, focus: D, autofocus: m }), [n, w, k, D, l, m]), C = ve(e, n.buttonElement), F = s ? te({ ref: E, type: C, disabled: l || void 0, autoFocus: m, onKeyDown: c, onClick: _ }, h, N, g) : te({ ref: E, id: p, type: C, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: l || void 0, autoFocus: m, onKeyDown: c, onKeyUp: f, onClick: _ }, h, N, g);
106
- return Q({ mergeRefs: S, ourProps: F, theirProps: a, slot: M, defaultTag: Ke, name: "Disclosure.Button" });
102
+ }), E = g((o) => {
103
+ var k;
104
+ Me(o.currentTarget) || s || (l ? (r({ type: 0 }), (k = n.buttonElement) == null || k.focus()) : r({ type: 0 }));
105
+ }), { isFocusVisible: _, focusProps: P } = Pe({ autoFocus: m }), { isHovered: h, hoverProps: N } = he({ isDisabled: s }), { pressed: D, pressProps: O } = ge({ disabled: s }), A = M(() => ({ open: n.disclosureState === 0, hover: h, active: D, disabled: s, focus: _, autofocus: m }), [n, h, D, _, s, m]), $ = we(e, n.buttonElement), F = l ? oe({ ref: S, type: $, disabled: s || void 0, autoFocus: m, onKeyDown: c, onClick: E }, P, N, O) : oe({ ref: S, id: d, type: $, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: s || void 0, autoFocus: m, onKeyDown: c, onKeyUp: f, onClick: E }, P, N, O);
106
+ return K({ mergeRefs: I, ourProps: F, theirProps: a, slot: A, defaultTag: Ve, name: "Disclosure.Button" });
107
107
  }
108
- let qe = "div", je = ee.RenderStrategy | ee.Static;
109
- function We(e, t) {
110
- let u = se(), { id: p = `headlessui-disclosure-panel-${u}`, transition: l = !1, ...m } = e, [a, n] = z("Disclosure.Panel"), { close: r } = ie("Disclosure.Panel"), y = ce(), [s, b] = ae(null), E = j(t, $((h) => {
111
- Ae(() => n({ type: 5, element: h }));
112
- }), b);
113
- le(() => (n({ type: 3, panelId: p }), () => {
108
+ let Ke = "div", Xe = ne.RenderStrategy | ne.Static;
109
+ function Ge(e, t) {
110
+ let i = ae(), { id: d = `headlessui-disclosure-panel-${i}`, transition: s = !1, ...m } = e, [a, n] = G("Disclosure.Panel"), { close: r } = ue("Disclosure.Panel"), y = ie(), [l, x] = ce(null), S = V(t, g((P) => {
111
+ Le(() => n({ type: 5, element: P }));
112
+ }), x);
113
+ j(() => (n({ type: 3, panelId: d }), () => {
114
114
  n({ type: 3, panelId: null });
115
- }), [p, n]);
116
- let S = ge(), [c, f] = Pe(l, s, S !== null ? (S & R.Open) === R.Open : a.disclosureState === 0), _ = O(() => ({ open: a.disclosureState === 0, close: r }), [a.disclosureState, r]), D = { ref: E, id: p, ...Te(f) };
117
- return x.createElement(we, null, x.createElement(G.Provider, { value: a.panelId }, Q({ mergeRefs: y, ourProps: D, theirProps: m, slot: _, defaultTag: qe, features: je, visible: c, name: "Disclosure.Panel" })));
115
+ }), [d, n]);
116
+ let I = Ne(), [c, f] = Oe(s, l, I !== null ? (I & L.Open) === L.Open : a.disclosureState === 0), E = M(() => ({ open: a.disclosureState === 0, close: r }), [a.disclosureState, r]), _ = { ref: S, id: d, ...Ae(f) };
117
+ return v.createElement(Ce, null, v.createElement(Y.Provider, { value: a.panelId }, K({ mergeRefs: y, ourProps: _, theirProps: m, slot: E, defaultTag: Ke, features: Xe, visible: c, name: "Disclosure.Panel" })));
118
118
  }
119
- let Qe = q(He), ue = q(Ue), de = q(We), Ve = Object.assign(Qe, { Button: ue, Panel: de });
120
- const ze = "_icon_1yk0x_2", Xe = "_open_1yk0x_15", Ge = "_square_1yk0x_19", Je = "_circle_1yk0x_23", Ye = "_disabled_1yk0x_23", Ze = "_accordion_1yk0x_37", et = "_header_1yk0x_45", tt = "_title_1yk0x_61", nt = "_panel_1yk0x_88", ot = "_m_1yk0x_112", rt = "_s_1yk0x_19", d = {
121
- icon: ze,
119
+ let Je = Q(Qe), de = Q(ze), pe = Q(Ge), Ye = Object.assign(Je, { Button: de, Panel: pe });
120
+ const Ze = "_icon_1yk0x_2", et = "_open_1yk0x_15", tt = "_square_1yk0x_19", nt = "_circle_1yk0x_23", ot = "_disabled_1yk0x_23", rt = "_accordion_1yk0x_37", lt = "_header_1yk0x_45", st = "_title_1yk0x_61", at = "_panel_1yk0x_88", ct = "_m_1yk0x_112", it = "_s_1yk0x_19", u = {
121
+ icon: Ze,
122
122
  "icon-container": "_icon-container_1yk0x_8",
123
- open: Xe,
124
- square: Ge,
125
- circle: Je,
126
- disabled: Ye,
127
- accordion: Ze,
123
+ open: et,
124
+ square: tt,
125
+ circle: nt,
126
+ disabled: ot,
127
+ accordion: rt,
128
128
  "is-link": "_is-link_1yk0x_41",
129
- header: et,
130
- title: tt,
129
+ header: lt,
130
+ title: st,
131
131
  "title-uppercase": "_title-uppercase_1yk0x_64",
132
- panel: nt,
132
+ panel: at,
133
133
  "link-open": "_link-open_1yk0x_108",
134
- m: ot,
135
- s: rt,
134
+ m: ct,
135
+ s: it,
136
136
  "wrapper-button": "_wrapper-button_1yk0x_140"
137
- }, It = me(
137
+ }, vt = Se(
138
138
  ({
139
139
  title: e,
140
140
  disabled: t,
141
- buttonType: u = P.BUTTON,
142
- children: p,
143
- showTitleByDefault: l = !0,
141
+ buttonType: i = w.BUTTON,
142
+ children: d,
143
+ showTitleByDefault: s = !0,
144
144
  linkClassName: m,
145
- size: a = B.M,
145
+ size: a = R.M,
146
146
  titleUppercase: n,
147
- buttonStyle: r = _e.CIRCLE,
148
- iconType: y = Y.ARROW,
149
- classNameTitle: s,
150
- classNameContent: b,
151
- classNameAccordion: E,
152
- classNameIconButton: S,
147
+ buttonStyle: r = ke.CIRCLE,
148
+ iconType: y = ee.ARROW,
149
+ classNameTitle: l,
150
+ classNameContent: x,
151
+ classNameAccordion: S,
152
+ classNameIconButton: I,
153
153
  subtitleNode: c,
154
154
  onlyOpenSubtitleNode: f,
155
- classNameSubtitleContainer: _
156
- }, D) => {
157
- const [h, w] = ae(!1), N = ye(Ee.XS1), k = u === P.LINK, g = {
158
- [d["is-link"]]: k
159
- }, M = () => {
160
- t || w((o) => !o);
161
- }, C = a === B.S ? J.S : J.M, F = (o) => ({
155
+ classNameSubtitleContainer: E,
156
+ activeKey: _,
157
+ defaultActiveKey: P,
158
+ onChange: h
159
+ }, N) => {
160
+ const D = _ !== void 0, [O, A] = ce(
161
+ () => !!P
162
+ ), $ = D ? !!_ : O, F = be(xe.XS1), o = i === w.LINK, k = {
163
+ [u["is-link"]]: o
164
+ };
165
+ j(() => {
166
+ D && A(!!_);
167
+ }, [_, D]);
168
+ const me = () => {
169
+ if (t)
170
+ return;
171
+ const p = !$;
172
+ h == null || h(p), D || A(p);
173
+ }, fe = a === R.S ? Z.S : Z.M, _e = (p) => ({
162
174
  variant: "anchor",
163
- size: N ? "s" : "l",
175
+ size: F ? "s" : "l",
164
176
  rightIcon: {
165
- iconName: C,
166
- className: v({
167
- [d["link-open"]]: o
177
+ iconName: fe,
178
+ className: T({
179
+ [u["link-open"]]: p
168
180
  })
169
181
  }
170
- }), i = (o) => {
171
- const L = () => y === Y.DROPDOWN ? a === B.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === B.S ? Z.S : Z.M;
172
- switch (u) {
173
- case P.LINK:
182
+ }), Ee = (p) => {
183
+ const H = () => y === ee.DROPDOWN ? a === R.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === R.S ? te.S : te.M;
184
+ switch (i) {
185
+ case w.LINK:
174
186
  return e;
175
- case P.BUTTON:
176
- return /* @__PURE__ */ A(H, { children: [
177
- /* @__PURE__ */ I(
187
+ case w.BUTTON:
188
+ return /* @__PURE__ */ C(U, { children: [
189
+ /* @__PURE__ */ b(
178
190
  "span",
179
191
  {
180
- className: v(
181
- d.title,
182
- s,
183
- n && d["title-uppercase"]
192
+ className: T(
193
+ u.title,
194
+ l,
195
+ n && u["title-uppercase"]
184
196
  ),
185
197
  children: e
186
198
  }
187
199
  ),
188
- /* @__PURE__ */ I(
200
+ /* @__PURE__ */ b(
189
201
  "div",
190
202
  {
191
- className: v(
192
- d["icon-container"],
193
- o && d.open,
194
- t && d.disabled,
195
- d[r],
196
- S
203
+ className: T(
204
+ u["icon-container"],
205
+ p && u.open,
206
+ t && u.disabled,
207
+ u[r],
208
+ I
197
209
  ),
198
210
  "data-testid": "accordion-icon-container",
199
- children: /* @__PURE__ */ I(
200
- Se,
211
+ children: /* @__PURE__ */ b(
212
+ De,
201
213
  {
202
- iconName: L(),
203
- className: d.icon,
214
+ iconName: H(),
215
+ className: u.icon,
204
216
  "data-testid": "accordion-icon"
205
217
  }
206
218
  )
@@ -211,57 +223,65 @@ const ze = "_icon_1yk0x_2", Xe = "_open_1yk0x_15", Ge = "_square_1yk0x_19", Je =
211
223
  return null;
212
224
  }
213
225
  };
214
- return /* @__PURE__ */ A(H, { children: [
215
- /* @__PURE__ */ I(
226
+ return /* @__PURE__ */ C(U, { children: [
227
+ /* @__PURE__ */ b(
216
228
  "div",
217
229
  {
218
- className: v(
219
- d.accordion,
220
- d[a],
221
- g,
222
- E
230
+ className: T(
231
+ u.accordion,
232
+ u[a],
233
+ k,
234
+ S
223
235
  ),
224
- children: /* @__PURE__ */ I(Ve, { ref: D, children: ({ open: o, close: L }) => /* @__PURE__ */ A(H, { children: [
225
- (!o || l) && /* @__PURE__ */ I(
226
- ue,
227
- {
228
- disabled: t,
229
- as: k ? ke : P.BUTTON,
230
- onClick: M,
231
- className: v({
232
- [d.header]: !k,
233
- [d.disabled]: t,
234
- [m ?? ""]: k && m
235
- }),
236
- ...k ? F(o) : {},
237
- children: (!o || l) && i(o)
238
- }
239
- ),
240
- o && /* @__PURE__ */ I(
241
- de,
242
- {
243
- "data-testid": "accordion-panel",
244
- className: v(
245
- d.panel,
246
- b,
247
- g
236
+ children: /* @__PURE__ */ b(
237
+ Ye,
238
+ {
239
+ ref: N,
240
+ defaultOpen: $,
241
+ children: ({ open: p, close: H }) => /* @__PURE__ */ C(U, { children: [
242
+ (!p || s) && /* @__PURE__ */ b(
243
+ de,
244
+ {
245
+ disabled: t,
246
+ as: o ? $e : w.BUTTON,
247
+ onClick: me,
248
+ className: T({
249
+ [u.header]: !o,
250
+ [u.disabled]: t,
251
+ [m ?? ""]: o && m
252
+ }),
253
+ ...o ? _e(p) : {},
254
+ children: (!p || s) && Ee(p)
255
+ }
248
256
  ),
249
- children: /* @__PURE__ */ I(fe, { size: a, children: typeof p == "function" ? p({
250
- open: o,
251
- close: L
252
- }) : p })
253
- }
254
- )
255
- ] }) })
257
+ p && /* @__PURE__ */ b(
258
+ pe,
259
+ {
260
+ "data-testid": "accordion-panel",
261
+ className: T(
262
+ u.panel,
263
+ x,
264
+ k
265
+ ),
266
+ children: /* @__PURE__ */ b(Ie, { size: a, children: typeof d == "function" ? d({
267
+ open: p,
268
+ close: H
269
+ }) : d })
270
+ }
271
+ )
272
+ ] })
273
+ },
274
+ _ ? String($) : void 0
275
+ )
256
276
  }
257
277
  ),
258
- (c || f) && /* @__PURE__ */ A("div", { className: _, children: [
278
+ (c || f) && /* @__PURE__ */ C("div", { className: E, children: [
259
279
  c,
260
- h && f
280
+ $ && f
261
281
  ] })
262
282
  ] });
263
283
  }
264
284
  );
265
285
  export {
266
- It as Accordion
286
+ vt as Accordion
267
287
  };
@@ -11,6 +11,8 @@ type TProps = {
11
11
  disabled?: boolean;
12
12
  className?: string;
13
13
  children?: ReactNode;
14
+ rel?: string;
15
+ target?: string;
14
16
  };
15
17
  type TLinkComponent = <C extends ElementType = 'span'>(props: Props<C, TProps>) => ReactElement | ReactNode;
16
18
  export declare const Link: TLinkComponent;
@@ -1,52 +1,64 @@
1
- import { jsxs as N, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
2
  import { c as o } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as h } from "react";
4
- import { ELinkSize as k, ELinkVariant as x } from "./constants.js";
5
- import { Icon as i } from "../../icons/Icon.js";
6
- import '../../assets/Link.css';const L = "_link_1bc9a_2", I = "_sample_1bc9a_20", j = "_anchor_1bc9a_24", u = "_disabled_1bc9a_28", z = "_icon_1bc9a_38", C = "_xs_1bc9a_47", E = "_s_1bc9a_20", R = "_m_1bc9a_59", g = "_l_1bc9a_2", s = {
7
- link: L,
8
- sample: I,
9
- anchor: j,
10
- disabled: u,
11
- icon: z,
12
- xs: C,
13
- s: E,
14
- m: R,
15
- l: g
16
- }, P = h(
17
- (t, l) => {
3
+ import { forwardRef as x } from "react";
4
+ import { ELinkSize as L, ELinkVariant as I } from "./constants.js";
5
+ import { Icon as t } from "../../icons/Icon.js";
6
+ import '../../assets/Link.css';const g = "_link_1bc9a_2", j = "_sample_1bc9a_20", u = "_anchor_1bc9a_24", z = "_disabled_1bc9a_28", C = "_icon_1bc9a_38", E = "_xs_1bc9a_47", R = "_s_1bc9a_20", v = "_m_1bc9a_59", w = "_l_1bc9a_2", s = {
7
+ link: g,
8
+ sample: j,
9
+ anchor: u,
10
+ disabled: z,
11
+ icon: C,
12
+ xs: E,
13
+ s: R,
14
+ m: v,
15
+ l: w
16
+ }, V = x(
17
+ (i, e) => {
18
18
  const {
19
- as: _ = "button",
20
- disabled: e,
19
+ as: l = "button",
20
+ disabled: r,
21
21
  leftIcon: c,
22
- children: r,
22
+ children: _,
23
23
  rightIcon: a,
24
24
  className: m,
25
- size: b = k.L,
26
- variant: d = x.ANCHOR,
27
- ...p
28
- } = t, f = o(s.link, m, s[d], s[b], {
29
- [s.disabled]: e
25
+ size: b = L.L,
26
+ variant: d = I.ANCHOR,
27
+ rel: p,
28
+ target: f,
29
+ ...N
30
+ } = i, h = o(s.link, m, s[d], s[b], {
31
+ [s.disabled]: r
30
32
  });
31
- return /* @__PURE__ */ N(_, { ref: l, className: f, ...p, children: [
32
- c && /* @__PURE__ */ n(
33
- i,
34
- {
35
- ...c,
36
- className: o(s.icon, c.className)
37
- }
38
- ),
39
- r,
40
- a && /* @__PURE__ */ n(
41
- i,
42
- {
43
- ...a,
44
- className: o(s.icon, a.className)
45
- }
46
- )
47
- ] });
33
+ return /* @__PURE__ */ k(
34
+ l,
35
+ {
36
+ ref: e,
37
+ className: h,
38
+ rel: p,
39
+ target: f,
40
+ ...N,
41
+ children: [
42
+ c && /* @__PURE__ */ n(
43
+ t,
44
+ {
45
+ ...c,
46
+ className: o(s.icon, c.className)
47
+ }
48
+ ),
49
+ _,
50
+ a && /* @__PURE__ */ n(
51
+ t,
52
+ {
53
+ ...a,
54
+ className: o(s.icon, a.className)
55
+ }
56
+ )
57
+ ]
58
+ }
59
+ );
48
60
  }
49
61
  );
50
62
  export {
51
- P as Link
63
+ V as Link
52
64
  };