mimir-ui-kit 1.13.7 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/README.md +62 -62
  2. package/dist/{NavigationButtons-DuOoqaPo.js → NavigationButtons-B8tMfqrg.js} +20 -20
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Input.css +1 -1
  5. package/dist/assets/MergedButton.css +1 -1
  6. package/dist/assets/OtpInput.css +1 -1
  7. package/dist/assets/RadioGroup.css +1 -1
  8. package/dist/assets/Slider.css +1 -1
  9. package/dist/assets/index.css +1 -1
  10. package/dist/components/Button/Button.d.ts +1 -0
  11. package/dist/components/Button/Button.js +25 -26
  12. package/dist/components/Button/constants.d.ts +1 -2
  13. package/dist/components/Button/constants.js +0 -1
  14. package/dist/components/Input/Input.d.ts +2 -2
  15. package/dist/components/Input/Input.js +16 -17
  16. package/dist/components/InputPassword/InputPassword.js +2 -2
  17. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  18. package/dist/components/MergedButton/MergedButton.d.ts +1 -1
  19. package/dist/components/MergedButton/MergedButton.js +19 -17
  20. package/dist/components/OtpInput/OtpInput.js +6 -6
  21. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -18
  22. package/dist/components/RadioGroup/RadioGroup.js +1061 -130
  23. package/dist/components/RadioGroup/index.d.ts +1 -1
  24. package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
  25. package/dist/components/Slider/NavigationButtons/index.js +1 -1
  26. package/dist/components/Slider/Slider.js +10 -10
  27. package/dist/components/Tag/Tag.d.ts +57 -19
  28. package/dist/components/Tag/Tag.js +84 -39
  29. package/dist/components/Tag/constants.d.ts +37 -5
  30. package/dist/components/Tag/constants.js +53 -13
  31. package/dist/components/Tag/index.d.ts +3 -2
  32. package/dist/components/Tag/index.js +6 -5
  33. package/dist/components/Tag/types.d.ts +6 -0
  34. package/dist/components/index.d.ts +1 -15
  35. package/dist/components/index.js +0 -29
  36. package/dist/hooks/index.d.ts +0 -3
  37. package/dist/hooks/index.js +1 -7
  38. package/dist/icons/Icon.js +1 -1
  39. package/dist/icons/components/index.d.ts +0 -1
  40. package/dist/icons/components/index.js +559 -560
  41. package/dist/{index-Cxiikb7g.js → index-_ACzPKPw.js} +558 -561
  42. package/dist/index.d.ts +0 -1
  43. package/dist/index.js +1 -38
  44. package/package.json +128 -128
  45. package/dist/DatePickerModal-BM0BgzTb.js +0 -204
  46. package/dist/assets/Accordion.css +0 -1
  47. package/dist/assets/AccordionItem.css +0 -1
  48. package/dist/assets/DatePickerModal.css +0 -1
  49. package/dist/assets/Drawer.css +0 -1
  50. package/dist/assets/ListPhotos.css +0 -1
  51. package/dist/assets/SelectSearch.css +0 -1
  52. package/dist/assets/Switch.css +0 -1
  53. package/dist/assets/TabTrail.css +0 -1
  54. package/dist/assets/Tag.css +0 -1
  55. package/dist/assets/Timer.css +0 -1
  56. package/dist/assets/Uploader.css +0 -1
  57. package/dist/assets/UploaderPhotos.css +0 -1
  58. package/dist/bugs-CSBdWk0R.js +0 -18
  59. package/dist/components/Accordion/Accordion.d.ts +0 -10
  60. package/dist/components/Accordion/Accordion.js +0 -176
  61. package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +0 -8
  62. package/dist/components/Accordion/AccordionItem/AccordionItem.js +0 -16
  63. package/dist/components/Accordion/AccordionItem/index.d.ts +0 -1
  64. package/dist/components/Accordion/AccordionItem/index.js +0 -4
  65. package/dist/components/Accordion/constants.d.ts +0 -8
  66. package/dist/components/Accordion/constants.js +0 -14
  67. package/dist/components/Accordion/index.d.ts +0 -3
  68. package/dist/components/Accordion/index.js +0 -8
  69. package/dist/components/DatePicker/DatePicker.d.ts +0 -44
  70. package/dist/components/DatePicker/DatePicker.js +0 -69
  71. package/dist/components/DatePicker/DatePickerModal.d.ts +0 -8
  72. package/dist/components/DatePicker/DatePickerModal.js +0 -9
  73. package/dist/components/DatePicker/constants.d.ts +0 -6
  74. package/dist/components/DatePicker/constants.js +0 -11
  75. package/dist/components/DatePicker/index.d.ts +0 -2
  76. package/dist/components/DatePicker/index.js +0 -4
  77. package/dist/components/Drawer/Drawer.d.ts +0 -38
  78. package/dist/components/Drawer/Drawer.js +0 -144
  79. package/dist/components/Drawer/constants.d.ts +0 -5
  80. package/dist/components/Drawer/constants.js +0 -9
  81. package/dist/components/Drawer/index.d.ts +0 -2
  82. package/dist/components/Drawer/index.js +0 -6
  83. package/dist/components/ListPhotos/ListPhotos.d.ts +0 -23
  84. package/dist/components/ListPhotos/ListPhotos.js +0 -33
  85. package/dist/components/ListPhotos/constants.d.ts +0 -3
  86. package/dist/components/ListPhotos/constants.js +0 -21
  87. package/dist/components/ListPhotos/index.d.ts +0 -2
  88. package/dist/components/ListPhotos/index.js +0 -4
  89. package/dist/components/Portal/Portal.d.ts +0 -7
  90. package/dist/components/Portal/Portal.js +0 -10
  91. package/dist/components/Portal/index.d.ts +0 -1
  92. package/dist/components/Portal/index.js +0 -4
  93. package/dist/components/SelectSearch/SelectSearch.d.ts +0 -15
  94. package/dist/components/SelectSearch/SelectSearch.js +0 -3876
  95. package/dist/components/SelectSearch/constants.d.ts +0 -4
  96. package/dist/components/SelectSearch/constants.js +0 -8
  97. package/dist/components/SelectSearch/index.d.ts +0 -2
  98. package/dist/components/SelectSearch/index.js +0 -6
  99. package/dist/components/Switch/Switch.d.ts +0 -294
  100. package/dist/components/Switch/Switch.js +0 -59
  101. package/dist/components/Switch/index.d.ts +0 -2
  102. package/dist/components/Switch/index.js +0 -4
  103. package/dist/components/TabTrail/TabButtons/TabButtons.d.ts +0 -8
  104. package/dist/components/TabTrail/TabButtons/TabButtons.js +0 -29
  105. package/dist/components/TabTrail/TabButtons/constants.d.ts +0 -8
  106. package/dist/components/TabTrail/TabButtons/constants.js +0 -14
  107. package/dist/components/TabTrail/TabButtons/index.d.ts +0 -1
  108. package/dist/components/TabTrail/TabButtons/index.js +0 -4
  109. package/dist/components/TabTrail/TabTrail.d.ts +0 -11
  110. package/dist/components/TabTrail/TabTrail.js +0 -282
  111. package/dist/components/TabTrail/constants.d.ts +0 -4
  112. package/dist/components/TabTrail/constants.js +0 -8
  113. package/dist/components/TabTrail/index.d.ts +0 -2
  114. package/dist/components/TabTrail/index.js +0 -6
  115. package/dist/components/Timer/Timer.d.ts +0 -24
  116. package/dist/components/Timer/Timer.js +0 -29
  117. package/dist/components/Timer/index.d.ts +0 -1
  118. package/dist/components/Timer/index.js +0 -4
  119. package/dist/components/Uploader/Uploader.d.ts +0 -30
  120. package/dist/components/Uploader/Uploader.js +0 -90
  121. package/dist/components/Uploader/constants.d.ts +0 -5
  122. package/dist/components/Uploader/constants.js +0 -16
  123. package/dist/components/Uploader/index.d.ts +0 -2
  124. package/dist/components/Uploader/index.js +0 -4
  125. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +0 -29
  126. package/dist/components/UploaderPhotos/UploaderPhotos.js +0 -46
  127. package/dist/components/UploaderPhotos/index.d.ts +0 -2
  128. package/dist/components/UploaderPhotos/index.js +0 -4
  129. package/dist/focus-management-1rQPII7Z.js +0 -77
  130. package/dist/hidden-BuVoeHNy.js +0 -13
  131. package/dist/hooks/useClickOutside/index.d.ts +0 -1
  132. package/dist/hooks/useClickOutside/index.js +0 -4
  133. package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -7
  134. package/dist/hooks/useClickOutside/useClickOutside.js +0 -25
  135. package/dist/hooks/useInterval/index.d.ts +0 -1
  136. package/dist/hooks/useInterval/index.js +0 -4
  137. package/dist/hooks/useInterval/useInterval.d.ts +0 -1
  138. package/dist/hooks/useInterval/useInterval.js +0 -17
  139. package/dist/hooks/useLockBodyScroll/index.d.ts +0 -1
  140. package/dist/hooks/useLockBodyScroll/index.js +0 -4
  141. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +0 -6
  142. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +0 -20
  143. package/dist/hooks/useTimer/index.d.ts +0 -18
  144. package/dist/hooks/useTimer/index.js +0 -83
  145. package/dist/hooks/useTimer/useTimer.d.ts +0 -18
  146. package/dist/hooks/useTimer/useTimer.js +0 -87
  147. package/dist/hooks/useTimer/utils.d.ts +0 -24
  148. package/dist/hooks/useTimer/utils.js +0 -88
  149. package/dist/icons/components/12px/Close12px.d.ts +0 -4
  150. package/dist/icons/components/12px/Close12px.js +0 -18
  151. package/dist/keyboard-B256ZoM-.js +0 -745
  152. package/dist/label-C_5Syaoj.js +0 -159
  153. package/dist/open-closed-CbXq00et.js +0 -93
  154. package/dist/use-active-press-B6yeSopF.js +0 -31
  155. package/dist/use-by-comparator-BUO78DGe.js +0 -16
  156. package/dist/use-resolve-button-type-B6LE6gU3.js +0 -19
  157. package/dist/utils/UUID4.d.ts +0 -1
  158. package/dist/utils/UUID4.js +0 -9
  159. package/dist/utils/formating/Date.d.ts +0 -1
  160. package/dist/utils/formating/Date.js +0 -26
  161. package/dist/utils/formating/Month.d.ts +0 -8
  162. package/dist/utils/formating/Month.js +0 -80
  163. package/dist/utils/formating/Numbers.d.ts +0 -6
  164. package/dist/utils/formating/Numbers.js +0 -8
  165. package/dist/utils/index.d.ts +0 -11
  166. package/dist/utils/index.js +0 -13
@@ -1,282 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import * as React from "react";
4
- import React__default, { useRef, useState, createContext, useReducer, useMemo, useId, useContext, forwardRef, useEffect } from "react";
5
- import { ETabTrailSize } from "./constants.js";
6
- import { TabButtons } from "./TabButtons/TabButtons.js";
7
- import { useMediaQuery } from "../../hooks/useMediaQuery/useMediaQuery.js";
8
- import { EMediaQuery } from "../../hooks/useMediaQuery/constants.js";
9
- import { n, M, W, s as s$3, y, o, H, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D, a as u, u as u$1, c as o$1, t } from "../../keyboard-B256ZoM-.js";
10
- import { w } from "../../use-active-press-B6yeSopF.js";
11
- import { T as T$1 } from "../../use-resolve-button-type-B6LE6gU3.js";
12
- import { T, s as s$2 } from "../../hidden-BuVoeHNy.js";
13
- import { _, T as T$2, P, F } from "../../focus-management-1rQPII7Z.js";
14
- import '../../assets/TabTrail.css';function f$1() {
15
- let e = useRef(false);
16
- return n(() => (e.current = true, () => {
17
- e.current = false;
18
- }), []), e;
19
- }
20
- function b({ onFocus: n2 }) {
21
- let [r, o2] = useState(true), u2 = f$1();
22
- return r ? React__default.createElement(T, { as: "button", type: "button", features: s$2.Focusable, onFocus: (a2) => {
23
- a2.preventDefault();
24
- let e, i = 50;
25
- function t2() {
26
- if (i-- <= 0) {
27
- e && cancelAnimationFrame(e);
28
- return;
29
- }
30
- if (n2()) {
31
- if (cancelAnimationFrame(e), !u2.current) return;
32
- o2(false);
33
- return;
34
- }
35
- e = requestAnimationFrame(t2);
36
- }
37
- e = requestAnimationFrame(t2);
38
- } }) : null;
39
- }
40
- const s$1 = React.createContext(null);
41
- function a() {
42
- return { groups: /* @__PURE__ */ new Map(), get(o2, e) {
43
- var i;
44
- let t2 = this.groups.get(o2);
45
- t2 || (t2 = /* @__PURE__ */ new Map(), this.groups.set(o2, t2));
46
- let n2 = (i = t2.get(e)) != null ? i : 0;
47
- t2.set(e, n2 + 1);
48
- let r = Array.from(t2.keys()).indexOf(e);
49
- function u2() {
50
- let c = t2.get(e);
51
- c > 1 ? t2.set(e, c - 1) : t2.delete(e);
52
- }
53
- return [r, u2];
54
- } };
55
- }
56
- function f({ children: o2 }) {
57
- let e = React.useRef(a());
58
- return React.createElement(s$1.Provider, { value: e }, o2);
59
- }
60
- function C$1(o2) {
61
- let e = React.useContext(s$1);
62
- if (!e) throw new Error("You must wrap your component in a <StableCollection>");
63
- let t2 = React.useId(), [n2, r] = e.current.get(o2, t2);
64
- return React.useEffect(() => r, []), n2;
65
- }
66
- var Ae = ((t2) => (t2[t2.Forwards = 0] = "Forwards", t2[t2.Backwards = 1] = "Backwards", t2))(Ae || {}), Ee = ((o2) => (o2[o2.Less = -1] = "Less", o2[o2.Equal = 0] = "Equal", o2[o2.Greater = 1] = "Greater", o2))(Ee || {}), Re = ((n2) => (n2[n2.SetSelectedIndex = 0] = "SetSelectedIndex", n2[n2.RegisterTab = 1] = "RegisterTab", n2[n2.UnregisterTab = 2] = "UnregisterTab", n2[n2.RegisterPanel = 3] = "RegisterPanel", n2[n2.UnregisterPanel = 4] = "UnregisterPanel", n2))(Re || {});
67
- let Le = { [0](e, r) {
68
- var c;
69
- let t2 = _(e.tabs, (T2) => T2.current), o2 = _(e.panels, (T2) => T2.current), a2 = t2.filter((T2) => {
70
- var d;
71
- return !((d = T2.current) != null && d.hasAttribute("disabled"));
72
- }), n2 = { ...e, tabs: t2, panels: o2 };
73
- if (r.index < 0 || r.index > t2.length - 1) {
74
- let T2 = u(Math.sign(r.index - e.selectedIndex), { [-1]: () => 1, [0]: () => u(Math.sign(r.index), { [-1]: () => 0, [0]: () => 0, [1]: () => 1 }), [1]: () => 0 });
75
- if (a2.length === 0) return n2;
76
- let d = u(T2, { [0]: () => t2.indexOf(a2[0]), [1]: () => t2.indexOf(a2[a2.length - 1]) });
77
- return { ...n2, selectedIndex: d === -1 ? e.selectedIndex : d };
78
- }
79
- let u$12 = t2.slice(0, r.index), x = [...t2.slice(r.index), ...u$12].find((T2) => a2.includes(T2));
80
- if (!x) return n2;
81
- let f2 = (c = t2.indexOf(x)) != null ? c : e.selectedIndex;
82
- return f2 === -1 && (f2 = e.selectedIndex), { ...n2, selectedIndex: f2 };
83
- }, [1](e, r) {
84
- if (e.tabs.includes(r.tab)) return e;
85
- let t2 = e.tabs[e.selectedIndex], o2 = _([...e.tabs, r.tab], (n2) => n2.current), a2 = e.selectedIndex;
86
- return e.info.current.isControlled || (a2 = o2.indexOf(t2), a2 === -1 && (a2 = e.selectedIndex)), { ...e, tabs: o2, selectedIndex: a2 };
87
- }, [2](e, r) {
88
- return { ...e, tabs: e.tabs.filter((t2) => t2 !== r.tab) };
89
- }, [3](e, r) {
90
- return e.panels.includes(r.panel) ? e : { ...e, panels: _([...e.panels, r.panel], (t2) => t2.current) };
91
- }, [4](e, r) {
92
- return { ...e, panels: e.panels.filter((t2) => t2 !== r.panel) };
93
- } }, z = createContext(null);
94
- z.displayName = "TabsDataContext";
95
- function C(e) {
96
- let r = useContext(z);
97
- if (r === null) {
98
- let t2 = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
99
- throw Error.captureStackTrace && Error.captureStackTrace(t2, C), t2;
100
- }
101
- return r;
102
- }
103
- let V = createContext(null);
104
- V.displayName = "TabsActionsContext";
105
- function Q(e) {
106
- let r = useContext(V);
107
- if (r === null) {
108
- let t2 = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
109
- throw Error.captureStackTrace && Error.captureStackTrace(t2, Q), t2;
110
- }
111
- return r;
112
- }
113
- function _e(e, r) {
114
- return u(r.type, Le, e, r);
115
- }
116
- let De = "div";
117
- function Se(e, r) {
118
- let { defaultIndex: t2 = 0, vertical: o$12 = false, manual: a2 = false, onChange: n$1, selectedIndex: u2 = null, ..._$1 } = e;
119
- const x = o$12 ? "vertical" : "horizontal", f$12 = a2 ? "manual" : "auto";
120
- let c = u2 !== null, T2 = s$3({ isControlled: c }), d = y(r), [i, s2] = useReducer(_e, { info: T2, selectedIndex: u2 != null ? u2 : t2, tabs: [], panels: [] }), F2 = useMemo(() => ({ selectedIndex: i.selectedIndex }), [i.selectedIndex]), M2 = s$3(n$1 || (() => {
121
- })), b$1 = s$3(i.tabs), m2 = useMemo(() => ({ orientation: x, activation: f$12, ...i }), [x, f$12, i]), E = o((p) => (s2({ type: 1, tab: p }), () => s2({ type: 2, tab: p }))), I = o((p) => (s2({ type: 3, panel: p }), () => s2({ type: 4, panel: p }))), g = o((p) => {
122
- R.current !== p && M2.current(p), c || s2({ type: 0, index: p });
123
- }), R = s$3(c ? e.selectedIndex : i.selectedIndex), J = useMemo(() => ({ registerTab: E, registerPanel: I, change: g }), []);
124
- n(() => {
125
- s2({ type: 0, index: u2 != null ? u2 : t2 });
126
- }, [u2]), n(() => {
127
- if (R.current === void 0 || i.tabs.length <= 0) return;
128
- let p = _(i.tabs, (L) => L.current);
129
- p.some((L, B) => i.tabs[B] !== L) && g(p.indexOf(i.tabs[R.current]));
130
- });
131
- let k = { ref: d };
132
- return React__default.createElement(f, null, React__default.createElement(V.Provider, { value: J }, React__default.createElement(z.Provider, { value: m2 }, m2.tabs.length <= 0 && React__default.createElement(b, { onFocus: () => {
133
- var p, h;
134
- for (let L of b$1.current) if (((p = L.current) == null ? void 0 : p.tabIndex) === 0) return (h = L.current) == null || h.focus(), true;
135
- return false;
136
- } }), H({ ourProps: k, theirProps: _$1, slot: F2, defaultTag: De, name: "Tabs" }))));
137
- }
138
- let Fe = "div";
139
- function Ie(e, r) {
140
- let { orientation: t2, selectedIndex: o2 } = C("Tab.List"), a2 = y(r), n2 = useMemo(() => ({ selectedIndex: o2 }), [o2]);
141
- return H({ ourProps: { ref: a2, role: "tablist", "aria-orientation": t2 }, theirProps: e, slot: n2, defaultTag: Fe, name: "Tabs.List" });
142
- }
143
- let he = "button";
144
- function ve(e, r) {
145
- var Y, Z;
146
- let t$1 = useId(), { id: o$2 = `headlessui-tabs-tab-${t$1}`, disabled: a2 = false, autoFocus: n$1 = false, ...u$2 } = e, { orientation: _2, activation: x, selectedIndex: f2, tabs: c, panels: T2 } = C("Tab"), d = Q("Tab"), i = C("Tab"), s2 = useRef(null), F$1 = y(s2, r);
147
- n(() => d.registerTab(s2), [d, s2]);
148
- let M2 = C$1("tabs"), b2 = c.indexOf(s2);
149
- b2 === -1 && (b2 = M2);
150
- let m2 = b2 === f2, E = o((l) => {
151
- var X;
152
- let A = l();
153
- if (A === T$2.Success && x === "auto") {
154
- let $ = (X = u$1(s2)) == null ? void 0 : X.activeElement, ee = i.tabs.findIndex((Te) => Te.current === $);
155
- ee !== -1 && d.change(ee);
156
- }
157
- return A;
158
- }), I = o((l) => {
159
- let A = c.map(($) => $.current).filter(Boolean);
160
- if (l.key === o$1.Space || l.key === o$1.Enter) {
161
- l.preventDefault(), l.stopPropagation(), d.change(b2);
162
- return;
163
- }
164
- switch (l.key) {
165
- case o$1.Home:
166
- case o$1.PageUp:
167
- return l.preventDefault(), l.stopPropagation(), E(() => P(A, F.First));
168
- case o$1.End:
169
- case o$1.PageDown:
170
- return l.preventDefault(), l.stopPropagation(), E(() => P(A, F.Last));
171
- }
172
- if (E(() => u(_2, { vertical() {
173
- return l.key === o$1.ArrowUp ? P(A, F.Previous | F.WrapAround) : l.key === o$1.ArrowDown ? P(A, F.Next | F.WrapAround) : T$2.Error;
174
- }, horizontal() {
175
- return l.key === o$1.ArrowLeft ? P(A, F.Previous | F.WrapAround) : l.key === o$1.ArrowRight ? P(A, F.Next | F.WrapAround) : T$2.Error;
176
- } })) === T$2.Success) return l.preventDefault();
177
- }), g = useRef(false), R = o(() => {
178
- var l;
179
- g.current || (g.current = true, (l = s2.current) == null || l.focus({ preventScroll: true }), d.change(b2), t(() => {
180
- g.current = false;
181
- }));
182
- }), J = o((l) => {
183
- l.preventDefault();
184
- }), { isFocusVisible: k, focusProps: p } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: n$1 }), { isHovered: h, hoverProps: L } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: a2 }), { pressed: B, pressProps: ie } = w({ disabled: a2 }), pe = useMemo(() => ({ selected: m2, hover: h, active: B, focus: k, autofocus: n$1, disabled: a2 }), [m2, h, k, B, n$1, a2]), ue = D({ ref: F$1, onKeyDown: I, onMouseDown: J, onClick: R, id: o$2, role: "tab", type: T$1(e, s2), "aria-controls": (Z = (Y = T2[b2]) == null ? void 0 : Y.current) == null ? void 0 : Z.id, "aria-selected": m2, tabIndex: m2 ? 0 : -1, disabled: a2 || void 0, autoFocus: n$1 }, p, L, ie);
185
- return H({ ourProps: ue, theirProps: u$2, slot: pe, defaultTag: he, name: "Tabs.Tab" });
186
- }
187
- let Ce = "div";
188
- function Me(e, r) {
189
- let { selectedIndex: t2 } = C("Tab.Panels"), o2 = y(r), a2 = useMemo(() => ({ selectedIndex: t2 }), [t2]);
190
- return H({ ourProps: { ref: o2 }, theirProps: e, slot: a2, defaultTag: Ce, name: "Tabs.Panels" });
191
- }
192
- let Ge = "div", Ue = M.RenderStrategy | M.Static;
193
- function He(e, r) {
194
- var E, I, g, R;
195
- let t2 = useId(), { id: o2 = `headlessui-tabs-panel-${t2}`, tabIndex: a2 = 0, ...n$1 } = e, { selectedIndex: u2, tabs: _2, panels: x } = C("Tab.Panel"), f2 = Q("Tab.Panel"), c = useRef(null), T$12 = y(c, r);
196
- n(() => f2.registerPanel(c), [f2, c]);
197
- let d = C$1("panels"), i = x.indexOf(c);
198
- i === -1 && (i = d);
199
- let s2 = i === u2, { isFocusVisible: F2, focusProps: M2 } = $f7dceffc5ad7768b$export$4e328f61c538687f(), b2 = useMemo(() => ({ selected: s2, focus: F2 }), [s2, F2]), m2 = D({ ref: T$12, id: o2, role: "tabpanel", "aria-labelledby": (I = (E = _2[i]) == null ? void 0 : E.current) == null ? void 0 : I.id, tabIndex: s2 ? a2 : -1 }, M2);
200
- return !s2 && ((g = n$1.unmount) == null || g) && !((R = n$1.static) != null && R) ? React__default.createElement(T, { "aria-hidden": "true", ...m2 }) : H({ ourProps: m2, theirProps: n$1, slot: b2, defaultTag: Ge, features: Ue, visible: s2, name: "Tabs.Panel" });
201
- }
202
- let we = W(ve), Oe = W(Se), Ne = W(Ie), ke = W(Me), Be = W(He), st = Object.assign(we, { Group: Oe, List: Ne, Panels: ke, Panel: Be });
203
- const container = "_container_y23cb_2";
204
- const group = "_group_y23cb_6";
205
- const tab = "_tab_y23cb_15";
206
- const list = "_list_y23cb_30";
207
- const tabs = "_tabs_y23cb_41";
208
- const buttons = "_buttons_y23cb_45";
209
- const m = "_m_y23cb_52";
210
- const s = "_s_y23cb_57";
211
- const cls = {
212
- container,
213
- group,
214
- "group-inner": "_group-inner_y23cb_10",
215
- tab,
216
- list,
217
- tabs,
218
- buttons,
219
- m,
220
- s
221
- };
222
- const TabTrail = forwardRef(
223
- ({ categories, size = ETabTrailSize.M }, ref) => {
224
- const [activeIndex, setActiveIndex] = useState(0);
225
- const tabListRef = useRef(null);
226
- const isTablet = useMediaQuery(EMediaQuery.S);
227
- const handleNext = () => {
228
- setActiveIndex((prevIndex) => (prevIndex + 1) % categories.length);
229
- };
230
- const handlePrev = () => {
231
- setActiveIndex(
232
- (prevIndex) => (prevIndex - 1 + categories.length) % categories.length
233
- );
234
- };
235
- useEffect(() => {
236
- var _a;
237
- const activeTab = (_a = tabListRef.current) == null ? void 0 : _a.querySelector(
238
- `.${cls.tab}[data-active="true"]`
239
- );
240
- if (activeTab) {
241
- activeTab.scrollIntoView({
242
- behavior: "smooth",
243
- block: "nearest",
244
- inline: "center"
245
- });
246
- }
247
- }, [activeIndex]);
248
- return /* @__PURE__ */ jsxs(
249
- Oe,
250
- {
251
- ref,
252
- className: classNames(cls.group, cls[size]),
253
- selectedIndex: activeIndex,
254
- onChange: setActiveIndex,
255
- children: [
256
- /* @__PURE__ */ jsxs("div", { className: cls["group-inner"], children: [
257
- /* @__PURE__ */ jsx(Ne, { ref: tabListRef, className: cls.list, children: /* @__PURE__ */ jsx("div", { className: cls.tabs, children: categories.map(({ name }, index) => /* @__PURE__ */ jsx(
258
- st,
259
- {
260
- className: `${cls.tab} ${activeIndex === index ? 'data-active="true"' : ""}`,
261
- "data-active": activeIndex === index,
262
- children: name
263
- },
264
- name
265
- )) }) }),
266
- !isTablet && /* @__PURE__ */ jsx("div", { className: cls.buttons, children: /* @__PURE__ */ jsx(
267
- TabButtons,
268
- {
269
- handlePrevTab: handlePrev,
270
- handleNextTab: handleNext
271
- }
272
- ) })
273
- ] }),
274
- /* @__PURE__ */ jsx(ke, { className: cls.panels, children: categories.map(({ name, content }) => /* @__PURE__ */ jsx(Be, { className: cls.panel, children: content }, name)) })
275
- ]
276
- }
277
- );
278
- }
279
- );
280
- export {
281
- TabTrail
282
- };
@@ -1,4 +0,0 @@
1
- export declare enum ETabTrailSize {
2
- M = "m",
3
- S = "s"
4
- }
@@ -1,8 +0,0 @@
1
- var ETabTrailSize = /* @__PURE__ */ ((ETabTrailSize2) => {
2
- ETabTrailSize2["M"] = "m";
3
- ETabTrailSize2["S"] = "s";
4
- return ETabTrailSize2;
5
- })(ETabTrailSize || {});
6
- export {
7
- ETabTrailSize
8
- };
@@ -1,2 +0,0 @@
1
- export { TabTrail, type TTabTrailProps, type TCategoryTab } from './TabTrail';
2
- export { ETabTrailSize } from './constants';
@@ -1,6 +0,0 @@
1
- import { TabTrail } from "./TabTrail.js";
2
- import { ETabTrailSize } from "./constants.js";
3
- export {
4
- ETabTrailSize,
5
- TabTrail
6
- };
@@ -1,24 +0,0 @@
1
- type TProps = {
2
- /**
3
- * число, которое представляет собой временную метку, указывающую время, когда истекает таймер.
4
- * const timer = new Date().getTime() + 60000; => таймер на 1 минуту
5
- */
6
- expiryTimestamp: number;
7
- /**
8
- * необязательное свойство типа boolean, которое указывает, должен ли таймер начинаться автоматически при создании компонента.
9
- */
10
- autoStart?: boolean;
11
- /**
12
- * необязательная функция, которая вызывается, когда таймер истекает.
13
- */
14
- onTimerEnd?: () => void;
15
- /**
16
- * Дополнительный класс.
17
- */
18
- className?: string;
19
- };
20
- /**
21
- * Компонент Timer отображает таймер с отсчетом времени в минутах и секундах.
22
- */
23
- export declare const Timer: ({ expiryTimestamp, autoStart, onTimerEnd, className }: TProps) => import("react/jsx-runtime").JSX.Element;
24
- export {};
@@ -1,29 +0,0 @@
1
- import { jsxs } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { useTimer } from "../../hooks/useTimer/index.js";
4
- import '../../assets/Timer.css';const timer = "_timer_llwad_3";
5
- const cls = {
6
- timer
7
- };
8
- const Timer = ({
9
- expiryTimestamp,
10
- autoStart = false,
11
- onTimerEnd,
12
- className
13
- }) => {
14
- const { minutes, seconds } = useTimer({
15
- expiryTimestamp,
16
- onExpire: onTimerEnd,
17
- autoStart
18
- });
19
- const formattedMinutes = String(minutes).padStart(2, "0");
20
- const formattedSeconds = String(seconds).padStart(2, "0");
21
- return /* @__PURE__ */ jsxs("div", { className: classNames(cls.timer, className), children: [
22
- formattedMinutes,
23
- ":",
24
- formattedSeconds
25
- ] });
26
- };
27
- export {
28
- Timer
29
- };
@@ -1 +0,0 @@
1
- export { Timer } from './Timer';
@@ -1,4 +0,0 @@
1
- import { Timer } from "./Timer.js";
2
- export {
3
- Timer
4
- };
@@ -1,30 +0,0 @@
1
- import { imageTypesArr } from './constants';
2
-
3
- export type TUploader = {
4
- /**
5
- * Массив разрешенных типов файлов для настройки валидации
6
- * 'jpeg' | 'png' | 'tiff'|'gif'|'doc'|'xls'|'pdf'|'docx' |'txt' | 'xlsx'
7
- */
8
- filesType: imageTypesArr[];
9
- /**
10
- * Наименование передаваемого массива файлов
11
- */
12
- name: string;
13
- /**
14
- * Функция - callback, которая вызывается при изменении значения и передает имя и новое значение
15
- */
16
- onChangeValue: (e: TUploadValue) => void;
17
- /**
18
- * Максимальный размер файлов.
19
- */
20
- maxSize: number;
21
- };
22
- export type TUploadValue = {
23
- value: TFileItem[];
24
- name?: string;
25
- };
26
- export type TFileItem = {
27
- id: number;
28
- file: File;
29
- };
30
- export declare function Uploader({ filesType, onChangeValue, name, maxSize }: TUploader): import("react/jsx-runtime").JSX.Element;
@@ -1,90 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useId, useRef } from "react";
3
- import { Icon } from "../../icons/Icon.js";
4
- import { Button } from "../Button/Button.js";
5
- import '../../assets/Uploader.css';const cls = {
6
- "upload-file__wrapper": "_upload-file__wrapper_165vi_2",
7
- "upload-text": "_upload-text_165vi_25",
8
- "upload-file-input": "_upload-file-input_165vi_35"
9
- };
10
- const MIME = {
11
- jpeg: "image/jpeg",
12
- png: "image/png",
13
- tiff: "image/tiff",
14
- gif: "image/gif",
15
- webp: "image/webp",
16
- doc: "application/msword",
17
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
18
- pdf: "application/pdf",
19
- xls: "application/excel",
20
- txt: "text/plain",
21
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
22
- };
23
- const filesTyps = ["jpeg", "png", "tiff", "gif"];
24
- const generateId = (min, max) => {
25
- return Math.random() * (max - min) + min;
26
- };
27
- function Uploader({
28
- filesType = filesTyps,
29
- onChangeValue,
30
- name,
31
- maxSize = 15
32
- }) {
33
- const idImg = useId();
34
- const ref = useRef(null);
35
- const onChange = (e) => {
36
- if (e.target.files && e.target.files[0]) {
37
- const list = [];
38
- Array.from(e.target.files).forEach((el) => {
39
- if (filesType.map((name2) => MIME[name2]).includes(el.type) && el.size / 1024 ** 2 <= maxSize) {
40
- list.push({ file: el, id: generateId(1, 100) });
41
- }
42
- });
43
- onChangeValue({ name, value: list });
44
- }
45
- };
46
- const onOpen = () => {
47
- var _a;
48
- (_a = ref.current) == null ? void 0 : _a.click();
49
- };
50
- return /* @__PURE__ */ jsxs("div", { className: cls["upload-file__wrapper"], children: [
51
- /* @__PURE__ */ jsx(
52
- "input",
53
- {
54
- type: "file",
55
- className: cls["upload-file-input"],
56
- "aria-label": "Upload",
57
- name: "image[]",
58
- multiple: true,
59
- onChange,
60
- title: "",
61
- id: idImg,
62
- accept: filesType.map((i) => MIME[i]).join()
63
- }
64
- ),
65
- /* @__PURE__ */ jsxs("label", { htmlFor: idImg, ref, children: [
66
- /* @__PURE__ */ jsx(
67
- Button,
68
- {
69
- size: "m",
70
- variant: "secondary-asphalt",
71
- leftIcon: /* @__PURE__ */ jsx(Icon, { iconName: "UnionIcon16px" }),
72
- onClick: onOpen,
73
- children: "Выберите файлы"
74
- }
75
- ),
76
- /* @__PURE__ */ jsx("b", { children: "Или перетащие сюда" }),
77
- /* @__PURE__ */ jsxs("span", { className: cls["upload-text"], children: [
78
- "Максимальный размер одного файла – ",
79
- maxSize,
80
- " Мб",
81
- /* @__PURE__ */ jsx("br", {}),
82
- "Загрузить можно файлы следующих форматов: ",
83
- filesType.join(", ")
84
- ] })
85
- ] })
86
- ] });
87
- }
88
- export {
89
- Uploader
90
- };
@@ -1,5 +0,0 @@
1
- export type imageTypesArr = 'jpeg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' | 'docx' | 'txt' | 'xlsx';
2
- export declare const TypeFilesArray: {
3
- images: imageTypesArr[];
4
- docs: imageTypesArr[];
5
- };
@@ -1,16 +0,0 @@
1
- const imageFileTypes = ["jpeg", "png", "tiff", "gif"];
2
- const docsFileTypes = [
3
- "doc",
4
- "xls",
5
- "pdf",
6
- "docx",
7
- "txt",
8
- "xlsx"
9
- ];
10
- const TypeFilesArray = {
11
- images: imageFileTypes,
12
- docs: docsFileTypes
13
- };
14
- export {
15
- TypeFilesArray
16
- };
@@ -1,2 +0,0 @@
1
- export { Uploader } from './Uploader';
2
- export type { Uploader as TUploader } from './Uploader';
@@ -1,4 +0,0 @@
1
- import { Uploader } from "./Uploader.js";
2
- export {
3
- Uploader
4
- };
@@ -1,29 +0,0 @@
1
- import { imageTypesArr } from '../Uploader/constants';
2
- import { TFileItem } from '../Uploader/Uploader';
3
-
4
- export type TUploaderPhotos = {
5
- /**
6
- * Массив разрешенных типов файлов для настройки валидации
7
- * 'jpeg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
8
- */
9
- filesType: imageTypesArr[];
10
- /**
11
- * Наименование передаваемого массива файлов
12
- */
13
- name: string;
14
- /**
15
- * Максимальный размер файлов.
16
- */
17
- maxSize: number;
18
- /**
19
- * Функция обратного вызова, передает параметры type и data,
20
- * type 'add' в data передает массив файлов,
21
- * type:'delete' в data передает id удаленного файла
22
- */
23
- onChange: (j: TOnChangePhotosUpdate) => void;
24
- };
25
- export type TOnChangePhotosUpdate = {
26
- type: string;
27
- data: TFileItem[] | number;
28
- };
29
- export declare function UploaderPhotos({ filesType, name, maxSize, onChange }: TUploaderPhotos): import("react/jsx-runtime").JSX.Element;
@@ -1,46 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { ListPhotos } from "../ListPhotos/ListPhotos.js";
4
- import { Uploader } from "../Uploader/Uploader.js";
5
- import '../../assets/UploaderPhotos.css';const cls = {
6
- "upload-file__wrapper": "_upload-file__wrapper_udscq_2"
7
- };
8
- function UploaderPhotos({
9
- filesType,
10
- name,
11
- maxSize,
12
- onChange
13
- }) {
14
- const [photos, setPhotos] = useState([]);
15
- const onChangeValue = (e) => {
16
- setPhotos([
17
- ...photos,
18
- ...e.value.map((el) => {
19
- return {
20
- url: URL.createObjectURL(el.file),
21
- id: el.id
22
- };
23
- })
24
- ]);
25
- onChange == null ? void 0 : onChange({ type: "add", data: e.value });
26
- };
27
- const onDelete = (j) => {
28
- setPhotos(j.list);
29
- if (j.deleteId) onChange == null ? void 0 : onChange({ type: "delete", data: j.deleteId });
30
- };
31
- return /* @__PURE__ */ jsxs("div", { className: cls["upload-file__wrapper"], children: [
32
- /* @__PURE__ */ jsx(
33
- Uploader,
34
- {
35
- filesType,
36
- name,
37
- maxSize,
38
- onChangeValue
39
- }
40
- ),
41
- /* @__PURE__ */ jsx(ListPhotos, { value: photos, onChange: onDelete })
42
- ] });
43
- }
44
- export {
45
- UploaderPhotos
46
- };
@@ -1,2 +0,0 @@
1
- export { UploaderPhotos } from './UploaderPhotos';
2
- export type { UploaderPhotos as TUploaderPhotos } from './UploaderPhotos';
@@ -1,4 +0,0 @@
1
- import { UploaderPhotos } from "./UploaderPhotos.js";
2
- export {
3
- UploaderPhotos
4
- };