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,176 +0,0 @@
1
- import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import React__default, { createContext, useRef, Fragment, useReducer, useMemo, useId, useEffect, useContext, forwardRef } from "react";
4
- import { AccordionItem } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionSize, EAccordionIconSize } from "./constants.js";
6
- import { Icon } from "../../icons/Icon.js";
7
- import { M as M$1, W, y, T, o, a as u$1, H as H$1, I, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D, u as u$3, c as o$1 } from "../../keyboard-B256ZoM-.js";
8
- import { w } from "../../use-active-press-B6yeSopF.js";
9
- import { T as T$1 } from "../../use-resolve-button-type-B6LE6gU3.js";
10
- import { c, i, u as u$2, V as V$1, A, s as s$1 } from "../../open-closed-CbXq00et.js";
11
- import { r } from "../../bugs-CSBdWk0R.js";
12
- import '../../assets/Accordion.css';let e = createContext(() => {
13
- });
14
- function u({ value: o2, children: t2 }) {
15
- return React__default.createElement(e.Provider, { value: o2 }, t2);
16
- }
17
- var t;
18
- let a = (t = React__default.startTransition) != null ? t : function(i2) {
19
- i2();
20
- };
21
- var de = ((r2) => (r2[r2.Open = 0] = "Open", r2[r2.Closed = 1] = "Closed", r2))(de || {}), fe = ((t2) => (t2[t2.ToggleDisclosure = 0] = "ToggleDisclosure", t2[t2.CloseDisclosure = 1] = "CloseDisclosure", t2[t2.SetButtonId = 2] = "SetButtonId", t2[t2.SetPanelId = 3] = "SetPanelId", t2[t2.LinkPanel = 4] = "LinkPanel", t2[t2.UnlinkPanel = 5] = "UnlinkPanel", t2))(fe || {});
22
- let Te = { [0]: (e2) => ({ ...e2, disclosureState: u$1(e2.disclosureState, { [0]: 1, [1]: 0 }) }), [1]: (e2) => e2.disclosureState === 1 ? e2 : { ...e2, disclosureState: 1 }, [4](e2) {
23
- return e2.linkedPanel === true ? e2 : { ...e2, linkedPanel: true };
24
- }, [5](e2) {
25
- return e2.linkedPanel === false ? e2 : { ...e2, linkedPanel: false };
26
- }, [2](e2, n) {
27
- return e2.buttonId === n.buttonId ? e2 : { ...e2, buttonId: n.buttonId };
28
- }, [3](e2, n) {
29
- return e2.panelId === n.panelId ? e2 : { ...e2, panelId: n.panelId };
30
- } }, M = createContext(null);
31
- M.displayName = "DisclosureContext";
32
- function F(e2) {
33
- let n = useContext(M);
34
- if (n === null) {
35
- let r2 = new Error(`<${e2} /> is missing a parent <Disclosure /> component.`);
36
- throw Error.captureStackTrace && Error.captureStackTrace(r2, F), r2;
37
- }
38
- return n;
39
- }
40
- let k = createContext(null);
41
- k.displayName = "DisclosureAPIContext";
42
- function V(e2) {
43
- let n = useContext(k);
44
- if (n === null) {
45
- let r2 = new Error(`<${e2} /> is missing a parent <Disclosure /> component.`);
46
- throw Error.captureStackTrace && Error.captureStackTrace(r2, V), r2;
47
- }
48
- return n;
49
- }
50
- let H = createContext(null);
51
- H.displayName = "DisclosurePanelContext";
52
- function De() {
53
- return useContext(H);
54
- }
55
- function Pe(e2, n) {
56
- return u$1(n.type, Te, e2, n);
57
- }
58
- let ye = Fragment;
59
- function me(e2, n) {
60
- let { defaultOpen: r2 = false, ...c$1 } = e2, s2 = useRef(null), d = y(n, T((u2) => {
61
- s2.current = u2;
62
- }, e2.as === void 0 || e2.as === Fragment)), t2 = useRef(null), o$12 = useRef(null), l = useReducer(Pe, { disclosureState: r2 ? 0 : 1, linkedPanel: false, buttonRef: o$12, panelRef: t2, buttonId: null, panelId: null }), [{ disclosureState: f, buttonId: i$1 }, T$12] = l, p = o((u2) => {
63
- T$12({ type: 1 });
64
- let P = u$3(s2);
65
- if (!P || !i$1) return;
66
- let y2 = (() => u2 ? u2 instanceof HTMLElement ? u2 : u2.current instanceof HTMLElement ? u2.current : P.getElementById(i$1) : P.getElementById(i$1))();
67
- y2 == null || y2.focus();
68
- }), E = useMemo(() => ({ close: p }), [p]), D2 = useMemo(() => ({ open: f === 0, close: p }), [f, p]), g = { ref: d };
69
- return React__default.createElement(M.Provider, { value: l }, React__default.createElement(k.Provider, { value: E }, React__default.createElement(u, { value: p }, React__default.createElement(c, { value: u$1(f, { [0]: i.Open, [1]: i.Closed }) }, H$1({ ourProps: g, theirProps: c$1, slot: D2, defaultTag: ye, name: "Disclosure" })))));
70
- }
71
- let Ee = "button";
72
- function ge(e2, n) {
73
- let r$1 = useId(), { id: c2 = `headlessui-disclosure-button-${r$1}`, disabled: s2 = false, autoFocus: d = false, ...t2 } = e2, [o$2, l] = F("Disclosure.Button"), f = De(), i2 = f === null ? false : f === o$2.panelId, T2 = useRef(null), p = y(T2, n, i2 ? null : o$2.buttonRef), E = I();
74
- useEffect(() => {
75
- if (!i2) return l({ type: 2, buttonId: c2 }), () => {
76
- l({ type: 2, buttonId: null });
77
- };
78
- }, [c2, l, i2]);
79
- let D$1 = o((a2) => {
80
- var S;
81
- if (i2) {
82
- if (o$2.disclosureState === 1) return;
83
- switch (a2.key) {
84
- case o$1.Space:
85
- case o$1.Enter:
86
- a2.preventDefault(), a2.stopPropagation(), l({ type: 0 }), (S = o$2.buttonRef.current) == null || S.focus();
87
- break;
88
- }
89
- } else switch (a2.key) {
90
- case o$1.Space:
91
- case o$1.Enter:
92
- a2.preventDefault(), a2.stopPropagation(), l({ type: 0 });
93
- break;
94
- }
95
- }), g = o((a2) => {
96
- switch (a2.key) {
97
- case o$1.Space:
98
- a2.preventDefault();
99
- break;
100
- }
101
- }), u2 = o((a2) => {
102
- var S;
103
- r(a2.currentTarget) || s2 || (i2 ? (l({ type: 0 }), (S = o$2.buttonRef.current) == null || S.focus()) : l({ type: 0 }));
104
- }), { isFocusVisible: P, focusProps: y$1 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: d }), { isHovered: U, hoverProps: h } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: s2 }), { pressed: N, pressProps: w$1 } = w({ disabled: s2 }), q = useMemo(() => ({ open: o$2.disclosureState === 0, hover: U, active: N, disabled: s2, focus: P, autofocus: d }), [o$2, U, N, P, s2, d]), G = T$1(e2, T2), z = i2 ? D({ ref: p, type: G, disabled: s2 || void 0, autoFocus: d, onKeyDown: D$1, onClick: u2 }, y$1, h, w$1) : D({ ref: p, id: c2, type: G, "aria-expanded": o$2.disclosureState === 0, "aria-controls": o$2.linkedPanel ? o$2.panelId : void 0, disabled: s2 || void 0, autoFocus: d, onKeyDown: D$1, onKeyUp: g, onClick: u2 }, y$1, h, w$1);
105
- return H$1({ mergeRefs: E, ourProps: z, theirProps: t2, slot: q, defaultTag: Ee, name: "Disclosure.Button" });
106
- }
107
- let Se = "div", be = M$1.RenderStrategy | M$1.Static;
108
- function Re(e2, n) {
109
- let r2 = useId(), { id: c2 = `headlessui-disclosure-panel-${r2}`, transition: s2 = false, ...d } = e2, [t2, o2] = F("Disclosure.Panel"), { close: l } = V("Disclosure.Panel"), f = I(), i$1 = y(n, t2.panelRef, (u2) => {
110
- a(() => o2({ type: u2 ? 4 : 5 }));
111
- });
112
- useEffect(() => (o2({ type: 3, panelId: c2 }), () => {
113
- o2({ type: 3, panelId: null });
114
- }), [c2, o2]);
115
- let T2 = u$2(), [p, E] = V$1(s2, t2.panelRef, T2 !== null ? (T2 & i.Open) === i.Open : t2.disclosureState === 0), D2 = useMemo(() => ({ open: t2.disclosureState === 0, close: l }), [t2.disclosureState, l]), g = { ref: i$1, id: c2, ...A(E) };
116
- return React__default.createElement(s$1, null, React__default.createElement(H.Provider, { value: t2.panelId }, H$1({ mergeRefs: f, ourProps: g, theirProps: d, slot: D2, defaultTag: Se, features: be, visible: p, name: "Disclosure.Panel" })));
117
- }
118
- let Ae = W(me), Ce = W(ge), Ie = W(Re), We = Object.assign(Ae, { Button: Ce, Panel: Ie });
119
- const accordion = "_accordion_18wwx_2";
120
- const header = "_header_18wwx_10";
121
- const title = "_title_18wwx_23";
122
- const icon = "_icon_18wwx_30";
123
- const panel = "_panel_18wwx_44";
124
- const open = "_open_18wwx_48";
125
- const m = "_m_18wwx_55";
126
- const s = "_s_18wwx_63";
127
- const cls = {
128
- accordion,
129
- header,
130
- title,
131
- "title-uppercase": "_title-uppercase_18wwx_26",
132
- icon,
133
- "icon-container": "_icon-container_18wwx_33",
134
- panel,
135
- open,
136
- m,
137
- s
138
- };
139
- const Accordion = forwardRef(
140
- ({ title: title2, children, size = EAccordionSize.M, titleUppercase }, ref) => {
141
- return /* @__PURE__ */ jsx("div", { className: classNames(cls.accordion, cls[size]), children: /* @__PURE__ */ jsx(We, { ref, children: ({ open: open2 }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
142
- /* @__PURE__ */ jsxs(Ce, { className: cls.header, children: [
143
- /* @__PURE__ */ jsx(
144
- "span",
145
- {
146
- className: classNames(
147
- cls.title,
148
- titleUppercase && cls["title-uppercase"]
149
- ),
150
- children: title2
151
- }
152
- ),
153
- /* @__PURE__ */ jsx(
154
- "div",
155
- {
156
- className: classNames(
157
- cls["icon-container"],
158
- open2 && cls.open
159
- ),
160
- children: /* @__PURE__ */ jsx(
161
- Icon,
162
- {
163
- iconName: size === EAccordionSize.S ? EAccordionIconSize.S : EAccordionIconSize.M,
164
- className: cls.icon
165
- }
166
- )
167
- }
168
- )
169
- ] }),
170
- /* @__PURE__ */ jsx(Ie, { className: cls.panel, children: /* @__PURE__ */ jsx(AccordionItem, { size, children }) })
171
- ] }) }) });
172
- }
173
- );
174
- export {
175
- Accordion
176
- };
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { EAccordionSize } from '../constants';
3
-
4
- export type TAccordionItemProps = {
5
- children: React.ReactNode;
6
- size: EAccordionSize;
7
- };
8
- export declare const AccordionItem: FC<TAccordionItemProps>;
@@ -1,16 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as classNames } from "../../../index-CweZ_OcN.js";
3
- import '../../../assets/AccordionItem.css';const item = "_item_1k68o_2";
4
- const m = "_m_1k68o_10";
5
- const l = "_l_1k68o_15";
6
- const cls = {
7
- item,
8
- m,
9
- l
10
- };
11
- const AccordionItem = ({ children, size }) => {
12
- return /* @__PURE__ */ jsx("div", { className: classNames(cls.item, cls[size]), children });
13
- };
14
- export {
15
- AccordionItem
16
- };
@@ -1 +0,0 @@
1
- export { AccordionItem, type TAccordionItemProps } from './AccordionItem';
@@ -1,4 +0,0 @@
1
- import { AccordionItem } from "./AccordionItem.js";
2
- export {
3
- AccordionItem
4
- };
@@ -1,8 +0,0 @@
1
- export declare enum EAccordionSize {
2
- M = "m",
3
- S = "s"
4
- }
5
- export declare enum EAccordionIconSize {
6
- M = "ArrowDown24px",
7
- S = "ArrowDown16px"
8
- }
@@ -1,14 +0,0 @@
1
- var EAccordionSize = /* @__PURE__ */ ((EAccordionSize2) => {
2
- EAccordionSize2["M"] = "m";
3
- EAccordionSize2["S"] = "s";
4
- return EAccordionSize2;
5
- })(EAccordionSize || {});
6
- var EAccordionIconSize = /* @__PURE__ */ ((EAccordionIconSize2) => {
7
- EAccordionIconSize2["M"] = "ArrowDown24px";
8
- EAccordionIconSize2["S"] = "ArrowDown16px";
9
- return EAccordionIconSize2;
10
- })(EAccordionIconSize || {});
11
- export {
12
- EAccordionIconSize,
13
- EAccordionSize
14
- };
@@ -1,3 +0,0 @@
1
- export { Accordion, type TAccordionProps } from './Accordion';
2
- export { EAccordionSize } from './constants';
3
- export { AccordionItem, type TAccordionItemProps } from './AccordionItem';
@@ -1,8 +0,0 @@
1
- import { Accordion } from "./Accordion.js";
2
- import { EAccordionSize } from "./constants.js";
3
- import { AccordionItem } from "./AccordionItem/AccordionItem.js";
4
- export {
5
- Accordion,
6
- AccordionItem,
7
- EAccordionSize
8
- };
@@ -1,44 +0,0 @@
1
- import { TInputProps } from '../Input';
2
-
3
- export type DatePicker = {
4
- /**
5
- * функция=callback, которая вызывается при изменении значения и передает имя и новое значение для обновления стейта (data),
6
- */
7
- onChangeValue?: (e: TDatePickerValue) => void;
8
- /**
9
- * функция ограничения выбора даты
10
- (до какой даты выбор не доступен)
11
- */
12
- before?: Date | string;
13
- /**
14
- * значение из стейта (data)
15
- */
16
- value?: string;
17
- } & TInputProps;
18
- export type TDatePickerValue = {
19
- value?: Date;
20
- name?: string;
21
- };
22
- export declare const DatePicker: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<{
23
- /**
24
- * функция=callback, которая вызывается при изменении значения и передает имя и новое значение для обновления стейта (data),
25
- */
26
- onChangeValue?: (e: TDatePickerValue) => void;
27
- /**
28
- * функция ограничения выбора даты
29
- (до какой даты выбор не доступен)
30
- */
31
- before?: Date | string;
32
- /**
33
- * значение из стейта (data)
34
- */
35
- value?: string;
36
- } & import('../Input/types').TInputProps & {
37
- size?: import('../Input').TSize;
38
- variant?: import('../Input').TVariant;
39
- className?: string;
40
- wrapperClassName?: string;
41
- label?: import('react').ReactNode;
42
- autofocus?: boolean;
43
- readonly?: boolean;
44
- } & import('react').RefAttributes<HTMLInputElement>>>;
@@ -1,69 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { memo, forwardRef, useState } from "react";
4
- import { c as cls, D as DatePickerModal } from "../../DatePickerModal-BM0BgzTb.js";
5
- import { useClickOutside } from "../../hooks/useClickOutside/useClickOutside.js";
6
- import { formating } from "../../utils/index.js";
7
- import { Button } from "../Button/Button.js";
8
- import { Input } from "../Input/Input.js";
9
- const DatePicker = memo(
10
- forwardRef(
11
- ({ size, value, onChangeValue, name, before, ...props }, ref) => {
12
- const [isActive, setActive] = useState(false);
13
- const [date, setDate] = useState(
14
- value ? new Date(value) : /* @__PURE__ */ new Date()
15
- );
16
- useClickOutside({
17
- isActive,
18
- setActive,
19
- className: cls["calendar-block"]
20
- });
21
- const onOpen = () => {
22
- setActive(true);
23
- };
24
- const onDate = (d) => {
25
- setDate(d);
26
- onChangeValue == null ? void 0 : onChangeValue({ value: d, name });
27
- };
28
- const wrapperClassNames = classNames(cls.wrapper, isActive && cls.active);
29
- return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
30
- /* @__PURE__ */ jsx("div", { className: cls["date-wrapper"], onClick: onOpen, children: /* @__PURE__ */ jsx(
31
- Input,
32
- {
33
- ref,
34
- className: cls.input,
35
- wrapperClassName: cls["input-wrapper"],
36
- size,
37
- type: "text",
38
- value: formating.Date(date, "dd.mm.yy"),
39
- ...props
40
- }
41
- ) }),
42
- /* @__PURE__ */ jsx("div", { className: cls["button-wrapper"], children: /* @__PURE__ */ jsx(
43
- Button,
44
- {
45
- isIconButton: true,
46
- clear: true,
47
- type: "button",
48
- className: cls.button,
49
- onClick: onOpen,
50
- iconName: isActive ? "DropdownArrowUp16px" : "DropdownArrowBottom16px"
51
- }
52
- ) }),
53
- isActive && /* @__PURE__ */ jsx(
54
- DatePickerModal,
55
- {
56
- onChangeValue: onDate,
57
- date,
58
- setActive,
59
- before: typeof before === "string" ? new Date(before) : before
60
- }
61
- )
62
- ] });
63
- }
64
- )
65
- );
66
- DatePicker.displayName = "DatePicker";
67
- export {
68
- DatePicker
69
- };
@@ -1,8 +0,0 @@
1
- type DatePickerModal = {
2
- date: Date;
3
- onChangeValue: (d: Date) => void;
4
- setActive: (s: boolean) => void;
5
- before?: Date;
6
- };
7
- export declare function DatePickerModal({ date, onChangeValue, setActive, before }: DatePickerModal): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,9 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "./constants.js";
4
- import { D } from "../../DatePickerModal-BM0BgzTb.js";
5
- import "../../utils/index.js";
6
- import "../Button/Button.js";
7
- export {
8
- D as DatePickerModal
9
- };
@@ -1,6 +0,0 @@
1
- export declare enum EDatePickerBeforeDate {
2
- CurrentDate1 = "2024-08-01",
3
- CurrentDate2 = "2024-07-01",
4
- CurrentDate3 = "2024-07-11"
5
- }
6
- export declare const week: string[];
@@ -1,11 +0,0 @@
1
- var EDatePickerBeforeDate = /* @__PURE__ */ ((EDatePickerBeforeDate2) => {
2
- EDatePickerBeforeDate2["CurrentDate1"] = "2024-08-01";
3
- EDatePickerBeforeDate2["CurrentDate2"] = "2024-07-01";
4
- EDatePickerBeforeDate2["CurrentDate3"] = "2024-07-11";
5
- return EDatePickerBeforeDate2;
6
- })(EDatePickerBeforeDate || {});
7
- const week = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"];
8
- export {
9
- EDatePickerBeforeDate,
10
- week
11
- };
@@ -1,2 +0,0 @@
1
- export { DatePicker } from './DatePicker';
2
- export type { DatePicker as TDatePickerProps, TDatePickerValue } from './DatePicker';
@@ -1,4 +0,0 @@
1
- import { DatePicker } from "./DatePicker.js";
2
- export {
3
- DatePicker
4
- };
@@ -1,38 +0,0 @@
1
- import { PropsWithChildren, ReactNode } from 'react';
2
- import { EDrawerPosition } from './constants';
3
-
4
- type TProps = {
5
- /**
6
- * Обязательный заголовок.
7
- */
8
- title: string;
9
- /**
10
- * Флаг отвечачающий за показ/скрытие.
11
- */
12
- isOpen?: boolean;
13
- /**
14
- * Настраиваемый паддинг для body, что бы избежать скачка контента при overflow: hidden
15
- */
16
- paddingRight?: number;
17
- /**
18
- * Функция закрытия шторки
19
- */
20
- onClose?: VoidFunction;
21
- /**
22
- * Дополнительный класс для родительской обертки.
23
- */
24
- className?: string;
25
- /**
26
- * Позиция шторки.
27
- */
28
- position?: `${EDrawerPosition}` | EDrawerPosition;
29
- /**
30
- * Кастомный footer. По дефолту в нем расположена кнопка для закрытия.
31
- */
32
- footer?: ReactNode;
33
- };
34
- /**
35
- * Компонент шторки, который может выезжать слева, справа или внизу.
36
- */
37
- export declare const Drawer: ({ isOpen, onClose, title, className, position, paddingRight, footer, children }: PropsWithChildren<TProps>) => import("react/jsx-runtime").JSX.Element | null;
38
- export {};
@@ -1,144 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { useState, useRef, useCallback, useEffect } from "react";
4
- import { EDrawerPosition } from "./constants.js";
5
- import { useMediaQuery } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
- import { EMediaQuery } from "../../hooks/useMediaQuery/constants.js";
7
- import { useLockBodyScroll } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
8
- import { Button } from "../Button/Button.js";
9
- import { EButtonVariantDefault, EButtonSize } from "../Button/constants.js";
10
- import { Portal } from "../Portal/Portal.js";
11
- import '../../assets/Drawer.css';const drawer = "_drawer_vy4rv_3";
12
- const content = "_content_vy4rv_17";
13
- const header = "_header_vy4rv_32";
14
- const title = "_title_vy4rv_40";
15
- const space = "_space_vy4rv_54";
16
- const inner = "_inner_vy4rv_65";
17
- const button = "_button_vy4rv_68";
18
- const footer = "_footer_vy4rv_73";
19
- const left = "_left_vy4rv_86";
20
- const right = "_right_vy4rv_90";
21
- const bottom = "_bottom_vy4rv_94";
22
- const opened = "_opened_vy4rv_103";
23
- const overlay = "_overlay_vy4rv_151";
24
- const cls = {
25
- drawer,
26
- content,
27
- header,
28
- title,
29
- space,
30
- inner,
31
- button,
32
- footer,
33
- "footer-button": "_footer-button_vy4rv_82",
34
- left,
35
- right,
36
- bottom,
37
- opened,
38
- "is-closing": "_is-closing_vy4rv_118",
39
- overlay
40
- };
41
- const ANIMATION_DELAY = 300;
42
- const Drawer = ({
43
- isOpen,
44
- onClose,
45
- title: title2,
46
- className,
47
- position = EDrawerPosition.RIGHT,
48
- paddingRight = 8,
49
- footer: footer2,
50
- children
51
- }) => {
52
- const [isClosing, setIsClosing] = useState(false);
53
- const [isMounted, setIsMounted] = useState(false);
54
- const [isBodyScrollLocked, setIsBodyScrollLocked] = useState(false);
55
- const timerRef = useRef();
56
- const contentRef = useRef(null);
57
- const isBottomPosition = position === EDrawerPosition.BOTTOM;
58
- const isMobile = useMediaQuery(EMediaQuery.XS1);
59
- useLockBodyScroll({
60
- on: isBodyScrollLocked,
61
- paddingRight
62
- });
63
- const handleClose = useCallback(() => {
64
- if (onClose) {
65
- setIsClosing(true);
66
- setIsBodyScrollLocked(false);
67
- timerRef.current = setTimeout(() => {
68
- onClose();
69
- setIsClosing(false);
70
- }, ANIMATION_DELAY);
71
- }
72
- }, [onClose]);
73
- const handleKeyDown = useCallback(
74
- (event) => {
75
- if (event.key === "Escape") {
76
- handleClose();
77
- }
78
- },
79
- [handleClose]
80
- );
81
- useEffect(() => {
82
- if (isOpen) {
83
- setIsBodyScrollLocked(true);
84
- setIsMounted(true);
85
- window.addEventListener("keydown", handleKeyDown);
86
- }
87
- return () => {
88
- setIsMounted(false);
89
- clearTimeout(timerRef.current);
90
- window.removeEventListener("keydown", handleKeyDown);
91
- };
92
- }, [isOpen, handleKeyDown]);
93
- const mods = {
94
- [cls.opened]: isMounted,
95
- [cls["is-closing"]]: isClosing
96
- };
97
- if (!isOpen) {
98
- return null;
99
- }
100
- return /* @__PURE__ */ jsxs(Portal, { children: [
101
- /* @__PURE__ */ jsx(
102
- "div",
103
- {
104
- "aria-hidden": isOpen,
105
- role: "dialog",
106
- style: {
107
- minHeight: isBottomPosition && contentRef.current ? contentRef.current.offsetHeight : void 0
108
- },
109
- className: classNames(cls.drawer, cls[position], mods, className),
110
- children: /* @__PURE__ */ jsxs("section", { className: classNames(cls.content, cls[position]), children: [
111
- /* @__PURE__ */ jsxs("header", { className: cls.header, children: [
112
- /* @__PURE__ */ jsx("h2", { className: cls.title, children: title2 }),
113
- /* @__PURE__ */ jsx("div", { className: cls.space, children: /* @__PURE__ */ jsx(
114
- Button,
115
- {
116
- variant: EButtonVariantDefault.SecondaryWhite,
117
- isIconButton: true,
118
- size: isMobile ? EButtonSize.S : EButtonSize.M,
119
- iconName: "Close16px",
120
- onClick: handleClose,
121
- className: cls.button
122
- }
123
- ) })
124
- ] }),
125
- /* @__PURE__ */ jsx("div", { ref: contentRef, className: cls.inner, children }),
126
- /* @__PURE__ */ jsx("footer", { className: cls.footer, children: footer2 || /* @__PURE__ */ jsx(
127
- Button,
128
- {
129
- size: isMobile ? EButtonSize.M : EButtonSize.XXL,
130
- full: isMobile,
131
- onClick: handleClose,
132
- className: cls["footer-button"],
133
- children: "Закрыть"
134
- }
135
- ) })
136
- ] })
137
- }
138
- ),
139
- /* @__PURE__ */ jsx("div", { className: classNames(cls.overlay, mods), onClick: handleClose })
140
- ] });
141
- };
142
- export {
143
- Drawer
144
- };
@@ -1,5 +0,0 @@
1
- export declare enum EDrawerPosition {
2
- LEFT = "left",
3
- RIGHT = "right",
4
- BOTTOM = "bottom"
5
- }
@@ -1,9 +0,0 @@
1
- var EDrawerPosition = /* @__PURE__ */ ((EDrawerPosition2) => {
2
- EDrawerPosition2["LEFT"] = "left";
3
- EDrawerPosition2["RIGHT"] = "right";
4
- EDrawerPosition2["BOTTOM"] = "bottom";
5
- return EDrawerPosition2;
6
- })(EDrawerPosition || {});
7
- export {
8
- EDrawerPosition
9
- };
@@ -1,2 +0,0 @@
1
- export { Drawer } from './Drawer';
2
- export { EDrawerPosition } from './constants';
@@ -1,6 +0,0 @@
1
- import { Drawer } from "./Drawer.js";
2
- import { EDrawerPosition } from "./constants.js";
3
- export {
4
- Drawer,
5
- EDrawerPosition
6
- };
@@ -1,23 +0,0 @@
1
- export type TListPhotos = {
2
- /**
3
- * Массив фото
4
- */
5
- value: TPhotosDetail[];
6
- /**
7
- * функция -callback, которая вызывается при изменении списка и передает обновленный список и deleteId,
8
- */
9
- onChange?: (e: TPhotoValue) => void;
10
- };
11
- export type TPhotoItem = {
12
- id: number;
13
- url: string;
14
- };
15
- export type TPhotoValue = {
16
- deleteId?: number;
17
- list: TPhotoItem[];
18
- };
19
- export type TPhotosDetail = {
20
- id: number;
21
- url: string;
22
- };
23
- export declare function ListPhotos({ value, onChange }: TListPhotos): import("react/jsx-runtime").JSX.Element;